fix(codex): strip include from compact responses requests - #6805
Merged
diegosouzapw merged 2 commits intoJul 10, 2026
Merged
diegosouzapw merged 2 commits into
diegosouzapw merged 2 commits into
Conversation
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
includefrom Codex/responses/compactrequests.ensureCodexReasoningSummary(), because that helper can re-addinclude: ["reasoning.encrypted_content"]when reasoning is enabled./responsesbehavior unchanged, including encrypted reasoning content replay support.Related Issues
Context / Root Cause
/responses/compactis stricter than normal Codex/responses. OmniRoute already treats it specially by removing fields such asstream,stream_options,client_metadata, andstore. The remaining gap isinclude.The failure path is:
CodexExecutor.transformRequest()withrequestEndpointPath: "/responses/compact".ensureCodexReasoningSummary()sees a non-nonereasoning effort and re-addsinclude: ["reasoning.encrypted_content"].400 Unknown parameter: 'include'.This PR deletes
includein the compact branch, and deletes it again after reasoning summary injection so the final compact payload stays compatible.Upstream Codex has the same split between normal Responses payload construction and compact payload construction:
build_responses_request()addsincludefor normal reasoning-enabled Responses requests: https://github.com/openai/codex/blob/1f0566d3f59298d1bb88820a0d35294f1eeb07ea/codex-rs/core/src/client.rs#L874-L910compact_conversation_history()then builds anApiCompactionInputfrom a limited field set and does not forwardinclude,stream,store,tool_choice, orclient_metadata: https://github.com/openai/codex/blob/1f0566d3f59298d1bb88820a0d35294f1eeb07ea/codex-rs/core/src/client.rs#L573-L596responses/compactas a unary endpoint: https://github.com/openai/codex/blob/1f0566d3f59298d1bb88820a0d35294f1eeb07ea/codex-rs/codex-api/src/endpoint/compact.rs#L35-L52Validation
npm run lintnpm run test:unitnpm run test:coverage>= 60%for statements, lines, functions, and branchesFocused validation run locally:
node --import tsx/esm --test tests/unit/executor-codex.test.ts— 40/40 passingGITHUB_BASE_REF=main node scripts/check/check-pr-test-policy.mjs— PASS after adding the regression assertionGITHUB_BASE_REF=main npm run check:test-masking— PASScheck:any-budget:t11,check:tracked-artifactscheck:any-budget:t11,check:tracked-artifactsTest Output
Tests Added Or Updated
tests/unit/executor-codex.test.tsnow asserts compact requests stripincludewhile preserving existing compact passthrough behavior.Coverage Notes
The production change is limited to
open-sse/executors/codex.ts. It only affects requests detected as Codex/responses/compact; normal/responsesrequests still keepincludewhen reasoning summary support requires encrypted reasoning content.Reviewer Notes
delete body.includecalls are intentional:includefrom compact requests;ensureCodexReasoningSummary()can synthesize later.