Skip to content

fix: use medium thinking for Gemini 3.5 Flash - #142

Merged
BhagyaAmarasinghe merged 1 commit into
mainfrom
fix/eng-2096-gemini-35
Oct 8, 2026
Merged

BhagyaAmarasinghe merged 1 commit into
mainfrom
fix/eng-2096-gemini-35

Conversation

@BhagyaAmarasinghe

Copy link
Copy Markdown
Contributor

Ref ENG-2096

What does this PR do?

Gemini 3.5 Flash sentiment, emotions, and translation requests now use medium thinking. Structured requests omit the legacy numeric thinking budget, while older models retain their existing zero-budget fallback. Temperature remains unchanged.

The change stays in the Google adapter. Rollout requires a new Hub image and coordinated web, taxonomy, and GitOps changes.

How should this be tested?

  • go test ./internal/googleai -run 'TestGemini35|TestCompleteJSON' -count=1 covers real SDK serialization, EU routing, legacy fallback, and level-error handling.
  • make test-unit, make build, make fmt, and make lint pass; equivalent unit run included coverage.
  • make tests passes against isolated PostgreSQL 18 with Hub and River migrations.

The new Gemini tests fail against the base implementation. A synthetic Vertex EU smoke request accepted temperature 0 and medium thinking on both v1 and v1beta1; workflow quality/latency evaluation and staged deployment remain open.

Checklist

Required

  • Filled out the "How to test" section in this PR
  • Read Repository Guidelines
  • Self-reviewed my own code
  • Commented on my code in hard-to-understand bits
  • Ran make build
  • Ran make tests (integration tests in tests/)
  • Ran make fmt and make lint; no new warnings
  • Removed debug prints / temporary logging
  • Merged the latest changes from main onto my branch with git pull origin main
  • If database schema changed: added migration in migrations/ with goose annotations and ran make migrate-validate

Branch starts from current main; no database or external API changes.

Appreciated

  • If API changed: added or updated OpenAPI spec and ran contract tests (make tests or API contract workflow)
  • If API behavior changed: added request/response examples or Swagger UI screenshots to this PR
  • Updated docs in docs/ if changes were necessary
  • Ran make tests-coverage for meaningful logic changes

AI model used: unknown; reasoning effort: unknown.

@BhagyaAmarasinghe
BhagyaAmarasinghe marked this pull request as ready for review October 8, 2026 10:20
@coderabbitai

coderabbitai Bot commented Oct 8, 2026

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: feb95757-e12f-4101-a494-de2fc5c74ac4
📥 Commits

Reviewing files that changed from the base of the PR and between ee115e3 and 3616508.

📒 Files selected for processing (2)
  • internal/googleai/client.go
  • internal/googleai/client_test.go

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.


Walkthrough

The client now applies medium thinking to translation and structured JSON requests for gemini-3.5-flash. For other models, the model-specific configuration is nil. CompleteJSON adds a zero numeric thinking budget only when no model-specific configuration applies and no unsupported-budget rejection has been latched. Tests cover request settings and verify that an INVALID_ARGUMENT response to the Gemini configuration does not trigger a retry or latch the unsupported-budget state.

Priority: ⬇️ Low

Merge Risk: ⚪ Minimal · up to 36165

No actionable merge-blocking issue is identified; the change is mergeable after normal checks.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 25.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 4 functions across 2 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description check ✅ Passed The description clearly explains the Gemini 3.5 Flash change, testing performed, rollout context, and checklist status. It identifies ENG-2096 and states that no database or external API changes are r…
Title check ✅ Passed The title follows Conventional Commits format and clearly identifies the primary change: using medium thinking for Gemini 3.5 Flash.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
  • Fix all pre-merge checks with AI
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@xernobyl xernobyl left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@BhagyaAmarasinghe
BhagyaAmarasinghe added this pull request to the merge queue Oct 8, 2026
Merged via the queue into main with commit d14dd9e Oct 8, 2026
10 checks passed
@BhagyaAmarasinghe
BhagyaAmarasinghe deleted the fix/eng-2096-gemini-35 branch October 8, 2026 11:07
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.

2 participants