test(llm-pi-ai): remove unreachable compat fallback

This commit is contained in:
Yichen Jiang 2026-08-18 17:13:47 +08:00
parent 3ec495f8fa
commit 78fc31d06b
2 changed files with 0 additions and 14 deletions

View file

@ -356,7 +356,6 @@ export type EveryOfferedFieldIsDocumented = AssertNever<Exclude<OfferedCompatFie
*/
function configuredCompatEntries(compat: PiAiCompatProfile | undefined): readonly (readonly [string, unknown])[] {
return Object.entries(compat ?? {}).flatMap(([field, value]) => {
if (value === undefined) return []
const empty = typeof value === 'object' && value !== null && !Array.isArray(value)
&& Object.keys(value as object).length === 0
return empty ? [] : [[field, value] as const]

View file

@ -919,19 +919,6 @@ describe('compat switches', () => {
})
})
it('ignores compat entries whose value is undefined', () => {
const models = modelsOf({
'acme-gateway': {
api: 'openai-completions',
baseURL: 'https://acme.test',
compat: { supportsStore: undefined },
models: [{ id: 'acme-a' }],
},
}, 'acme-gateway')
expect(models.get('acme-a')?.compat).toBeUndefined()
})
it('rejects a model switch on an unrecognized protocol as having no configurable compat', () => {
expect(() => resolveProfiles({
'acme-gateway': {