@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.
@@ -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 "<prompt>" --json [-c mcp_servers.<name>.<key>=<value>] [...extraArgs]
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` appends piped stdin to the prompt. The spawned process gets
177
- // a pipe by default, so close it immediately or it can wait forever for
178
- // input even though the full prompt was supplied as an argument.
179
- child.stdin?.end();
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sagentlab/navarch-runtime",
3
- "version": "0.1.84",
3
+ "version": "0.1.85",
4
4
  "description": "Navarch machine-side session manager: claims delivery tasks and runs them through local coding agents.",
5
5
  "type": "commonjs",
6
6
  "license": "MIT",