Consider it done. The open-source AI agent that works out of the box · 想到,就能做到。开源、开箱即用的 AI Agent。
TypeScript agentai-agentai-assistantandroidclaude-codecodexelectroniosllmmacosreact-nativetypescriptwindows
test(desktop): cover new-session model selection regression (#4014)
MsNBBc3R1dfe609d852d
diff --git a/apps/desktop/src/renderer/__tests__/chatInputModelSelectorRouting.test.ts b/apps/desktop/src/renderer/__tests__/chatInputModelSelectorRouting.test.tsindex 8ffb4d2269..9d04dc7048 100644--- a/apps/desktop/src/renderer/__tests__/chatInputModelSelectorRouting.test.ts+++ b/apps/desktop/src/renderer/__tests__/chatInputModelSelectorRouting.test.ts@@ -494,6 +494,29 @@ describe('ChatInput model source switching wiring', () => {);});+ it('keeps a new conversation model pick on the draft path', () => {+ const draftStart = chatInputSource.indexOf('const handleUnifiedDraftSelect = useCallback(');+ const draftEnd = chatInputSource.indexOf(+ '[sessionId, settingsLocked, modelMemory, onUnifiedDraftSelect]',+ draftStart,+ );+ const draftHandler = chatInputSource.slice(draftStart, draftEnd);++ expect(draftHandler).toContain('if (sessionId || settingsLocked) return;');+ expect(draftHandler).toContain('onUnifiedDraftSelect?.({');+ expect(draftHandler).not.toContain('maker.setModel(');+ expect(draftHandler).not.toContain('confirmModelSwitchContextGuard(');++ const selectorStart = chatInputSource.lastIndexOf('<ModelSelector');+ const selectorBlock = chatInputSource.slice(+ selectorStart,+ chatInputSource.indexOf('/>', selectorStart) + 2,+ );+ expect(selectorBlock).toContain(+ '!sessionId && unifiedPanelActive && onUnifiedDraftSelect\n ? handleUnifiedDraftSelect',+ );+ });+it('feeds the selector the session/draft wire id as the selected model', () => {const selectorStart = chatInputSource.lastIndexOf('<ModelSelector');const selectorBlock = chatInputSource.slice(