From e938e1572ca9bcce2e08a1e428cb6617db84fc51 Mon Sep 17 00:00:00 2001 From: icarus Date: Thu, 18 Sep 2025 18:43:10 +0800 Subject: [PATCH] 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. --- src/renderer/src/store/runtime.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/renderer/src/store/runtime.ts b/src/renderer/src/store/runtime.ts index 1565e43b27..262116bb49 100644 --- a/src/renderer/src/store/runtime.ts +++ b/src/renderer/src/store/runtime.ts @@ -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) => { state.chat.activeTopic = action.payload }, + setActiveAgentId: (state, action: PayloadAction) => { + state.chat.activeAgentId = action.payload + }, setRenamingTopics: (state, action: PayloadAction) => { state.chat.renamingTopics = action.payload }, @@ -180,6 +186,7 @@ export const { toggleMultiSelectMode, setSelectedMessageIds, setActiveTopic, + setActiveAgentId, setRenamingTopics, setNewlyRenamedTopics, // WebSearch related actions