mirror of
https://github.com/openai/codex.git
synced 2026-10-18 17:18:52 +00:00
## Why A host can reject a request for an unknown session while its lease streams remain open. Keeping that session binding prevents subsequent execution from recovering. ## What changed Invalidate the session when `Execute` (including its response stream), `Wait`, or `Terminate` returns `NOT_FOUND`, allowing the next execution to open a fresh session. Return the failed call's error without replaying execution. Document that these RPCs reserve `NOT_FOUND` for unknown sessions, while `CompleteToolCall` can use it for a missing invocation. ## Testing Add regression coverage for recovery with lease streams still open, no replay of failed execution, and preservation of session state after `INVALID_ARGUMENT`. Add a cancellation-race test confirming that a late tool-completion `NOT_FOUND` leaves the session open. GitOrigin-RevId: 85b38fdbd6d59268447b6aa6a85ea7c60ec869a7