Repository navigation
fix: use thinking levels for Gemini 4 small calls - #1534
Conversation
`smallOptions` gave every Google reasoning model except Gemini 3
`thinkingBudget: 0`. Gemini 4 rejects budgets with a 400 ("Thinking budget is
not supported for this model. Use thinking level instead."), so every small
call (session title, prompt enhancement, project copy) failed on it.
- Gemini 2.x and unversioned aliases keep `thinkingBudget: 0`; Gemini 3 keeps
`thinkingLevel: "minimal"`; Gemini 4+ uses the lowest configured supported
level, falling back to `low`.
- Tests cover Google and Vertex for 2.0/2.5/3/3.1/4/5/30 and an unversioned
alias, with and without generated variants.
Closes #1533
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: 61a1331b-89d3-42dd-a38d-d3f84763d5ce) |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to
|
|
@codex review |
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Files Reviewed (2 files)
Previous Review Summaries (2 snapshots, latest commit 82775cc)Current summary above is authoritative. Previous snapshots are kept for context only. Previous review (commit 82775cc)Status: No Issues Found | Recommendation: Merge Files Reviewed (2 files)
Previous review (commit 380beb3)Status: No Issues Found | Recommendation: Merge Files Reviewed (2 files)
Reviewed by gemini-4-argon · Input: 70.5K · Output: 1.8K · Cached: 386.7K Review guidance: REVIEW.md from base branch |
|
Codex Review: Didn't find any major issues. Nice work! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
…eration
Ids such as `vertex_gemini-3pro` matched the earlier `includes("gemini-3")`
check but not the generation regex, so they fell back to `thinkingBudget: 0`.
Adds prefixed, dated-preview and unparseable id cases.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
@codex review |
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: 2346099b-0842-440f-8bdd-2460ea39864a) |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 82775cc01d
ℹ️ 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".
Prefixed or concatenated ids such as `vertex_gemini-4argon` did not match the anchored pattern, so they fell back to `thinkingBudget: 0` and the 400. One unanchored `gemini-(\d+)` parse now covers Gemini 3 and Gemini 4+ alike, which also replaces the substring fallback. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
@codex review |
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: 14865399-697b-4f89-891b-69d64bd18af1) |
|
Codex Review: Didn't find any major issues. You're on a roll. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
Issue for this PR
Closes #1533
Type of change
What does this PR do?
Why: every small model call fails on Gemini 4 models (
gemini-4-argonand newer) on Google and Vertex. That covers session titles, prompt enhancement, project copy and any tool that uses the small-call path. Streaming callers then report only "No output generated".Root cause:
ProviderTransform.smallOptionssentthinkingConfig: { thinkingBudget: 0 }to every Google reasoning model except Gemini 3. Gemini 4 rejects thinking budgets:What changed: the small-call thinking control is now chosen by Gemini generation, inside the existing
upstream_fixmarker:gemini-flash-latest)thinkingBudget: 0thinkingLevel: "minimal"thinkingBudget: 0→ 400"low"Non-Google providers are untouched.
Tenant/user impact: users on Gemini 4 models get working small calls (titles, prompt enhancement). No change for other models.
Deployment readiness: self-contained.
How did you verify your code works?
gemini-4-argonwith each config.thinkingBudget: 0returned the 400 above, andthinkingLevel: "low"returned a normal response.test/provider/transform.test.tshas new cases for Google and Vertex covering Gemini 2.0, 2.5, 3, 3.1, 4, 5 and 30 plus an unversioned alias, with and without generated variants, and lowest-level selection from custom variants. 356 pass, 0 fail.bun run typecheckis clean.Screenshots / recordings
Not applicable. There are no UI changes.
Checklist
🤖 Generated with Claude Code
Note
Low Risk
Narrow change to small-call provider options for Google reasoning models, with broad unit test coverage and no auth or data-path impact.
Overview
Fixes broken small Google/Vertex reasoning calls on Gemini 4+, where
ProviderTransform.smallOptionsstill sentthinkingConfig: { thinkingBudget: 0 }and the API returned 400 (“use thinking level instead”). Session titles, prompt enhancement, and other lightweight paths that usesmallOptionswere failing with no output.smallOptionsnow picks thinking controls from the parsed Gemini generation inmodel.api.id(including prefixed/Vertex-style ids): Gemini 3 keepsthinkingLevel: "minimal"; Gemini 2.x and unversioned aliases keepthinkingBudget: 0; Gemini 4+ usesthinkingLevel, preferring the lowest configured level from model variants (low→medium→high), defaulting to"low". OpenAI and other providers are unchanged.Tests in
transform.test.tscover Google and Vertex across Gemini 2.0–5, edge id shapes, empty vs generated variants, and lowest-level selection for Gemini 4 custom variants.Reviewed by Cursor Bugbot for commit 3d7f63e. Bugbot is set up for automated code reviews on this repo. Configure here.
Summary by cubic
Fixes #1533: small model calls (session titles, prompt enhancement, project copy) now work on Gemini 4 models on Google and Vertex, which previously rejected the
thinkingBudget: 0setting with a 400 error.gemini-<N>id form, so prefixed or concatenated ids likevertex_gemini-4argonare handled correctly along with plain, dated, and unversioned aliases.thinkingBudget: 0, Gemini 3 keepsthinkingLevel: "minimal", and Gemini 4+ uses the lowest configured supported thinking level, falling back tolow.Written for commit 3d7f63e. Summary will update on new commits.
Summary by CodeRabbit