fix(opencode): switch session models without restart

This commit is contained in:
2026-08-20 22:38:18 +08:00
parent 1c6b004436
commit c0163bc507
18 changed files with 718 additions and 92 deletions

View File

@@ -29,10 +29,11 @@ function context(overrides: Partial<ChatCommandContext> = {}): ChatCommandContex
describe('chat command registry', () => {
it('defines the approved built-ins and aliases', () => {
expect(BUILTIN_CHAT_COMMANDS.map((command) => command.name)).toEqual([
'share', 'rename', 'timeline', 'compact', 'unshare',
'share', 'rename', 'timeline', 'models', 'compact', 'unshare',
'undo', 'redo', 'timestamps', 'thinking', 'process', 'copy', 'export',
]);
const catalog = mergeChatCommandCatalog([]);
expect(resolveCommandName('model', catalog)?.name).toBe('models');
expect(resolveCommandName('summarize', catalog)?.name).toBe('compact');
expect(resolveCommandName('toggle-timestamps', catalog)?.name).toBe('timestamps');
expect(resolveCommandName('toggle-thinking', catalog)?.name).toBe('thinking');