Skip to main content

Module codex_cli_executor

Module codex_cli_executor 

Source
Expand description

CodexExecutor: drives codex exec --json as a one-shot ChildExecutor (ExecutorSpec::Codex). CodexExecutor: a [ChildExecutor] that drives the official OpenAI Codex CLI through codex exec --json.

The CLI is one process per activation. Prompts are written on stdin (never argv), stdout is consumed as bounded JSONL, and the process owns a process group so cancellation tears down any descendants as well as the leader. Provider/auth selection and Bamboo permission-profile mapping are resolved before every spawn. Thread ids are persisted per child so later activations can use codex exec resume, with bounded history rehydration when the local Codex transcript is unavailable.

Structs§

CodexAuthConfig
Fully resolved auth posture. The custom-provider key is deliberately private and this type has no Debug implementation, preventing accidental secret logging from executor/spec diagnostics.
CodexExecutor
One-process-per-activation Codex CLI executor.
CodexPermissionConfig

Enums§

CodexAuthMode

Constants§

MIN_CODEX_VERSION
The oldest Codex CLI schema this executor intentionally supports. The executor additionally capability-checks exec --help and exec resume --help, so a backported or vendor build must still expose the required flags. Version 0.144 is the schema verified by issue #569. The oldest Codex CLI schema Bamboo intentionally supports.

Functions§

read_codex_provider_token
Read the short-lived Bamboo provider token for Codex command-backed auth. The final path component is opened without following symlinks on Unix, and permissions are verified on the opened descriptor to avoid check/open races.
resolve_codex_app_server_permission_config
App-server mode always routes approvals to Bamboo. Accepting never or on-failure here would make the selected transport’s safety contract lie.
resolve_codex_auth_config
Resolve and validate the public provision fields plus the one referenced provider credential carried in the in-memory secrets envelope.
resolve_codex_permission_config
resolve_codex_state_dir
Resolve the per-child directory used for --output-last-message.