mirror of
https://github.com/wu736139669/hapi.git
synced 2026-11-08 01:43:07 +00:00
Fixes incomplete cliModelSkus while agent acp holds the CLI lock (#831) and replace single-pid ACP lock with cross-process refcount (#832). Web picker merges machine/session catalogs and waits for SKU readiness before showing variant labels. Fixes #831 Fixes #832 Co-authored-by: Cursor <cursoragent@cursor.com>
33 lines
1.2 KiB
TypeScript
33 lines
1.2 KiB
TypeScript
import { describe, expect, it } from 'vitest'
|
|
import { mergeCursorCliModelSkus } from '@/lib/cursorPickerState'
|
|
|
|
describe('mergeCursorCliModelSkus', () => {
|
|
it('prefers the richer source and unions ids without duplicates', () => {
|
|
const partial = [
|
|
{ modelId: 'gpt-5.5-high-fast', name: 'GPT-5.5 High Fast' },
|
|
{ modelId: 'gpt-5.5-low', name: 'GPT-5.5 1M Low' }
|
|
]
|
|
const full = [
|
|
...partial,
|
|
{ modelId: 'gpt-5.5-medium', name: 'GPT-5.5 1M' },
|
|
{ modelId: 'gpt-5.5-high', name: 'GPT-5.5 High' }
|
|
]
|
|
|
|
expect(mergeCursorCliModelSkus(partial, full).map((row) => row.modelId)).toEqual([
|
|
'gpt-5.5-high-fast',
|
|
'gpt-5.5-low',
|
|
'gpt-5.5-medium',
|
|
'gpt-5.5-high'
|
|
])
|
|
})
|
|
|
|
it('prefers the richer source name for duplicate model ids', () => {
|
|
const machine = [{ modelId: 'gpt-5.5-medium', name: 'From Machine' }]
|
|
const session = [{ modelId: 'gpt-5.5-medium', name: 'From Session' }]
|
|
|
|
expect(mergeCursorCliModelSkus(machine, session)).toEqual([
|
|
{ modelId: 'gpt-5.5-medium', name: 'From Machine' }
|
|
])
|
|
})
|
|
})
|