新会话默认agent取Agents管理里排第一的Agent,而不是注册表里面的第一个

This commit is contained in:
xintaofei
2026-03-23 15:06:30 +08:00
parent 06bcb12329
commit 30f35e3bcb
4 changed files with 24 additions and 26 deletions

View File

@@ -25,7 +25,6 @@ interface SelectedConversation {
}
interface NewConversationState {
agentType: AgentType
workingDir: string
}
@@ -44,7 +43,7 @@ interface FolderContextValue {
clearSelection: () => void
newConversation: NewConversationState | null
startNewConversation: (agentType: AgentType, workingDir: string) => void
startNewConversation: (workingDir: string) => void
cancelNewConversation: () => void
stats: AgentStats | null
@@ -205,13 +204,10 @@ export function FolderProvider({
setSelectedConversation(null)
}, [])
const startNewConversation = useCallback(
(agentType: AgentType, workingDir: string) => {
setNewConversation({ agentType, workingDir })
setSelectedConversation(null)
},
[]
)
const startNewConversation = useCallback((workingDir: string) => {
setNewConversation({ workingDir })
setSelectedConversation(null)
}, [])
const cancelNewConversation = useCallback(() => {
setNewConversation(null)

View File

@@ -322,7 +322,7 @@ export function TabProvider({ children }: TabProviderProps) {
cancelNewConversation()
return
}
startNewConversation(tab.agentType, workingDir)
startNewConversation(workingDir)
}
},
[
@@ -588,7 +588,7 @@ export function TabProvider({ children }: TabProviderProps) {
setTabs((prev) => [...prev, newTab])
setActiveTabId(tabId)
startNewConversation(agentType, workingDir)
startNewConversation(workingDir)
activateConversationPane()
},
[activateConversationPane, startNewConversation, syncFolderContext, t]