新会话默认agent取Agents管理里排第一的Agent,而不是注册表里面的第一个
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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]
|
||||
|
||||
Reference in New Issue
Block a user