新会话默认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)