You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: harden chat stop behavior and stabilize CI workflows
Prevent autonomous chat retries after manual stop, make local model IPC handlers fail gracefully when services are offline, reduce false TSC worker errors, and unblock Actions failures caused by cache/signing workflow configuration.
Co-authored-by: Cursor <cursoragent@cursor.com>
Copy file name to clipboardExpand all lines: src/components/chat/ChatInput.tsx
+8Lines changed: 8 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -108,6 +108,7 @@ export function ChatInput({ chatId }: { chatId?: number }) {
108
108
}=useProposal(chatId);
109
109
const[retryCount,setRetryCount]=useState(0);
110
110
const{ proposal, messageId }=proposalResult??{};
111
+
constwasManuallyStoppedRef=useRef(false);
111
112
112
113
useEffect(()=>{
113
114
if(error){
@@ -127,6 +128,7 @@ export function ChatInput({ chatId }: { chatId?: number }) {
127
128
if(
128
129
settings?.executionMode==="autonomous"&&
129
130
proposal?.type==="action-proposal"&&
131
+
!wasManuallyStoppedRef.current&&
130
132
!isStreaming&&
131
133
chatId&&
132
134
messageId&&
@@ -148,6 +150,7 @@ export function ChatInput({ chatId }: { chatId?: number }) {
148
150
149
151
// Small debounce to let the proposal & streaming state fully settle
150
152
consttimer=setTimeout(()=>{
153
+
if(wasManuallyStoppedRef.current)return;
151
154
setRetryCount(0);
152
155
streamMessage({
153
156
prompt: `${summaryStr}Continue from exactly where you left off. Do NOT restart or rewrite anything already built. Pick up the next incomplete task and keep going until the app is fully done. If development is completed, clearly state that you are done and ask if there are any further optimizations or enhancements needed.`,
@@ -171,6 +174,7 @@ export function ChatInput({ chatId }: { chatId?: number }) {
171
174
useEffect(()=>{
172
175
if(
173
176
settings?.executionMode==="autonomous"&&
177
+
!wasManuallyStoppedRef.current&&
174
178
error&&
175
179
!isStreaming&&
176
180
chatId&&
@@ -187,6 +191,7 @@ export function ChatInput({ chatId }: { chatId?: number }) {
187
191
`Auto-retrying error (attempt ${retryCount+1}) in Autonomous mode: ${error}`,
188
192
);
189
193
consttimer=setTimeout(()=>{
194
+
if(wasManuallyStoppedRef.current)return;
190
195
setRetryCount((prev)=>prev+1);
191
196
streamMessage({
192
197
prompt:
@@ -226,6 +231,7 @@ export function ChatInput({ chatId }: { chatId?: number }) {
226
231
}
227
232
228
233
constcurrentInput=inputValue;
234
+
wasManuallyStoppedRef.current=false;
229
235
setInputValue("");
230
236
setSelectedComponent(null);
231
237
@@ -242,9 +248,11 @@ export function ChatInput({ chatId }: { chatId?: number }) {
0 commit comments