mirror of
https://github.com/openai/codex.git
synced 2026-10-28 18:58:46 +00:00
Enable zstd compression for code-mode gRPC responses (#57212)
## What changed - Configure the code-mode host to send zstd-compressed responses when clients advertise support, and enable both client transports to accept them. - Preserve uncompressed responses for clients that do not advertise zstd support. - Patch `tonic` in Bazel builds to use zstd compression level 1, favoring response latency over compression ratio. ## Testing Extend the TCP session integration test to check response encoding and successful session opening for both zstd-capable and uncompressed-only clients. GitOrigin-RevId: b6cf0da51dd30fc2ac9a1b0af11bec26555c559d
This commit is contained in:
@@ -42,6 +42,7 @@ impl SharedTransport {
|
||||
let transport = channel.map_err(|error| Status::from_error(Box::new(error)));
|
||||
Self::Connected(
|
||||
CodeModeHostClient::new(BoxCloneSyncService::new(transport))
|
||||
.accept_compressed(tonic::codec::CompressionEncoding::Zstd)
|
||||
.max_decoding_message_size(MAX_FRAME_BYTES)
|
||||
.max_encoding_message_size(MAX_FRAME_BYTES),
|
||||
)
|
||||
@@ -132,6 +133,7 @@ impl SharedTransport {
|
||||
CodeModeHostClient::with_origin(BoxCloneSyncService::new(transport), origin)
|
||||
};
|
||||
let client = client
|
||||
.accept_compressed(tonic::codec::CompressionEncoding::Zstd)
|
||||
.max_decoding_message_size(MAX_FRAME_BYTES)
|
||||
.max_encoding_message_size(MAX_FRAME_BYTES);
|
||||
*cached = Some((bound_factory, client.clone()));
|
||||
|
||||
Reference in New Issue
Block a user