mirror of
https://github.com/Wei-Shaw/sub2api.git
synced 2026-10-07 16:18:29 +08:00
fix(keys): grok-4.5 上下文窗口按 500k 对齐并修正账号测试 i18n mock
- UseKeyModal 中 grok-4.5 的 context_window / model_context_window / OpenCode 模型目录统一改为 500000,与 xAI 实际上下文一致 - UseKeyModal.spec 的 OpenCode 目录断言同步为 500000 - AccountTestModal.spec 补齐 imagePreviewAlt 的 i18n mock, 跟上组件把 alt 文案迁到 i18n 之后的行为
This commit is contained in:
@@ -33,6 +33,9 @@ vi.mock('vue-i18n', async () => {
|
||||
if (key === 'admin.accounts.imageReceived' && params?.count) {
|
||||
return `received-${params.count}`
|
||||
}
|
||||
if (key === 'admin.accounts.imagePreviewAlt' && params?.index) {
|
||||
return `test-image-${params.index}`
|
||||
}
|
||||
return messages[key] || key
|
||||
}
|
||||
})
|
||||
|
||||
@@ -826,7 +826,7 @@ description = "Grok 4.5 via Sub2API (Responses)"
|
||||
# base_url = "${baseUrl}"
|
||||
env_key = "XAI_API_KEY" # or: api_key = "${apiKey}" (not recommended)
|
||||
api_backend = "responses" # chat_completions | responses | messages
|
||||
context_window = 1000000 # drives auto-compaction timing
|
||||
context_window = 500000 # drives auto-compaction timing
|
||||
# Optional sampling (global defaults can live under [models] instead):
|
||||
# temperature = 0.7
|
||||
# top_p = 0.95
|
||||
@@ -941,7 +941,7 @@ model = "grok-4.5"
|
||||
# Optional:
|
||||
# review_model = "grok-4.5"
|
||||
# model_reasoning_effort = "medium"
|
||||
# model_context_window = 1000000
|
||||
# model_context_window = 500000
|
||||
# disable_response_storage = true
|
||||
# network_access = "enabled"
|
||||
# windows_wsl_setup_acknowledged = true
|
||||
@@ -1482,7 +1482,7 @@ function generateOpenCodeConfig(platform: string, baseUrl: string, apiKey: strin
|
||||
const grokModels = {
|
||||
'grok-4.5': {
|
||||
name: 'Grok 4.5',
|
||||
limit: { context: 1000000, output: 64000 }
|
||||
limit: { context: 500000, output: 64000 }
|
||||
},
|
||||
'grok-build-0.1': {
|
||||
name: 'Grok Build 0.1',
|
||||
|
||||
@@ -106,7 +106,7 @@ describe('UseKeyModal', () => {
|
||||
apiKey: 'sk-grok-test'
|
||||
})
|
||||
expect(parsed.provider.grok.models['grok-4.5']).toBeDefined()
|
||||
expect(parsed.provider.grok.models['grok-4.5'].limit.context).toBe(1000000)
|
||||
expect(parsed.provider.grok.models['grok-4.5'].limit.context).toBe(500000)
|
||||
expect(parsed.provider.grok.models['grok-build-0.1']).toBeDefined()
|
||||
expect(parsed.provider.grok.models['grok-4.20-multi-agent-0309']).toBeDefined()
|
||||
expect(parsed.provider.grok.models['grok-composer-2.5-fast']).toBeDefined()
|
||||
|
||||
Reference in New Issue
Block a user