Skip to content

bug(runtime): a per-model output limit makes every OpenAI Codex subscription turn fail with HTTP 400 #5736

Description

@liugddx

What happened

On an openai-codex (ChatGPT subscription) connection, setting a per-model output limit (modelOverrides[model].maxOutputTokens, exposed in the connection's model settings) makes every main turn on that model fail. The model adapter forwards the limit as max_output_tokens (packages/runtime/src/model-adapter.ts:715-745 → ai-sdk-turn.ts:1580-1622). The Codex backend rejects that field:

failureClass: request_rejected
Codex OAuth request failed: HTTP 400 {"detail":"Unsupported parameter: max_output_tokens"}

The setting is accepted and saved without complaint. The user only learns about the problem when every turn on that model fails.

How to reproduce

  1. Configure an openai-codex connection (ChatGPT sign-in).
  2. In the connection's model settings, set an output limit for e.g. gpt-6-astra (verified with 4096).
  3. Start a turn on that model. It fails with the 400 above. Remove the limit and the same turn completes.

I reproduced this headlessly against the real backend on main at 87fc9f69c, using a Runtime Host on a copy of a Desktop workspace.

Environment

  • Maka commit: 87fc9f69c
  • OS: Windows 10 x64
  • Connection: openai-codex via ChatGPT OAuth

Logs, screenshots, or additional context

Found while addressing review on #5723. That PR keeps streamed turns byte-identical to main, so it neither causes nor fixes this.

Possible directions, for maintainers to choose:

  • The settings UI and codec refuse an output limit on openai-codex models, with a message saying the subscription backend does not accept one.
  • Or the adapter drops it for openai-codex and the UI marks it as ignored there.

AI disclosure: Claude Code (Claude Opus) reproduced the failure against the real backend and drafted this issue; liugddx reviewed it and is the human contributor of record.

Activity

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

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions