gateway: a Code Assist variant at xhigh is asked at xhigh (plugins#1169)

Gemini 4 Hydrogen's xhigh variant was sent with thinkingLevel "high":
thinkingConfig's level chain had no xhigh case, so any effort at or
above high came out as high. Google lists LOW, MEDIUM, HIGH and XHIGH
for that model. A variant whose own level is xhigh is now asked at
xhigh; a model with no xhigh variant still goes at high, as before.
The same fix shipped in the antigravity plugin 0.1.18 (df7d7ae0 in
magpie-community/plugins); this is the built-in's side, which still
serves accounts not yet moved.

Run: go test ./internal/gateway -run CodeAssist on mote: ok.
Broken by hand: with the new branch off, TestCodeAssistAntigravityLevels
is red on both hydrogen-xhigh rows ("at high, want xhigh").
Not tried: a real Code Assist request at xhigh; no account here is
served Gemini 4, so Google taking "xhigh" there rests on its model list.
This commit is contained in:
yetone
2026-11-15 07:30:18 +08:00
parent ca64168d3e
commit 6e6a18edac
2 changed files with 10 additions and 1 deletions
+5
View File
@@ -1032,6 +1032,11 @@ func thinkingConfig(r *Request, model string, claude bool, at string) map[string
case effort == "medium" && (strings.Contains(m, "flash") || gen > 3):
level = "medium"
}
// a variant at xhigh (Gemini 4 Hydrogen) is asked at xhigh, which
// Google lists for it; a model with no such variant stays at high
if at == "xhigh" {
level = "xhigh"
}
tc["thinkingLevel"] = level
}
return tc
+5 -1
View File
@@ -166,7 +166,8 @@ func TestCodeAssistAntigravityLevels(t *testing.T) {
var raw []catalog.Model
for _, l := range []string{"gemini-3-flash - Gemini 3 Flash", "gemini-3.1-pro-high - Gemini 3.1 Pro (High)", "gemini-3.1-pro-low - Gemini 3.1 Pro (Low)",
"gemini-3.7-flash-high - Gemini 3.7 Flash (High)", "gemini-3.7-flash-low - Gemini 3.7 Flash (Low)",
"gemini-3.7-flash-medium - Gemini 3.7 Flash (Medium)", "gemini-pro-agent - Gemini 3.1 Pro (High)"} {
"gemini-3.7-flash-medium - Gemini 3.7 Flash (Medium)", "gemini-pro-agent - Gemini 3.1 Pro (High)",
"gemini-4-hydrogen-high - Gemini 4 Hydrogen (High)", "gemini-4-hydrogen-xhigh - Gemini 4 Hydrogen (XHigh)"} {
id, name, _ := strings.Cut(l, " - ")
raw = append(raw, catalog.Model{ID: id, Name: name})
}
@@ -186,6 +187,9 @@ func TestCodeAssistAntigravityLevels(t *testing.T) {
{"gemini-pro-agent", "medium", "antigravity", "gemini-pro-agent", "high"},
{"gemini-pro-agent", "low", "antigravity", "gemini-pro-agent", "low"},
{"gemini-3.7-flash", "low", "gemini", "gemini-3.7-flash", "low"},
{"gemini-4-hydrogen", "xhigh", "antigravity", "gemini-4-hydrogen-xhigh", "xhigh"},
{"gemini-4-hydrogen-xhigh", "xhigh", "antigravity", "gemini-4-hydrogen-xhigh", "xhigh"},
{"gemini-4-hydrogen", "high", "antigravity", "gemini-4-hydrogen-high", "high"},
} {
r := codeAssistRequest(t)
r.Thinking, r.Effort = false, c.effort