mirror of
https://github.com/openai/codex.git
synced 2026-10-19 17:28:46 +00:00
## Why Steering an active WebSocket response previously dropped the connection and resent the full history. Draining the response preserves the connection and allows the follow-up request to continue with `previous_response_id`. ## What changed - Drain WebSocket responses when steering. For models using `use_responses_lite`, first send `response.interrupt` with `mode: "discard_partial_items"` once the response ID is available. - Treat `response.incomplete` with reason `interrupted` as completion with `end_turn: false`, preserving token usage and allowing the turn to continue. Other incomplete reasons remain errors. ## Testing Update the steering integration test to cover completed and discarded reasoning items, asserting connection reuse, incremental follow-up input, and token usage from the interrupted response. GitOrigin-RevId: bc714b713e797cf1a67e3b26ffbf7664cb92eb33