chore: add sonnet-4-6 mapping, config defaults, and CI improvements
- Add claude-sonnet-4-6 to default Antigravity model mapping - Add antigravity_extra_retries default value in config - Add cache-dependency-path to CI setup-go for faster builds - Simplify vitest config to avoid vite plugin compatibility issues
This commit is contained in:
4
.github/workflows/backend-ci.yml
vendored
4
.github/workflows/backend-ci.yml
vendored
@@ -17,6 +17,7 @@ jobs:
|
|||||||
go-version-file: backend/go.mod
|
go-version-file: backend/go.mod
|
||||||
check-latest: false
|
check-latest: false
|
||||||
cache: true
|
cache: true
|
||||||
|
cache-dependency-path: backend/go.sum
|
||||||
- name: Verify Go version
|
- name: Verify Go version
|
||||||
run: |
|
run: |
|
||||||
go version | grep -q 'go1.25.7'
|
go version | grep -q 'go1.25.7'
|
||||||
@@ -36,6 +37,7 @@ jobs:
|
|||||||
go-version-file: backend/go.mod
|
go-version-file: backend/go.mod
|
||||||
check-latest: false
|
check-latest: false
|
||||||
cache: true
|
cache: true
|
||||||
|
cache-dependency-path: backend/go.sum
|
||||||
- name: Verify Go version
|
- name: Verify Go version
|
||||||
run: |
|
run: |
|
||||||
go version | grep -q 'go1.25.7'
|
go version | grep -q 'go1.25.7'
|
||||||
@@ -44,4 +46,4 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
version: v2.7
|
version: v2.7
|
||||||
args: --timeout=5m
|
args: --timeout=5m
|
||||||
working-directory: backend
|
working-directory: backend
|
||||||
|
|||||||
@@ -1158,6 +1158,7 @@ func setDefaults() {
|
|||||||
viper.SetDefault("gateway.force_codex_cli", false)
|
viper.SetDefault("gateway.force_codex_cli", false)
|
||||||
viper.SetDefault("gateway.openai_passthrough_allow_timeout_headers", false)
|
viper.SetDefault("gateway.openai_passthrough_allow_timeout_headers", false)
|
||||||
viper.SetDefault("gateway.antigravity_fallback_cooldown_minutes", 1)
|
viper.SetDefault("gateway.antigravity_fallback_cooldown_minutes", 1)
|
||||||
|
viper.SetDefault("gateway.antigravity_extra_retries", 10)
|
||||||
viper.SetDefault("gateway.max_body_size", int64(100*1024*1024))
|
viper.SetDefault("gateway.max_body_size", int64(100*1024*1024))
|
||||||
viper.SetDefault("gateway.upstream_response_read_max_bytes", int64(8*1024*1024))
|
viper.SetDefault("gateway.upstream_response_read_max_bytes", int64(8*1024*1024))
|
||||||
viper.SetDefault("gateway.proxy_probe_response_read_max_bytes", int64(1024*1024))
|
viper.SetDefault("gateway.proxy_probe_response_read_max_bytes", int64(1024*1024))
|
||||||
|
|||||||
@@ -74,6 +74,7 @@ var DefaultAntigravityModelMapping = map[string]string{
|
|||||||
"claude-opus-4-6-thinking": "claude-opus-4-6-thinking", // 官方模型
|
"claude-opus-4-6-thinking": "claude-opus-4-6-thinking", // 官方模型
|
||||||
"claude-opus-4-6": "claude-opus-4-6-thinking", // 简称映射
|
"claude-opus-4-6": "claude-opus-4-6-thinking", // 简称映射
|
||||||
"claude-opus-4-5-thinking": "claude-opus-4-6-thinking", // 迁移旧模型
|
"claude-opus-4-5-thinking": "claude-opus-4-6-thinking", // 迁移旧模型
|
||||||
|
"claude-sonnet-4-6": "claude-sonnet-4-6",
|
||||||
"claude-sonnet-4-5": "claude-sonnet-4-5",
|
"claude-sonnet-4-5": "claude-sonnet-4-5",
|
||||||
"claude-sonnet-4-5-thinking": "claude-sonnet-4-5-thinking",
|
"claude-sonnet-4-5-thinking": "claude-sonnet-4-5-thinking",
|
||||||
// Claude 详细版本 ID 映射
|
// Claude 详细版本 ID 映射
|
||||||
|
|||||||
@@ -76,6 +76,12 @@ func TestAntigravityGatewayService_GetMappedModel(t *testing.T) {
|
|||||||
},
|
},
|
||||||
|
|
||||||
// 3. 默认映射中的透传(映射到自己)
|
// 3. 默认映射中的透传(映射到自己)
|
||||||
|
{
|
||||||
|
name: "默认映射透传 - claude-sonnet-4-6",
|
||||||
|
requestedModel: "claude-sonnet-4-6",
|
||||||
|
accountMapping: nil,
|
||||||
|
expected: "claude-sonnet-4-6",
|
||||||
|
},
|
||||||
{
|
{
|
||||||
name: "默认映射透传 - claude-sonnet-4-5",
|
name: "默认映射透传 - claude-sonnet-4-5",
|
||||||
requestedModel: "claude-sonnet-4-5",
|
requestedModel: "claude-sonnet-4-5",
|
||||||
|
|||||||
@@ -1,18 +1,13 @@
|
|||||||
import { defineConfig } from 'vitest/config'
|
import { defineConfig } from 'vitest/config'
|
||||||
import vue from '@vitejs/plugin-vue'
|
|
||||||
import { resolve } from 'path'
|
import { resolve } from 'path'
|
||||||
|
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
plugins: [vue()],
|
|
||||||
resolve: {
|
resolve: {
|
||||||
alias: {
|
alias: {
|
||||||
'@': resolve(__dirname, 'src'),
|
'@': resolve(__dirname, 'src'),
|
||||||
'vue-i18n': 'vue-i18n/dist/vue-i18n.runtime.esm-bundler.js'
|
'vue-i18n': 'vue-i18n/dist/vue-i18n.runtime.esm-bundler.js'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
define: {
|
|
||||||
__INTLIFY_JIT_COMPILATION__: true
|
|
||||||
},
|
|
||||||
test: {
|
test: {
|
||||||
globals: true,
|
globals: true,
|
||||||
environment: 'jsdom',
|
environment: 'jsdom',
|
||||||
@@ -37,8 +32,6 @@ export default defineConfig({
|
|||||||
lines: 80
|
lines: 80
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
}
|
||||||
setupFiles: ['./src/__tests__/setup.ts'],
|
|
||||||
testTimeout: 10000
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user