Files
archived-orca/src/shared/model-id-label.test.ts
T
Brennan Benson 9ce35be4ff fix(native-chat): effort, speed and fast controls stay usable while the model list refreshes; dotted versions in id-derived model labels (#36870)
* fix(native-chat): running chats keep effort menus during model discovery; dotted versions in id-derived model labels

* fix(native-chat): options stay usable while a model list refreshes; dated preview ids keep their dashes

A running host listing no longer disables effort, speed or fast mode. Those
controls follow the data they draw from: before any list exists they show
the placeholder or a read-only saved effort, and once a list or the chat's
own answer is shown they stay usable through every refresh, for every agent.
The listing flag is now only the host's raw fact, which keeps a seed from
settling to the built-in list while discovery runs.

Id-derived labels no longer dot a zero-led part, so MM-DD preview dates
(gemini-2.5-flash-preview-05-20) stay dates.

* fix(native-chat): a model list refresh keeps the verified models and default effort already shown

While the host refreshes a Claude or Codex list, the chat keeps the model
ids an earlier finished listing verified that the refreshing rows still
contain, so a running Codex chat's CLI-default effort ("Medium") no longer
blanks from the pill and menu until the listing lands. Ids no finished
listing verified stay unverified, and a finished listing still replaces
the set.

* test(native-chat): type the listing-wait check without an assertion

* fix(model-labels): month-day dates after October stay undotted

* refactor(native-chat): listing-verified model ids get their own module
2026-11-01 21:39:37 -08:00

20 lines
913 B
TypeScript

import { describe, expect, it } from 'vitest'
import { labelFromModelId } from './model-id-label'
describe('labelFromModelId', () => {
it('dots the version an id spells with dashes, never a date', () => {
expect(labelFromModelId('claude-opus-5-5')).toBe('Claude Opus 5.5')
expect(labelFromModelId('claude-opus-5-5[1m]')).toBe('Claude Opus 5.5 (1M context)')
expect(labelFromModelId('claude-3-5-sonnet-20241022')).toBe('Claude 3.5 Sonnet 20241022')
expect(labelFromModelId('xai/grok-4-1-fast')).toBe('Xai Grok 4.1 Fast')
expect(labelFromModelId('gpt-4o-2024-08-06')).toBe('GPT 4O 2024 08 06')
expect(labelFromModelId('gemini-2.5-flash-preview-05-20')).toBe(
'Gemini 2.5 Flash Preview 05 20'
)
expect(labelFromModelId('gemini-2.5-flash-preview-10-20')).toBe(
'Gemini 2.5 Flash Preview 10 20'
)
expect(labelFromModelId('llama-3-8b')).toBe('Llama 3 8B')
})
})