Files
codex/codex-rs/thread-manager-sample
jif db7516f41b Reduce the default thread unload delay to one minute (#57242)
## What changed

Change the default `thread_unload_delay_secs` from 1800 to 60 seconds. App-server threads become eligible for unloading after one minute with no subscribers and no activity. Update the configuration documentation, schema, and thread manager sample to match.

## Testing

Update the configuration test to cover the 60-second default, zero for immediate unloading, and an explicit 1800-second override.

GitOrigin-RevId: 0da8454eb25a6ef4b7e3665601982d2e0c183f7c
2026-10-26 20:44:30 +00:00
..

ThreadManager Sample

Small one-shot binary that starts a Codex thread with ThreadManager from codex-core-api, submits a single user turn, and prints the final assistant message.

Authentication uses the configured credential storage under CODEX_HOME, including cli_auth_credentials_store, mcp_oauth_credentials_store, and features.secret_auth_storage. Local managed authentication requirements and auth routing settings are respected. This also applies to cargo run builds. Other execution settings remain the sample's built-in configuration.

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