You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(relaykit): match Gemini 4 thinking levels by family prefix - #8412
No actionable comments were generated in the recent review.
Walkthrough
The Gemini reasoning conversion now recognizes every gemini-4- model as supporting thinking levels. It maps requested effort levels according to the model, and the tests verify the resulting levels and adjustment diagnostics.
Changes
Gemini 4 thinking-level conversion
Layer / File(s)
Summary
Gemini 4 capability and effort mapping relaykit/relayconvert/reasoning/gemini.go, relaykit/relayconvert/reasoning/gemini_test.go
The capability check now matches all gemini-4- model prefixes. The mapping adjusts minimal to low; it maps xhigh and max to xhigh for Neon and Hydrogen, and to high for other Gemini 4 models. Tests verify these adjustments and their gemini_level_adjusted diagnostics.
QuantumNous/new-api#8410: Adds an explicit gemini-4-neon entry for the thinking-level conversion addressed by this family-prefix change.
Suggested reviewers: calcium-ion
Merge Risk: Low · up to 75551
Requests for max effort on Gemini 4 Neon are sent as xhigh, though the linked issue and PR description say max should pass through. The impact is limited to that effort level. Either restore max passthrough or document the cap as an intended change before merging.
Pre-merge checks: 2
Check name
Status
Explanation
Description Check
Check skipped - CodeRabbit’s high-level summary is enabled.
Title check
The title "fix(relaykit): match Gemini 4 thinking levels by family prefix" describes the main change. The raw summary shows that geminiCapabilitiesFor now matches every gemini-4- model by prefix inste…
Full details: Title check
Explanation
The title "fix(relaykit): match Gemini 4 thinking levels by family prefix" describes the main change. The raw summary shows that geminiCapabilitiesFor now matches every gemini-4- model by prefix instead of the Argon and Hydrogen prefixes. The title also names the relaykit area and the Gemini 4 thinking-level scope. The title does not mention the effort-level mapping changes (for example, max and xhigh adjustments), but it covers the primary change, so it passes.
Autofix · 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.
A rabbit checks the levels in a row, gemini-4- now helps them flow. Minimal settles softly into low, Neon and Hydrogen reach xhigh’s glow. Argon and Carbon take high in stride, The tests record each change applied. <fixed_issue_severity>Medium</fixed_issue_severity>
Recent review info
Run configuration
Source mode: Auto
Repository: Unavailable
Branch: Unavailable
File: No configuration file from this repository applied
Commit: Unavailable
Layers: Organization UI
Review profile: CHILL
Plan: Advanced
Run ID: 0389f2f8-f3fe-48cc-bbb9-5a1ffb168279
Commits
Reviewing files that changed from the base of the PR and between 48f9df9 and 64faa8d.
Files selected for processing: 1
relaykit/relayconvert/reasoning/gemini.go
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🔗 关联任务
Closes #8409。与 #8410 不同,本 PR 按家族识别模型,并将输出限制在 Google 公开的档位内。
🚀 变更类型
📝 变更描述
跨协议请求转换到 Gemini 时,用
gemini-4-前缀识别采用thinkingLevel的模型。Google 的模型表只为 Neon、Hydrogen 列出了xhigh;Argon、Carbon 的最高档是high。minimallowlowlow、medium、highxhigh、maxxhighhighminimal → low遵循 Google 的 OpenAI 兼容映射。generateContent 枚举没有MAX;将客户端的max转为模型最高档是 new-api 的兼容策略,不要求上游接受未公开的值。实际调整档位时会记录gemini_level_adjusted。📸 运行证明
48f9df9上,bug(relaykit): gemini-4-neon drops thinkingLevel on cross-protocol requests #8409 的 Neon Responses 请求没有生成thinkingLevel。第一版前缀修复(64faa8d)向 Carbon 发送了xhigh,并向四款模型发送了max。reasoning_effort: xhigh和 Claude Messagesoutput_config.effort: max均生成thinkingLevel: xhigh。未调用真实上游。relaykit/运行GOWORK=off go build ./...和GOWORK=off go test -count=1 ./...,均通过。回归用例覆盖 Neon 的max、Carbon 的xhigh和既有 Argon、Hydrogen 行为的变化。✅ 提交前检查项
Summary by CodeRabbit