Forward gRPC code-mode callbacks to session delegates (#38072)

## What changed

- Subscribe each gRPC code-mode session to nested tool calls and forward tool and notification callbacks to its delegate.
- Complete tool calls through the host while bounding oversized results and errors.
- Track callback ownership and cancellation so completed cells drain notifications, terminated cells cancel them, and shutdown revokes outstanding work.
- Validate callback identifiers, cell ownership, enabled tools, and pending callback limits without serializing independent callbacks or sessions.

## Testing

- Add integration and state tests for callback forwarding, completion ordering, cancellation, malformed callbacks, delegate panics, oversized results, and concurrent work.

GitOrigin-RevId: 005afbb90eea0eb77d746b930a1a96ca6dfcd4e7
This commit is contained in:
Channing Conger
2026-08-11 20:35:11 +00:00
committed by copyberry
parent b43de77679
commit ba2fb48319
16 changed files with 1710 additions and 51 deletions

View File

@@ -5,3 +5,4 @@ pub use code_mode_proto::codex::code_mode::v1::*;
tonic::include_proto!("codex.code_mode.v1");
pub const MAX_IDENTIFIER_BYTES: usize = 256;
pub const MAX_TOOL_ERROR_BYTES: usize = 64 * 1_024;