Preserve HTTP fallback for delegated sessions (#38681)

## Why

Responses WebSocket fallback is session-scoped. A delegated session created
after its parent switched to HTTP could otherwise make another WebSocket
connection attempt.

## What changed

Disable WebSocket support for a delegated session when the parent session has
already fallen back to HTTP.

## Testing

Add a guardian review regression test that verifies only the parent's initial
WebSocket attempt occurs and the guardian request uses the HTTP response path.

GitOrigin-RevId: 1345f8fe739f55975aef432045348eae5a9278d6
This commit is contained in:
Dylan Hurd
2026-08-15 01:24:46 +00:00
committed by copyberry
parent 22bf16a37e
commit 4e9a1a9073
2 changed files with 81 additions and 0 deletions
+4
View File
@@ -66,6 +66,10 @@ pub(crate) async fn run_codex_thread_interactive(
));
}
config.permissions.approval_policy = Constrained::allow_only(AskForApproval::Never);
config.model_provider.supports_websockets &= parent_session
.services
.model_client
.responses_websocket_enabled();
let (tx_sub, rx_sub) = async_channel::bounded(SUBMISSION_CHANNEL_CAPACITY);
let (tx_ops, rx_ops) = async_channel::bounded(SUBMISSION_CHANNEL_CAPACITY);