Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
陈曦
sub2api
Commits
1b4e504f
Unverified
Commit
1b4e504f
authored
Feb 25, 2026
by
Wesley Liddick
Committed by
GitHub
Feb 25, 2026
Browse files
Merge pull request #625 from cagedbird043/pr/antigravity-default-gemini31-passthrough
fix: 默认补全 Antigravity 的 Gemini 3.1 Pro 透传映射
parents
0a3a4458
a3aed3c4
Changes
2
Show whitespace changes
Inline
Side-by-side
backend/internal/service/account.go
View file @
1b4e504f
...
...
@@ -373,7 +373,11 @@ func (a *Account) GetModelMapping() map[string]string {
}
if
len
(
result
)
>
0
{
if
a
.
Platform
==
domain
.
PlatformAntigravity
{
ensureAntigravityDefaultPassthrough
(
result
,
"gemini-3-flash"
)
ensureAntigravityDefaultPassthroughs
(
result
,
[]
string
{
"gemini-3-flash"
,
"gemini-3.1-pro-high"
,
"gemini-3.1-pro-low"
,
})
}
return
result
}
...
...
@@ -400,6 +404,12 @@ func ensureAntigravityDefaultPassthrough(mapping map[string]string, model string
mapping
[
model
]
=
model
}
func
ensureAntigravityDefaultPassthroughs
(
mapping
map
[
string
]
string
,
models
[]
string
)
{
for
_
,
model
:=
range
models
{
ensureAntigravityDefaultPassthrough
(
mapping
,
model
)
}
}
// IsModelSupported 检查模型是否在 model_mapping 中(支持通配符)
// 如果未配置 mapping,返回 true(允许所有模型)
func
(
a
*
Account
)
IsModelSupported
(
requestedModel
string
)
bool
{
...
...
backend/internal/service/account_wildcard_test.go
View file @
1b4e504f
...
...
@@ -268,7 +268,7 @@ func TestAccountGetMappedModel(t *testing.T) {
}
}
func
TestAccountGetModelMapping_AntigravityEnsuresGemini
3Flash
Passthrough
(
t
*
testing
.
T
)
{
func
TestAccountGetModelMapping_AntigravityEnsuresGemini
Default
Passthrough
s
(
t
*
testing
.
T
)
{
account
:=
&
Account
{
Platform
:
PlatformAntigravity
,
Credentials
:
map
[
string
]
any
{
...
...
@@ -282,6 +282,12 @@ func TestAccountGetModelMapping_AntigravityEnsuresGemini3FlashPassthrough(t *tes
if
mapping
[
"gemini-3-flash"
]
!=
"gemini-3-flash"
{
t
.
Fatalf
(
"expected gemini-3-flash passthrough to be auto-filled, got: %q"
,
mapping
[
"gemini-3-flash"
])
}
if
mapping
[
"gemini-3.1-pro-high"
]
!=
"gemini-3.1-pro-high"
{
t
.
Fatalf
(
"expected gemini-3.1-pro-high passthrough to be auto-filled, got: %q"
,
mapping
[
"gemini-3.1-pro-high"
])
}
if
mapping
[
"gemini-3.1-pro-low"
]
!=
"gemini-3.1-pro-low"
{
t
.
Fatalf
(
"expected gemini-3.1-pro-low passthrough to be auto-filled, got: %q"
,
mapping
[
"gemini-3.1-pro-low"
])
}
}
func
TestAccountGetModelMapping_AntigravityRespectsWildcardOverride
(
t
*
testing
.
T
)
{
...
...
@@ -298,6 +304,12 @@ func TestAccountGetModelMapping_AntigravityRespectsWildcardOverride(t *testing.T
if
_
,
exists
:=
mapping
[
"gemini-3-flash"
];
exists
{
t
.
Fatalf
(
"did not expect explicit gemini-3-flash passthrough when wildcard already exists"
)
}
if
_
,
exists
:=
mapping
[
"gemini-3.1-pro-high"
];
exists
{
t
.
Fatalf
(
"did not expect explicit gemini-3.1-pro-high passthrough when wildcard already exists"
)
}
if
_
,
exists
:=
mapping
[
"gemini-3.1-pro-low"
];
exists
{
t
.
Fatalf
(
"did not expect explicit gemini-3.1-pro-low passthrough when wildcard already exists"
)
}
if
mapped
:=
account
.
GetMappedModel
(
"gemini-3-flash"
);
mapped
!=
"gemini-3.1-pro-high"
{
t
.
Fatalf
(
"expected wildcard mapping to stay effective, got: %q"
,
mapped
)
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment