Browse Source

Clear history at the beginning of a new task🧹 (#3285)

Co-authored-by: tobitege <tobitege@gmx.de>
Kavinkumar 1 year ago
parent
commit
8bb9e37c46
1 changed files with 2 additions and 0 deletions
  1. 2 0
      frontend/src/components/AgentControlBar.tsx

+ 2 - 0
frontend/src/components/AgentControlBar.tsx

@@ -8,6 +8,7 @@ import { changeAgentState } from "#/services/agentStateService";
 import store, { RootState } from "#/store";
 import AgentState from "#/types/AgentState";
 import { clearMessages } from "#/state/chatSlice";
+import Session from "#/services/session";
 
 const IgnoreTaskStateMap: { [k: string]: AgentState[] } = {
   [AgentState.PAUSED]: [
@@ -83,6 +84,7 @@ function AgentControlBar() {
     }
 
     if (action === AgentState.STOPPED) {
+      Session._history = [];
       store.dispatch(clearMessages());
     } else {
       setIsLoading(true);