Skip to content

🤖 fix: strip unsupported truncation from Codex OAuth requests#3153

Open
ammar-agent wants to merge 1 commit intomainfrom
fix/codex-oauth-strip-truncation
Open

🤖 fix: strip unsupported truncation from Codex OAuth requests#3153
ammar-agent wants to merge 1 commit intomainfrom
fix/codex-oauth-strip-truncation

Conversation

@ammar-agent
Copy link
Copy Markdown
Collaborator

Summary

Strip the unsupported truncation field from Codex OAuth Responses requests before rerouting them to ChatGPT's Codex backend.

Background

A recent regression in Mike's 2662aedd8 change (🤖 fix: align GitHub Copilot model routing (#3104)) started preserving OpenAI's truncation field inside normalizeCodexResponsesBody(). A user then hit the backend error:

{ "detail": "Unsupported parameter: truncation" }

The public OpenAI Responses API accepts truncation, but the ChatGPT Codex endpoint used by OAuth (https://chatgpt.com/backend-api/codex/responses) does not.

Implementation

  • remove truncation from the Codex-compatible allowlist
  • explicitly delete json.truncation during Codex request normalization
  • update the regression tests to assert that Codex-normalized bodies strip truncation
  • clarify the fetch-wrapper comments so they describe Codex request normalization instead of defaulting truncation

Validation

  • bun test src/node/services/providerModelFactory.test.ts
  • bun test src/node/services/codexOauthService.test.ts
  • make static-check

Risks

Low. The change only affects the Codex OAuth request-normalization path and restores the pre-regression behavior for a field that the target endpoint rejects.


Generated with mux • Model: openai:gpt-5.4 • Thinking: xhigh • Cost: $1.79

The ChatGPT Codex Responses endpoint rejects the OpenAI `truncation`
parameter, so Codex OAuth requests must strip it even when the public
Responses API would accept it. Restore that behavior in the request
normalizer and lock it in with regression coverage.

---

_Generated with `mux` • Model: `openai:gpt-5.4` • Thinking: `xhigh` • Cost: `$1.79`_

<!-- mux-attribution: model=openai:gpt-5.4 thinking=xhigh costs=1.79 -->
@ammar-agent
Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector
Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Swish!

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Copy link
Copy Markdown
Contributor

@coadler coadler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

works after updating to this branch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants