Repository navigation
feat(codex): zstd-compress Codex OAuth turn bodies and stop advertising gzip upstream - #180
Merged
Merged
Conversation
added 3 commits
September 18, 2026 05:31
…ng gzip upstream - compress the streaming /backend-api/codex/responses request body with zstd (level 3, Content-Encoding: zstd) for OpenAI OAuth-like accounts at send time, on a wire clone so reasoning recovery, diagnostics and retries keep reading plain JSON; compact and other requests stay uncompressed like the official client; gateway.openai_codex_request_zstd (default true) turns it off - disable Go's automatic Accept-Encoding: gzip on the OpenAI HTTP transports and on the WebSocket handshake client; compressed responses are still decoded manually
…bodies, cover alpha-search fallback - replayable requests are compressed from a GetBody snapshot so the original request is never touched; non-replayable requests propagate a body read error instead of sending a truncated prefix; encoder failures fall back to plaintext - route every Responses-endpoint POST through doOpenAICodexUpstream, including the PAT/OAuth alpha-search web-search fallback
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Third PR of the Codex identity series (after #178 and #179).
/backend-api/codex/responsesrequest bodies of OpenAI OAuth-like accounts are zstd-compressed (level 3,Content-Encoding: zstd) at send time, matching the official Codex client, which compresses only these turns. Compression happens on a wire clone after every body rewrite, so reasoning recovery, diagnostics and retries keep reading plain JSON. Replayable requests are compressed from aGetBodysnapshot; a body read failure on a non-replayable request is reported as a transport error instead of sending a truncated body.gateway.openai_codex_request_zstd(defaulttrue) turns it off.openai_h2,openai_h1,openai_h1_fallback) and the WebSocket handshake client no longer let Go addAccept-Encoding: gzip; compressed responses are still decoded by the existing response decompression.Verification
go build ./...,go vet -tags=unitpass on the tree rebased onto feat(codex): per-account Codex TUI identity, device-default fingerprint, hyphen session headers #179.TestOllamaProbeCallback_StaleLongDoesNotOverrideNewShortfailure (fails on main as well); repository, config, cmd/server and handler packages pass.🤖 Generated with Claude Code