fix(models): consolidate provider and model into /model command

This commit is contained in:
Austin Pickett
2026-04-27 10:38:36 -04:00
parent ac0325c257
commit a0b62e0c5a
6 changed files with 83 additions and 34 deletions

View File

@@ -43,6 +43,28 @@ describe('createSlashHandler', () => {
})
})
it('honors TUI picker session scope without adding --global', async () => {
patchUiState({ sid: 'sid-abc' })
const ctx = buildCtx({
gateway: {
...buildGateway(),
rpc: vi.fn(() => Promise.resolve({ value: 'anthropic/claude-sonnet-4.6' }))
}
})
expect(
createSlashHandler(ctx)(
'/model anthropic/claude-sonnet-4.6 --provider openrouter --tui-session'
)
).toBe(true)
expect(ctx.gateway.rpc).toHaveBeenCalledWith('config.set', {
key: 'model',
session_id: 'sid-abc',
value: 'anthropic/claude-sonnet-4.6 --provider openrouter'
})
})
it('does not duplicate --global for explicit persistent model switches', () => {
patchUiState({ sid: 'sid-abc' })
const ctx = buildCtx()