mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2025-12-24 10:40:07 +08:00
feat(chat): add activeAgentId to track current agent state
Add activeAgentId field to chat state to track which agent is currently active. This enables UI to reflect the active agent state and handle agent-specific interactions.
This commit is contained in:
parent
9a7681c5c8
commit
e938e1572c
@ -7,6 +7,8 @@ export interface ChatState {
|
||||
isMultiSelectMode: boolean
|
||||
selectedMessageIds: string[]
|
||||
activeTopic: Topic | null
|
||||
/** UI state. null represents no active agent, may active assistant */
|
||||
activeAgentId: string | null
|
||||
/** topic ids that are currently being renamed */
|
||||
renamingTopics: string[]
|
||||
/** topic ids that are newly renamed */
|
||||
@ -78,6 +80,7 @@ const initialState: RuntimeState = {
|
||||
isMultiSelectMode: false,
|
||||
selectedMessageIds: [],
|
||||
activeTopic: null,
|
||||
activeAgentId: null,
|
||||
renamingTopics: [],
|
||||
newlyRenamedTopics: []
|
||||
},
|
||||
@ -142,6 +145,9 @@ const runtimeSlice = createSlice({
|
||||
setActiveTopic: (state, action: PayloadAction<Topic>) => {
|
||||
state.chat.activeTopic = action.payload
|
||||
},
|
||||
setActiveAgentId: (state, action: PayloadAction<string>) => {
|
||||
state.chat.activeAgentId = action.payload
|
||||
},
|
||||
setRenamingTopics: (state, action: PayloadAction<string[]>) => {
|
||||
state.chat.renamingTopics = action.payload
|
||||
},
|
||||
@ -180,6 +186,7 @@ export const {
|
||||
toggleMultiSelectMode,
|
||||
setSelectedMessageIds,
|
||||
setActiveTopic,
|
||||
setActiveAgentId,
|
||||
setRenamingTopics,
|
||||
setNewlyRenamedTopics,
|
||||
// WebSearch related actions
|
||||
|
||||
Loading…
Reference in New Issue
Block a user