mirror of
https://github.com/Wei-Shaw/sub2api.git
synced 2026-09-24 16:05:44 +08:00
fix(openai): harden GPT-5.6 billing and usage
This commit is contained in:
@@ -636,6 +636,23 @@ function generateOpenCodeConfig(platform: string, baseUrl: string, apiKey: strin
|
||||
xhigh: {}
|
||||
}
|
||||
},
|
||||
'gpt-5.6': {
|
||||
name: 'GPT-5.6 (Sol)',
|
||||
limit: {
|
||||
context: 1050000,
|
||||
output: 128000
|
||||
},
|
||||
options: {
|
||||
store: false
|
||||
},
|
||||
variants: {
|
||||
low: {},
|
||||
medium: {},
|
||||
high: {},
|
||||
xhigh: {},
|
||||
max: {}
|
||||
}
|
||||
},
|
||||
'gpt-5.6-sol': {
|
||||
name: 'GPT-5.6 Sol',
|
||||
limit: {
|
||||
@@ -649,7 +666,8 @@ function generateOpenCodeConfig(platform: string, baseUrl: string, apiKey: strin
|
||||
low: {},
|
||||
medium: {},
|
||||
high: {},
|
||||
xhigh: {}
|
||||
xhigh: {},
|
||||
max: {}
|
||||
}
|
||||
},
|
||||
'gpt-5.6-terra': {
|
||||
@@ -665,7 +683,8 @@ function generateOpenCodeConfig(platform: string, baseUrl: string, apiKey: strin
|
||||
low: {},
|
||||
medium: {},
|
||||
high: {},
|
||||
xhigh: {}
|
||||
xhigh: {},
|
||||
max: {}
|
||||
}
|
||||
},
|
||||
'gpt-5.6-luna': {
|
||||
@@ -681,7 +700,8 @@ function generateOpenCodeConfig(platform: string, baseUrl: string, apiKey: strin
|
||||
low: {},
|
||||
medium: {},
|
||||
high: {},
|
||||
xhigh: {}
|
||||
xhigh: {},
|
||||
max: {}
|
||||
}
|
||||
},
|
||||
'gpt-5.5': {
|
||||
|
||||
@@ -123,6 +123,43 @@ describe('UseKeyModal', () => {
|
||||
expect(codeBlock.text()).not.toContain('"name": "GPT-5.4 Nano"')
|
||||
})
|
||||
|
||||
it('renders GPT-5.6 alias and max variants in OpenCode config', async () => {
|
||||
const wrapper = mount(UseKeyModal, {
|
||||
props: {
|
||||
show: true,
|
||||
apiKey: 'sk-test',
|
||||
baseUrl: 'https://example.com/v1',
|
||||
platform: 'openai'
|
||||
},
|
||||
global: {
|
||||
stubs: {
|
||||
BaseDialog: {
|
||||
template: '<div><slot /><slot name="footer" /></div>'
|
||||
},
|
||||
Icon: {
|
||||
template: '<span />'
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
const opencodeTab = wrapper.findAll('button').find((button) =>
|
||||
button.text().includes('keys.useKeyModal.cliTabs.opencode')
|
||||
)
|
||||
expect(opencodeTab).toBeDefined()
|
||||
await opencodeTab!.trigger('click')
|
||||
await nextTick()
|
||||
|
||||
const parsed = JSON.parse(wrapper.find('pre code').text())
|
||||
const models = parsed.provider.openai.models
|
||||
for (const model of ['gpt-5.6', 'gpt-5.6-sol', 'gpt-5.6-terra', 'gpt-5.6-luna']) {
|
||||
expect(models[model]).toBeDefined()
|
||||
expect(models[model].variants).toHaveProperty('max')
|
||||
expect(models[model].variants).toHaveProperty('xhigh')
|
||||
}
|
||||
expect(models['gpt-5.6'].name).toBe('GPT-5.6 (Sol)')
|
||||
})
|
||||
|
||||
it('renders Claude Fable 5 OpenCode config with adaptive thinking', async () => {
|
||||
const wrapper = mount(UseKeyModal, {
|
||||
props: {
|
||||
|
||||
@@ -14,6 +14,7 @@ describe('useModelWhitelist', () => {
|
||||
expect(models).toContain('gpt-5.4-mini')
|
||||
expect(models).toContain('gpt-5.4-2026-03-05')
|
||||
expect(models).toContain('codex-auto-review')
|
||||
expect(models).toContain('gpt-5.6')
|
||||
})
|
||||
|
||||
it('openai 模型列表不再暴露已下线的 ChatGPT 登录 Codex 模型', () => {
|
||||
|
||||
@@ -8,7 +8,7 @@ const openaiModels = [
|
||||
'gpt-5.2', 'gpt-5.2-2025-12-11', 'gpt-5.2-chat-latest',
|
||||
'gpt-5.2-pro', 'gpt-5.2-pro-2025-12-11',
|
||||
// GPT-5.6 系列
|
||||
'gpt-5.6-sol', 'gpt-5.6-terra', 'gpt-5.6-luna',
|
||||
'gpt-5.6', 'gpt-5.6-sol', 'gpt-5.6-terra', 'gpt-5.6-luna',
|
||||
// GPT-5.5 系列
|
||||
'gpt-5.5',
|
||||
// GPT-5.4 系列
|
||||
@@ -280,6 +280,7 @@ const openaiPresetMappings = [
|
||||
{ label: 'o3', from: 'o3', to: 'o3', color: 'bg-emerald-100 text-emerald-700 hover:bg-emerald-200 dark:bg-emerald-900/30 dark:text-emerald-400' },
|
||||
{ label: 'GPT-5.3 Codex Spark', from: 'gpt-5.3-codex-spark', to: 'gpt-5.3-codex-spark', color: 'bg-teal-100 text-teal-700 hover:bg-teal-200 dark:bg-teal-900/30 dark:text-teal-400' },
|
||||
{ label: 'GPT-5.2', from: 'gpt-5.2', to: 'gpt-5.2', color: 'bg-red-100 text-red-700 hover:bg-red-200 dark:bg-red-900/30 dark:text-red-400' },
|
||||
{ label: 'GPT-5.6', from: 'gpt-5.6', to: 'gpt-5.6', color: 'bg-amber-100 text-amber-700 hover:bg-amber-200 dark:bg-amber-900/30 dark:text-amber-400' },
|
||||
{ label: 'GPT-5.6 Sol', from: 'gpt-5.6-sol', to: 'gpt-5.6-sol', color: 'bg-orange-100 text-orange-700 hover:bg-orange-200 dark:bg-orange-900/30 dark:text-orange-400' },
|
||||
{ label: 'GPT-5.6 Terra', from: 'gpt-5.6-terra', to: 'gpt-5.6-terra', color: 'bg-lime-100 text-lime-700 hover:bg-lime-200 dark:bg-lime-900/30 dark:text-lime-400' },
|
||||
{ label: 'GPT-5.6 Luna', from: 'gpt-5.6-luna', to: 'gpt-5.6-luna', color: 'bg-sky-100 text-sky-700 hover:bg-sky-200 dark:bg-sky-900/30 dark:text-sky-400' },
|
||||
|
||||
Reference in New Issue
Block a user