Skip to content

fix(relaykit): map thinking levels for gemini-4-neon - #8410

Closed
PerryLink wants to merge 1 commit into
QuantumNous:mainfrom
PerryLink:fix/gemini-4-neon-thinking-level
Closed

PerryLink wants to merge 1 commit into
QuantumNous:mainfrom
PerryLink:fix/gemini-4-neon-thinking-level

Conversation

@PerryLink

@PerryLink PerryLink commented Nov 20, 2026 •

Copy link
Copy Markdown

Agent: DeepSeek Harness unknown · deepseek-flash · WSL2 Ubuntu · 2026-11-20

Closes #8409

Request summary

The user reported that cross-protocol OpenAI Chat, OpenAI Responses, and Claude requests to gemini-4-neon drop generationConfig.thinkingConfig.thinkingLevel. The user asked for the missing mapping to be reported to this repository. The expected result is the same mapping gemini-4-hydrogen has: gemini-4-neon is level-based, minimal maps to low, and low, medium, high, xhigh, max pass through.

Summary

Add gemini-4-neon to the Gemini 4 thinking-level mapping that cross-protocol conversion uses. This change is AI-assisted.

 	case strings.HasPrefix(model, "gemini-3"),
 		strings.HasPrefix(model, "gemini-4-argon"),
-		strings.HasPrefix(model, "gemini-4-hydrogen"):
+		strings.HasPrefix(model, "gemini-4-hydrogen"),
+		strings.HasPrefix(model, "gemini-4-neon"):
 		return geminiCapabilities{kind: geminiThinkingLevel}

-	case strings.HasPrefix(model, "gemini-4-hydrogen"):
+	case strings.HasPrefix(model, "gemini-4-hydrogen"),
+		strings.HasPrefix(model, "gemini-4-neon"):
 		switch effort {

Evidence

  • Before: GOWORK=off go test ./relayconvert/reasoning/ -run 'TestRenderGeminiMapsAndClampsInsteadOfRejecting|TestNormalizeGeminiThinkingConfigRewritesNativeConfig' -count=1 fails on the new neon cases:
    --- FAIL: TestRenderGeminiMapsAndClampsInsteadOfRejecting/xhigh_on_gemini_4_neon_is_kept
        actual  : []string{"gemini_unknown_capability"}
        Expected value not to be nil.
    --- FAIL: TestRenderGeminiMapsAndClampsInsteadOfRejecting/minimal_on_gemini_4_neon_moves_to_low
    --- FAIL: TestNormalizeGeminiThinkingConfigRewritesNativeConfig/budget_on_gemini_4_neon_becomes_level
        expected: []string{"gemini_budget_to_level"}
        actual  : []string(nil)
        expected: "medium"
        actual  : ""
    
  • After: the same command prints ok github.com/QuantumNous/new-api/relaykit/relayconvert/reasoning 0.005s. GOWORK=off go test ./relayconvert/reasoning/ -count=1 prints ok. GOWORK=off go build ./... exits 0. GOWORK=off go test ./... reports every relaykit package ok.

Merge Danger

Door: two-way

Blast Radius: relay

Summary by CodeRabbit

  • New Features
    • Gemini 4 Neon now supports the same thinking-level behavior as Gemini 4 Hydrogen. Effort settings are translated to supported levels, and native reasoning budgets are mapped to corresponding thinking levels. Some effort values may be adjusted to a supported level when rendered. This brings Gemini 4 Neon’s reasoning configuration in line with Gemini 4 Hydrogen.

gemini-4-neon supports thinkingLevel like gemini-4-hydrogen. Add it to the
capability table and the level mapping, so minimal becomes low and low,
medium, high, xhigh, max pass through on cross-protocol requests.

Closes QuantumNous#8409
@coderabbitai

coderabbitai Bot commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

Gemini 4 Neon is now classified as supporting thinking-level conversion and uses the same effort mappings as Gemini 4 Hydrogen. Tests cover rendering effort values and normalizing a native thinking budget.

Changes

Gemini 4 Neon thinking-level conversion

Layer / File(s) Summary
Thinking-level detection, mapping, and tests
relaykit/relayconvert/reasoning/gemini.go, relaykit/relayconvert/reasoning/gemini_test.go
Gemini 4 Neon joins Gemini 4 Hydrogen in capability detection and effort mapping. Tests verify that xhigh is preserved, minimal adjusts to low, and a native budget of 8192 maps to medium, with the corresponding diagnostics.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix · Severity of issue fixed: Medium

Suggested reviewers: seefs001

Merge Risk: Minimal · up to 78d00

Requests to gemini-4-neon now keep their thinking level during cross-protocol conversion, using the same mapping as gemini-4-hydrogen. No merge-blocking risk is evident.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title names the change: thinking-level mapping for gemini-4-neon. The raw summary says Neon is now classified with Gemini 4 Hydrogen in capability detection and thinking-level conversion, and the …
Linked Issues check Passed Issue #8409 requires that cross-protocol requests to gemini-4-neon keep thinkingLevel. The expected mapping is minimal to low, with low, medium, high, xhigh, and max passed through. The change adds ge…
Out of Scope Changes check Passed The change touches only relaykit/relayconvert/reasoning/gemini.go (+4/-2) and gemini_test.go (+23/-0). Both files are in the Gemini thinking-level conversion path named by #8409. The test additions co…
Full details: Title check

Explanation

The title names the change: thinking-level mapping for gemini-4-neon. The raw summary says Neon is now classified with Gemini 4 Hydrogen in capability detection and thinking-level conversion, and the tests cover the effort and budget mappings. The title is fully related to the main change. The 'fix(relaykit)' prefix is a conventional-commit scope and does not reduce clarity.

Full details: Linked Issues check

Explanation

Issue #8409 requires that cross-protocol requests to gemini-4-neon keep thinkingLevel. The expected mapping is minimal to low, with low, medium, high, xhigh, and max passed through. The change adds gemini-4-neon to the geminiThinkingLevel capability case in relaykit/relayconvert/reasoning/gemini.go. It also adds gemini-4-neon to the geminiLevelForEffort case that handles gemini-4-hydrogen. That case maps minimal to low and passes the other levels through. Focused tests in gemini_test.go cover xhigh passthrough, minimal to low with the gemini_level_adjusted diagnostic, and budget 8192 to medium with the gemini_budget_to_level diagnostic. The author reports these tests failed before the change and pass after it. The redaction and issue-guideline requirements in #8409 are non-coding and do not apply. This assessment relies on the PR summary and the stated diff; no independent repository inspection was run.

Full details: Out of Scope Changes check

Explanation

The change touches only relaykit/relayconvert/reasoning/gemini.go (+4/-2) and gemini_test.go (+23/-0). Both files are in the Gemini thinking-level conversion path named by #8409. The test additions cover the neon behavior the issue requests. No unrelated changes appear in the summary.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • 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.

Share

A rabbit checks the levels with care,
Neon joins Hydrogen there.
Xhigh stays bright, minimal turns low,
A budget finds medium in the flow.
Tests trace each mapping through,
Then hop away beneath the moon.

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: b9c8d0b4-ef89-44ca-b02b-65bd192438ac
Commits

Reviewing files that changed from the base of the PR and between 48f9df9 and 78d0058.

Files selected for processing: 2

  • relaykit/relayconvert/reasoning/gemini.go
  • relaykit/relayconvert/reasoning/gemini_test.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.

@PerryLink

Copy link
Copy Markdown
Author

Superseded by #8412, which matches the whole Gemini 4 family by prefix and closed #8409. The production change in this PR is already in main as a85f7e8; rebasing would keep only the tests. Closing instead of force-pushing.

@PerryLink PerryLink closed this Nov 21, 2026
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.

bug(relaykit): gemini-4-neon drops thinkingLevel on cross-protocol requests

1 participant