Expand description
Codex runtime: build the codex CLI invocation for a resident agent.
Codex (0.120.0+) has no --append-system-prompt / --base-instructions-file
flag. We pass the rendered netsky prompt as codex’s positional [PROMPT]
arg instead, read at exec time from $NETSKY_PROMPT_FILE via the same
$(cat ...) shell trick the claude runtime uses to avoid tmux’s
command too long argv limit.
The rendered prompt includes the full base.md + per-agent identity
stanza + cwd addendum, so the Codex session receives the same
“you are agentcodex_agent.rs remains for one-off prompt / drain invocations; the
resident path lives here.
Startup (/up) parity: codex’s positional [PROMPT] arg is already
spoken for by the rendered netsky prompt — codex treats it as the
first user turn. The startup prompt therefore lands as a follow-on
user turn, pasted into the tmux pane via paste_startup once the
session is up. Claude passes startup inline as a second positional.
Structs§
- Codex
Config - Per-agent codex-CLI configuration.
- Tmux
Pane Io - Live
PaneIothat shells out to thetmuxCLI. Used by the productionpost_spawnhook.
Constants§
Traits§
- PaneIo
- Minimal pane-IO abstraction used by
paste_startup. A live impl (TmuxPaneIo) shells out totmux; tests provide a mock that records calls and simulates capture output.
Functions§
- paste_
startup - Paste
startupinto a live codex tmux pane as a follow-on user turn. Dismisses codex’s per-cwd “Do you trust” dialog if present, then retries send-text + send-Enter untilcaptureechoes the text orattemptsis exhausted. Matches the retry pattern inbin/test-resident-codex(the smoke test paste ofnetsky channel drain).