Skip to content

fix(codex): forward output token limit - #272

Merged
PsiACE merged 1 commit into
bubbuild:mainfrom
PsiACE:fix/codex-max-output-tokens
Aug 10, 2026
Merged

fix(codex): forward output token limit#272
PsiACE merged 1 commit into
bubbuild:mainfrom
PsiACE:fix/codex-max-output-tokens

Conversation

@PsiACE

@PsiACE PsiACE commented Aug 10, 2026

Copy link
Copy Markdown
Collaborator

Rationale

Bub passes its configured max_tokens through any-llm's Chat Completions interface. The Codex OAuth provider translates that request to the Responses API, but previously omitted the corresponding max_output_tokens field. As a result, output token limits worked with other APIs but were silently ignored for Codex OAuth requests.

Summary

  • map max_completion_tokens, or max_tokens as a fallback, to Responses max_output_tokens
  • preserve max_completion_tokens precedence when both values are provided
  • add regression coverage for the translated payload and precedence behavior

User-facing changes

Configured output token limits now apply to Codex OAuth completions. There are no API or configuration changes.

Breaking changes

None.

Validation

  • uv lock --locked
  • uv run prek run -a
  • uv run mypy src
  • uv run python -m pytest --doctest-modules -q (269 passed)

@PsiACE
PsiACE marked this pull request as ready for review August 10, 2026 05:16
@PsiACE
PsiACE marked this pull request as draft August 10, 2026 05:21
@PsiACE
PsiACE marked this pull request as ready for review August 10, 2026 05:44
@PsiACE
PsiACE merged commit e39b299 into bubbuild:main Aug 10, 2026
15 checks passed
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