CodexWrapper.Runner.Port (CodexWrapper v0.5.8)

Copy Markdown View Source

Default runner: a /bin/sh Port with stdin redirected from /dev/null (Codex CLI hangs if stdin is inherited from the parent), wrapped in a Task for timeout enforcement.

This is the execution path the library has always used. On a timeout it brutal-kills the Task, which closes the port but sends no signal to the OS process group. codex and any subprocess it spawned (stdio MCP servers, tool helpers) may keep running until they next touch a closed pipe. For strict termination, use CodexWrapper.Runner.Forcola (see CodexWrapper.Runner and #48).

stream_lines/4 uses the same /bin/sh wrapper in :line mode. Its timeout bounds the whole run; opts[:idle_timeout_ms] independently bounds the wait between output frames. A JSONL line over 1 MiB ends the stream with {:error, {:line_too_long, 1_048_576}}.