Skip to content

fix(codex): drop top-level max_output_tokens from Responses requests - #247

Merged
justrach merged 2 commits into
mainfrom
hotfix/codex-max-output-tokens
Jul 18, 2026
Merged

justrach merged 2 commits into
mainfrom
hotfix/codex-max-output-tokens

Conversation

@justrach

Copy link
Copy Markdown
Owner

The Codex Responses backend rejects a top-level max_output_tokens ("Unsupported parameter: max_output_tokens") on gpt-5.6-* models, hard-failing every turn including the title task. openai/codex only uses max_output_tokens as a tool argument (exec_command/wait output truncation), never at the request top level.

Changes

  • agent_request_body.zig: drop the top-level max_output_tokens from the .responses payload; output is bounded by the model's own cap + prompts.
  • agent_ws_test.zig: flip the 3 codex-body assertions to guard the field's absence, plus a dedicated regression test covering normal/compaction/title modes.

Shipped as the v0.0.213 hotfix (notarized macOS builds); this lands the same fix + tests on main.

justrach and others added 2 commits July 17, 2026 23:55
The Codex Responses backend (chatgpt.com/backend-api/codex/responses) now rejects a top-level max_output_tokens with "Unsupported parameter: max_output_tokens" on gpt-5.6-* models, hard-failing every turn including the title task. openai/codex never sends it at the request top level — there it is only a tool argument (exec_command/wait output truncation). Drop the field from the Responses payload; output length is bounded by the model's own cap and our prompts. Tests now guard its absence.

Co-authored-by: Codegraff <blackfloofie@codegraff.com>
… Responses

Dedicated regression test: buildBody's .responses branch must never emit a top-level max_output_tokens (normal, compaction, or title mode) while still carrying the required Responses fields — the gpt-5.6 backend rejects the parameter. Complements the absence assertions in the WS-delta test.

Co-authored-by: Codegraff <blackfloofie@codegraff.com>
@justrach
justrach merged commit 4fb00b4 into main Jul 18, 2026
4 of 6 checks passed
justrach added a commit that referenced this pull request Jul 20, 2026
…utput_tokens

The midturn/transactional scenarios still expected explicit 16k/4k/16k
top-level output caps, but #247 removed the field entirely (gpt-5.6 rejects
it). CI never caught the stale expectation because the json-controls step
failed first and the job stopped. Assert the new contract: the field must be
absent from every Responses request.

Co-Authored-By: Codegraff <blackfloofie@codegraff.com>
justrach added a commit that referenced this pull request Jul 20, 2026
…st (#247)

Co-Authored-By: Codegraff <blackfloofie@codegraff.com>
@justrach
justrach deleted the hotfix/codex-max-output-tokens branch August 4, 2026 08:39
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.

1 participant