fix(sse): re-enable prompt compression for native Codex passthrough - #12834
Merged
diegosouzapw merged 1 commit intoSep 6, 2026
Conversation
Native Codex passthrough (POST /v1/responses, provider=codex) was unconditionally excluded from prompt compression, writing only skip_reason='excluded' analytics rows. Prompt compression now depends only on the operator exclusions list; reactive compaction and combo overflow fail-fast intentionally still bypass (prompt-only scope). Closes diegosouzapw#12793 Regression guard: tests/unit/codex-prompt-compression-passthrough.test.ts
alvinveroy
added a commit
to alvinveroy/OmniRoute
that referenced
this pull request
Sep 6, 2026
- take upstream useSyncExternalStore combos usage-guide (diegosouzapw#12671) over our queueMicrotask lint defuse (supersedes it; suppression already dropped) - file-size baseline: combos/page.tsx 5066 (upstream shape); keep both _rebaseline entries (bounded-abort/tls-ladder + 12671 external store) - upstream additions folded in: diegosouzapw#12682 sqlite cleanup, diegosouzapw#12691 tool_calls guard, diegosouzapw#12834 codex compression re-enable, diegosouzapw#12707 continuation, diegosouzapw#12710 video-transcript redaction, diegosouzapw#12699 npmrc shipping, docker/deps/docs
This was referenced Sep 6, 2026
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
Native Codex passthrough (
POST /v1/responses,provider=codex, e.g. opencode → omniroute) silently stopped producing compression savings: 100% of codex rows incompression_analyticsbecameskip_reason='excluded', mode='off', tokens_saved=0whilecall_logsvolume continued.Root cause: Commit
32f83407(2026-08-11, #8933) addednativeCodexPassthrough ||to the prompt-compression exclusion gate. Carried onto release line via65e81158a(v3.8.50, #11088 sync).Fix (prompt-only scope)
open-sse/handlers/chatCore.ts:compressionExcludedno longer includesnativeCodexPassthrough; prompt compression now depends only on the operator exclusions list (#8034). Native contexts compress via the existingadaptBodyForCompression()Responses→messages adapter with codex tool-output eligibility guards. Operators who want byte-identical passthrough can addcodex/*to exclusions.Deliberately NOT changed (reactive + combo deferral)
!nativeCodexPassthroughgates inchatCore.ts) still bypass native passthrough. These passes rewrite history (trim_tools/purify_history) and are the overflow safety net — re-enabling them for stateful Responses contexts needs its own validation.dispatchPrelude/knownContextOverflow,#10225/#10503) still treats native-codex pools as incompressible, so oversized requests keep failing fast locally instead of sailing upstream uncompressed.#10503comments.Regression Analysis & Verification
See issue comment: #12793 (comment)
Timeline:
reactiveContextCompactionEnabledto honor global compression "off" for reactive compactionnativeCodexPassthrough ||tocompressionExcluded, unconditionally disabling ALL compression for Codex/v1/responsesWhy #9200 didn't prevent this: #8933 came AFTER #9200 and added a NEW unconditional bypass that overrode the global switch #9200 introduced.
What #8933 actually fixed (verified still intact with my PR):
codex.ts):repairMissingCodexToolCallOutputs- ensures function_call_output items exist for every function_call ✅ (43/43 tests pass)bodyAdapter.ts): Enhanced to properly track/restorecustom_tool_call↔custom_tool_call_outputpairing during compression ✅ (11/11 tests pass)clientManagedResponsesContextflag): Allows native Codex clients to self-manage context overflow ✅ (17/17 tests pass, including "native Responses context reaches an all-Codex target beyond its catalog hint")#9200 fix verified intact: Global compression "off" still gates reactive/last-resort compaction ✅ (1/1 test passes)
Validation
tests/unit/codex-prompt-compression-passthrough.test.ts(3/3 pass; first assertion fails on pre-fix source).compression-exclusions(8/8),chatcore-request-format(9/9),combo-context-overflow-compression-probe(5/5 substantive incl. end-to-end chatCore compression dispatch; file has pre-existing teardown DB handle hang unrelated to this change),executor-codex(43/43),body-adapter(11/11),combo-context-window-filter(17/17),reactive-context-compaction-policy(1/1).Related
Closes #12793