Fix compressed Codex model routing - #3
Merged
Conversation
Codex compressed Responses requests with zstd, so the Node 18 router could not inspect the model and sent Kenari slugs to the native upstream. Disable process-scoped compression and reject overrides that could re-enable it.
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.
What changed
@kenarihq/cli@0.3.2.Root cause
Codex 0.145 compresses Responses API bodies with zstd. Kenari supports Node 18, whose built-in zlib cannot decode zstd. The router therefore could not read the model ID and treated the request as native. The native ChatGPT backend received the unchanged
kenari/...slug and rejected it.Disabling compression at the Codex process boundary keeps the request inspectable on every supported Node version. The router can then select the correct upstream, remove the
kenari/namespace, and isolate credentials.Impact
Kenari models now work from Codex sessions authenticated through ChatGPT. Native ChatGPT models continue to use the ChatGPT Codex backend.
Checks
npm test, 85 passinggpt-5.4native route through ChatGPT loginkenari/deepseek-v4-flashroute through the Kenari gatewaynpm pack --dry-run --jsongit diff --check