@sagentlab/navarch-runtime 0.1.84 → 0.1.85
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/adapters/codex.cjs +11 -7
- package/package.json +1 -1
package/dist/adapters/codex.cjs
CHANGED
|
@@ -19,12 +19,15 @@ const kill_agent_cjs_1 = require("../kill-agent.cjs");
|
|
|
19
19
|
*
|
|
20
20
|
* Verified against codex-cli 0.144.1 on 2026-07-18:
|
|
21
21
|
*
|
|
22
|
-
* codex exec
|
|
22
|
+
* codex exec - --json [-c mcp_servers.<name>.<key>=<value>] [...extraArgs] < prompt
|
|
23
23
|
*
|
|
24
24
|
* - `exec <prompt>` — ASSUMED to be Codex CLI's non-interactive/headless
|
|
25
25
|
* subcommand (the `codex exec` "automation mode" analog of `claude -p`):
|
|
26
26
|
* runs the prompt to completion without the interactive TUI and exits,
|
|
27
|
-
* printing its result to stdout.
|
|
27
|
+
* printing its result to stdout. On the host the prompt is `-` and arrives
|
|
28
|
+
* on stdin: Linux rejects any single argv string over 128 KiB
|
|
29
|
+
* (MAX_ARG_STRLEN), so a large review prompt failed `spawn E2BIG` before
|
|
30
|
+
* Codex started (tobi-agent-5571, 2026-10-06).
|
|
28
31
|
* - `--json` emits top-level `thread.started`, `turn.started`,
|
|
29
32
|
* `item.completed`, and `turn.completed` JSONL events. See
|
|
30
33
|
* exit-conditions.cts for the tolerant parser.
|
|
@@ -45,7 +48,7 @@ const kill_agent_cjs_1 = require("../kill-agent.cjs");
|
|
|
45
48
|
* approval-bypass flag) without an adapter code change.
|
|
46
49
|
*/
|
|
47
50
|
async function runCodexAdapter(options) {
|
|
48
|
-
const args = ["exec", options.prompt];
|
|
51
|
+
const args = ["exec", options.dockerExec ? options.prompt : "-"];
|
|
49
52
|
const env = { ...options.env };
|
|
50
53
|
if (options.mcpConfigPath)
|
|
51
54
|
args.push(...(await codexMcpArgs(options.mcpConfigPath, env)));
|
|
@@ -173,10 +176,11 @@ async function runOnHost(options, args) {
|
|
|
173
176
|
cwd: options.cwd,
|
|
174
177
|
env: { ...process.env, ...options.env },
|
|
175
178
|
});
|
|
176
|
-
// `codex exec
|
|
177
|
-
//
|
|
178
|
-
//
|
|
179
|
-
child.stdin?.
|
|
179
|
+
// `codex exec -` reads the whole prompt from stdin and starts at EOF, so
|
|
180
|
+
// end the pipe after writing it. A child that exits before reading
|
|
181
|
+
// surfaces through `close`; ignore the resulting EPIPE here.
|
|
182
|
+
child.stdin?.on("error", () => undefined);
|
|
183
|
+
child.stdin?.end(options.prompt);
|
|
180
184
|
options.onProcessStarted?.(child.pid);
|
|
181
185
|
const timer = options.timeoutMs > 0 ? setTimeout(() => {
|
|
182
186
|
timedOut = true;
|
package/package.json
CHANGED