fix(openai): 修复 gpt-5.4 长上下文计费与快照白名单
补齐 gpt-5.4 fallback 的长上下文计费元信息,\n确保超过 272000 输入 token 时对整次会话应用\n2x 输入与 1.5x 输出计费规则。\n\n同时将官方快照 gpt-5.4-2026-03-05 加入前端\n白名单候选与回归测试,避免 whitelist 模式误拦截。\n\nCo-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> (cherry picked from commit d95497af87f608c6dadcbe7d6e851de9413ae147)
This commit is contained in:
@@ -2,6 +2,13 @@ import { describe, expect, it } from 'vitest'
|
||||
import { buildModelMappingObject, getModelsByPlatform } from '../useModelWhitelist'
|
||||
|
||||
describe('useModelWhitelist', () => {
|
||||
it('openai 模型列表包含 GPT-5.4 官方快照', () => {
|
||||
const models = getModelsByPlatform('openai')
|
||||
|
||||
expect(models).toContain('gpt-5.4')
|
||||
expect(models).toContain('gpt-5.4-2026-03-05')
|
||||
})
|
||||
|
||||
it('antigravity 模型列表包含图片模型兼容项', () => {
|
||||
const models = getModelsByPlatform('antigravity')
|
||||
|
||||
@@ -15,4 +22,12 @@ describe('useModelWhitelist', () => {
|
||||
'gemini-3.1-flash-image': 'gemini-3.1-flash-image'
|
||||
})
|
||||
})
|
||||
|
||||
it('whitelist 模式会保留 GPT-5.4 官方快照的精确映射', () => {
|
||||
const mapping = buildModelMappingObject('whitelist', ['gpt-5.4-2026-03-05'], [])
|
||||
|
||||
expect(mapping).toEqual({
|
||||
'gpt-5.4-2026-03-05': 'gpt-5.4-2026-03-05'
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
@@ -25,7 +25,7 @@ const openaiModels = [
|
||||
'gpt-5.2', 'gpt-5.2-2025-12-11', 'gpt-5.2-chat-latest',
|
||||
'gpt-5.2-codex', 'gpt-5.2-pro', 'gpt-5.2-pro-2025-12-11',
|
||||
// GPT-5.4 系列
|
||||
'gpt-5.4',
|
||||
'gpt-5.4', 'gpt-5.4-2026-03-05',
|
||||
// GPT-5.3 系列
|
||||
'gpt-5.3-codex', 'gpt-5.3-codex-spark',
|
||||
'chatgpt-4o-latest',
|
||||
|
||||
Reference in New Issue
Block a user