From af64c79fd5c045856d76b45f2e2bc78065d04343 Mon Sep 17 00:00:00 2001 From: puzhen <1303385763@qq.com> Date: Sun, 19 Oct 2025 14:12:14 +0100 Subject: [PATCH] fix bug --- src/store/chatStore.ts | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/src/store/chatStore.ts b/src/store/chatStore.ts index 6092beb3c..9411245e1 100644 --- a/src/store/chatStore.ts +++ b/src/store/chatStore.ts @@ -1050,24 +1050,20 @@ const chatStore = (initial?: Partial) => createStore()( // Show toast notification toast.dismiss(); toast.error( -
-
⚠️ Context Limit Exceeded
-
- The conversation history is too long ({currentLength.toLocaleString()} / {maxLength.toLocaleString()} characters). -
-
- Please create a new project to continue your work. -
-
, + `⚠️ Context Limit Exceeded\n\nThe conversation history is too long (${currentLength.toLocaleString()} / ${maxLength.toLocaleString()} characters).\n\nPlease create a new project to continue your work.`, { duration: Infinity, closeButton: true, - important: true, } ); - - // Set status to pause to prevent further actions - setStatus(currentTaskId, 'pause'); + + // Set flag to block input and set status to pause + set((state) => { + if (state.tasks[currentTaskId]) { + state.tasks[currentTaskId].isContextExceeded = true; + state.tasks[currentTaskId].status = 'pause'; + } + }); uploadLog(currentTaskId, type) return }