@span-io/agent-link 0.0.3 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +11 -1
- package/dist/process-runner.js +9 -4
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -89,9 +89,19 @@ function handleControl(message) {
|
|
|
89
89
|
else if (targetModel.startsWith("claude-")) {
|
|
90
90
|
preferredAgent = "claude";
|
|
91
91
|
}
|
|
92
|
+
else if (targetModel.includes("codex") || targetModel.startsWith("gpt-")) {
|
|
93
|
+
preferredAgent = "codex";
|
|
94
|
+
}
|
|
92
95
|
}
|
|
93
96
|
if (!preferredAgent) {
|
|
94
|
-
|
|
97
|
+
// Only use payload.name if it matches a known binary, otherwise default to codex
|
|
98
|
+
const candidateName = payload?.name?.toLowerCase();
|
|
99
|
+
if (candidateName && ["codex", "gemini", "claude"].includes(candidateName)) {
|
|
100
|
+
preferredAgent = candidateName;
|
|
101
|
+
}
|
|
102
|
+
else {
|
|
103
|
+
preferredAgent = "codex";
|
|
104
|
+
}
|
|
95
105
|
}
|
|
96
106
|
const agentCandidate = resolveAgentBinary(preferredAgent, discovered);
|
|
97
107
|
if (!agentCandidate) {
|
package/dist/process-runner.js
CHANGED
|
@@ -94,10 +94,15 @@ export function spawnAgentProcess(config) {
|
|
|
94
94
|
const workingDir = process.env.CODEX_CWD ?? defaultCwd;
|
|
95
95
|
// For logging/display
|
|
96
96
|
const commandString = [command, ...args].map(shellQuote).join(" ");
|
|
97
|
-
const
|
|
98
|
-
|
|
99
|
-
const
|
|
100
|
-
|
|
97
|
+
const platform = process.platform;
|
|
98
|
+
const canUseScript = useScriptWrapper && platform !== "win32";
|
|
99
|
+
const finalCommand = canUseScript ? "script" : command;
|
|
100
|
+
const finalArgs = canUseScript
|
|
101
|
+
? platform === "darwin"
|
|
102
|
+
// BSD script: no -c, use "script -q /dev/null sh -c <command>"
|
|
103
|
+
? ["-q", "/dev/null", "sh", "-c", commandString]
|
|
104
|
+
// GNU script: "script -q -c <command> /dev/null"
|
|
105
|
+
: ["-q", "-c", commandString, "/dev/null"]
|
|
101
106
|
: args;
|
|
102
107
|
const child = spawn(finalCommand, finalArgs, {
|
|
103
108
|
stdio: [promptMode === "stdin" ? "pipe" : "ignore", "pipe", "pipe"],
|