codex/codex-rs/code-mode-protocol/src
surajs-oai 137f25f643 Recover gRPC code-mode sessions after missing-session errors (#52235)
## 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
History 2026-10-08 19:15:17 +00:00
..
grpc Recover gRPC code-mode sessions after missing-session errors (#52235) 2026-10-08 19:15:17 +00:00
host Add early yielding for code-mode observations (#48123) 2026-09-25 15:42:35 +00:00
description.rs Add ranked tool discovery to JavaScript code mode (#51209) 2026-10-06 00:36:25 +00:00
description_override_tests.rs Add ranked tool discovery to JavaScript code mode (#51209) 2026-10-06 00:36:25 +00:00
json_schema_types.rs Make MCP and Code Mode input schema budgets configurable (#47936) 2026-09-24 20:39:37 +00:00
json_schema_types_tests.rs Make MCP and Code Mode input schema budgets configurable (#47936) 2026-09-24 20:39:37 +00:00
lib.rs Add ranked tool discovery to JavaScript code mode (#51209) 2026-10-06 00:36:25 +00:00
response.rs Add audio output support to dynamic tools and code mode (#34080) 2026-07-18 23:22:13 +00:00
runtime.rs Report code mode host request durations (#41452) 2026-08-29 02:52:58 +00:00
runtime_tests.rs Report code mode host request durations (#41452) 2026-08-29 02:52:58 +00:00
session.rs Add early yielding for code-mode observations (#48123) 2026-09-25 15:42:35 +00:00
session_tests.rs code-mode standalone: extract protocol and add host crate (#27724) 2026-06-11 22:37:26 -07:00