mirror of
https://github.com/openai/codex.git
synced 2026-10-28 18:58:46 +00:00
Allow large file writes over direct exec-server WebSockets (#54135)
## Why Direct mode serves executor requests but applied the client's 8 KiB inbound request limit, causing larger `fs/writeFile` requests to disconnect the executor. ## What changed Use a dedicated direct WebSocket connection constructor that omits the client inbound request limit while retaining WebSocket message and frame limits. ## Testing Add a regression test that runs the direct environment and verifies successful file writes above the client request limit using both text and binary WebSocket messages. GitOrigin-RevId: e8e77a5e8581ab9eb98446e23b77a6da41d64868
This commit is contained in:
@@ -481,6 +481,22 @@ impl JsonRpcConnection {
|
||||
)
|
||||
}
|
||||
|
||||
/// Direct mode dials the WebSocket but serves executor requests from the
|
||||
/// harness. Do not apply the harness client's inbound request limit here;
|
||||
/// the WebSocket transport still enforces its message and frame limits.
|
||||
pub(crate) fn from_direct_websocket<T, E>(stream: T, connection_label: String) -> Self
|
||||
where
|
||||
T: Sink<Message, Error = E> + Stream<Item = Result<Message, E>> + Unpin + Send + 'static,
|
||||
E: std::fmt::Display + Send + 'static,
|
||||
{
|
||||
Self::from_websocket_stream(
|
||||
stream,
|
||||
connection_label,
|
||||
/*ping_interval*/ None,
|
||||
/*max_inbound_request_len*/ None,
|
||||
)
|
||||
}
|
||||
|
||||
pub(crate) fn from_axum_websocket(stream: AxumWebSocket, connection_label: String) -> Self {
|
||||
Self::from_websocket_stream(
|
||||
stream,
|
||||
|
||||
Reference in New Issue
Block a user