fix(openai): harden GPT-5.6 billing and usage

This commit is contained in:
superman2003 committed 2026-07-10 15:13:11 +08:00
1 parent 9a2f11b4e2
commit de28eba3c8
28 files changed
+524 -49

No files matched your search

@@ -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: {