mirror of
https://github.com/openai/codex.git
synced 2026-11-06 20:20:34 +00:00
## Why A Code Mode script can start a command without returning its session handle. Make retained sessions visible to the model so it can find running commands and collect exited results with `write_stdin`. ## What changed - Add the disabled-by-default `command_sessions_world_state` feature. - Publish snapshots of up to 16 retained sessions with their IDs, running or exited status, and whether they are in use. Report omitted sessions and suppress unchanged updates. - Preserve session visibility when `write_stdin` is unavailable and refresh snapshots after compaction. Clear stale session handles after restart or when the feature is disabled. ## Testing Add an end-to-end scenario and model-visible history snapshot covering a dropped command handle, unchanged state, unavailable polling, compaction, exit and result collection, and stale-handle cleanup after restart. GitOrigin-RevId: 45704d8c6403149997231aafb8496c12879aff23