mirror of
https://github.com/openai/codex.git
synced 2026-09-05 15:18:41 +00:00
ThreadManager Sample
Small binary that starts a Codex thread with ThreadManager from
codex-core-api, submits a user turn, and prints mapped notifications as
newline-delimited JSON.
cargo run -p codex-thread-manager-sample -- "Say hello"
Use --model to override the configured default model:
cargo run -p codex-thread-manager-sample -- --model gpt-5.2 "Say hello"
The prompt can also be piped through stdin:
printf 'Say hello\n' | cargo run -p codex-thread-manager-sample
To install the demo idle extension, pass --keep-going-on-idle. The extension
listens for the thread idle lifecycle event and starts another turn with a
keep going user message each time the thread becomes idle. The sample keeps
running until interrupted or until the thread reports an error:
cargo run -p codex-thread-manager-sample -- --keep-going-on-idle "Say hello"