Repository navigation
Reject invalid output token budgets - #7379
diegosouzapw merged 5 commits into
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces a mechanism to enforce the target model's output token budget immediately before translation, capping or removing invalid or oversized output token fields (such as max_tokens and max_completion_tokens) to prevent upstream errors, and adds corresponding unit tests. The review feedback correctly identifies potential runtime TypeError crashes if the body parameter is null or undefined, suggesting defensive guards in both handleChatCore and enforceOutputTokenBudget.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3cfb300a3e
ℹ️ 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".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f5cf4cf3c7
ℹ️ 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".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b5bd75a101
ℹ️ 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".
|
Thanks for this — verified the whole chain locally: |
cb594ae
into
cheaper-inference:release/v3.8.49
|
Thanks @JxnLexn! Merged into release/v3.8.49 after combined merge-train validation (static gates + tests + vitest green on the merged tree). Where quality gates flagged growth we decomposed/extracted inside your branch keeping you as author — including renumbering the reasoning-routing migration slot and the ProviderDetailPageClient rebaseline annotation. |
…ntext-window boundary The 'disabled prompt compression leaves combo override requests unchanged' integration test predates #7379 (enforceOutputTokenBudget): its 31.5k-token body now trips the intentional pre-dispatch 400 context_length_exceeded reject (test:integration only runs on the release-PR gate, so the red accrued silently on the release branch). Resize the body into the (70%-threshold, window) corridor — still proving disabled compression leaves the request byte-identical — with a precondition locking the corridor, and add chatcore-context-window-boundary.test.ts locking the reject path at the integration layer (400 + context_length_exceeded + zero upstream fetches). Red->green validated on the isolated file run.
* fix(context): reject invalid output token budgets * fix(context): enforce output budgets across request formats * fix(context): enforce default Claude output budgets * fix(context): include Responses API input in token budget * ci: rerun pull request checks
…inference#7379 context-window boundary The 'disabled prompt compression leaves combo override requests unchanged' integration test predates cheaper-inference#7379 (enforceOutputTokenBudget): its 31.5k-token body now trips the intentional pre-dispatch 400 context_length_exceeded reject (test:integration only runs on the release-PR gate, so the red accrued silently on the release branch). Resize the body into the (70%-threshold, window) corridor — still proving disabled compression leaves the request byte-identical — with a precondition locking the corridor, and add chatcore-context-window-boundary.test.ts locking the reject path at the integration layer (400 + context_length_exceeded + zero upstream fetches). Red->green validated on the isolated file run.
* fix(context): reject invalid output token budgets * fix(context): enforce output budgets across request formats * fix(context): enforce default Claude output budgets * fix(context): include Responses API input in token budget * ci: rerun pull request checks
…inference#7379 context-window boundary The 'disabled prompt compression leaves combo override requests unchanged' integration test predates cheaper-inference#7379 (enforceOutputTokenBudget): its 31.5k-token body now trips the intentional pre-dispatch 400 context_length_exceeded reject (test:integration only runs on the release-PR gate, so the red accrued silently on the release branch). Resize the body into the (70%-threshold, window) corridor — still proving disabled compression leaves the request byte-identical — with a precondition locking the corridor, and add chatcore-context-window-boundary.test.ts locking the reject path at the integration layer (400 + context_length_exceeded + zero upstream fetches). Red->green validated on the isolated file run.
Summary
Validation
npm run lintnpm run test:unitnpm run test:coverage>= 60%for statements, lines, functions, and branchesTests Added Or Updated
Coverage Notes
open-sse/.Reviewer Notes