mirror of
https://github.com/openai/codex.git
synced 2026-11-19 22:30:42 +00:00
Add a dual-WebSocket transport for code mode (#36812)
## Why Large nested-tool callbacks can occupy a WebSocket and delay unrelated session operations on the same code-mode connection. ## What changed - Negotiate the optional `dual-websocket-v1` capability and pair a second, token-scoped WebSocket with the control connection. - Route nested-tool callbacks and their results over the bulk socket while keeping session operations, notifications, and execution responses on the control socket. Reject messages sent on the wrong lane. - Preserve the single-connection transport when the capability is unavailable, and bound pairing, queued callbacks, and deferred cross-socket messages. - Defer callbacks that arrive before their execution-started response, and return delegate errors without disconnecting the connection. ## Testing Add protocol, transport, driver, and WebSocket integration coverage for capability negotiation, lane routing, pairing failures, out-of-order messages, and progress during large concurrent tool results. GitOrigin-RevId: fa4504653e7cbf3c4ec930ae57aa0a41345bad66
This commit is contained in:
committed by
copyberry
parent
b258c028fe
commit
60c722e075
@@ -52,6 +52,15 @@ impl RequestTracker {
|
||||
})
|
||||
}
|
||||
|
||||
pub(super) fn has_pending_execute_for_session(&self, session_id: &SessionId) -> bool {
|
||||
self.pending.values().any(|request| {
|
||||
matches!(
|
||||
request,
|
||||
PendingRequest::Execute { session, .. } if session.id == *session_id
|
||||
)
|
||||
})
|
||||
}
|
||||
|
||||
pub(super) fn allocate_id(&mut self) -> Result<RequestId, String> {
|
||||
let id = self.next_request_id;
|
||||
self.next_request_id = self
|
||||
|
||||
Reference in New Issue
Block a user