centaurus-cli 2.9.9 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (52) hide show
  1. package/dist/cli-adapter.d.ts +7 -0
  2. package/dist/cli-adapter.d.ts.map +1 -1
  3. package/dist/cli-adapter.js +238 -153
  4. package/dist/cli-adapter.js.map +1 -1
  5. package/dist/context/handlers/docker-handler.d.ts.map +1 -1
  6. package/dist/context/handlers/docker-handler.js +2 -2
  7. package/dist/context/handlers/docker-handler.js.map +1 -1
  8. package/dist/context/handlers/ssh-handler.d.ts.map +1 -1
  9. package/dist/context/handlers/ssh-handler.js +3 -0
  10. package/dist/context/handlers/ssh-handler.js.map +1 -1
  11. package/dist/context/handlers/wsl-handler.d.ts.map +1 -1
  12. package/dist/context/handlers/wsl-handler.js +9 -3
  13. package/dist/context/handlers/wsl-handler.js.map +1 -1
  14. package/dist/index.js +49 -7
  15. package/dist/index.js.map +1 -1
  16. package/dist/mcp/mcp-server-manager.d.ts.map +1 -1
  17. package/dist/mcp/mcp-server-manager.js +17 -3
  18. package/dist/mcp/mcp-server-manager.js.map +1 -1
  19. package/dist/services/api-client.d.ts +4 -0
  20. package/dist/services/api-client.d.ts.map +1 -1
  21. package/dist/services/api-client.js +27 -18
  22. package/dist/services/api-client.js.map +1 -1
  23. package/dist/services/conversation-manager.d.ts.map +1 -1
  24. package/dist/services/conversation-manager.js +3 -2
  25. package/dist/services/conversation-manager.js.map +1 -1
  26. package/dist/tools/enter-remote-session.d.ts +35 -0
  27. package/dist/tools/enter-remote-session.d.ts.map +1 -1
  28. package/dist/tools/enter-remote-session.js +5 -5
  29. package/dist/tools/enter-remote-session.js.map +1 -1
  30. package/dist/ui/components/App.d.ts +2 -0
  31. package/dist/ui/components/App.d.ts.map +1 -1
  32. package/dist/ui/components/App.js +55 -48
  33. package/dist/ui/components/App.js.map +1 -1
  34. package/dist/ui/components/ToolExecutionMessage.js +1 -1
  35. package/dist/ui/components/ToolExecutionMessage.js.map +1 -1
  36. package/dist/utils/shell.d.ts.map +1 -1
  37. package/dist/utils/shell.js +12 -1
  38. package/dist/utils/shell.js.map +1 -1
  39. package/dist/utils/syntax-checker.d.ts.map +1 -1
  40. package/dist/utils/syntax-checker.js +26 -0
  41. package/dist/utils/syntax-checker.js.map +1 -1
  42. package/dist/utils/terminal-output.d.ts.map +1 -1
  43. package/dist/utils/terminal-output.js +10 -8
  44. package/dist/utils/terminal-output.js.map +1 -1
  45. package/dist/utils/text-clipboard.d.ts.map +1 -1
  46. package/dist/utils/text-clipboard.js +21 -8
  47. package/dist/utils/text-clipboard.js.map +1 -1
  48. package/package.json +6 -2
  49. package/dist/config/ConfigManager.d.ts +0 -62
  50. package/dist/config/ConfigManager.d.ts.map +0 -1
  51. package/dist/config/ConfigManager.js +0 -234
  52. package/dist/config/ConfigManager.js.map +0 -1
@@ -82,6 +82,10 @@ export declare class CentaurusCLI {
82
82
  private workflowLearningActive;
83
83
  private learnedWorkflowSteps;
84
84
  private onSetInputCallback;
85
+ private interruptQueue;
86
+ private onInterruptQueueUpdateCallback?;
87
+ private onQueuedMessageDispatchedCallback?;
88
+ private isReconnecting;
85
89
  constructor();
86
90
  setOnResponseCallback(callback: (message: string) => void): void;
87
91
  setOnDirectMessageCallback(callback: (message: string) => void): void;
@@ -146,6 +150,8 @@ export declare class CentaurusCLI {
146
150
  content: string;
147
151
  }>) => void): void;
148
152
  setOnWorkflowSave(callback: (workflow: Workflow) => void): void;
153
+ setOnInterruptQueueUpdate(callback: (queue: string[]) => void): void;
154
+ setOnQueuedMessageDispatched(callback: (message: string) => void): void;
149
155
  setOnAiAutoSuggestChange(callback: (enabled: boolean) => void): void;
150
156
  setOnRevertToCheckpoint(callback: (checkpointIndex: number, prompt: string) => void): void;
151
157
  /**
@@ -346,6 +352,7 @@ export declare class CentaurusCLI {
346
352
  private stripThinkingFromHistory;
347
353
  handleMessage(message: string, options?: {
348
354
  isolatedWorkflow?: boolean;
355
+ interruptCleanText?: string;
349
356
  }): Promise<void>;
350
357
  private handleSlashCommand;
351
358
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"cli-adapter.d.ts","sourceRoot":"","sources":["../src/cli-adapter.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,UAAU,MAAM,kBAAkB,CAAC;AAa/C,OAAO,EAA6L,IAAI,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAcjP,OAAO,EAAmB,OAAO,IAAI,SAAS,EAAe,MAAM,iCAAiC,CAAC;AAQrG,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAQrD,OAAO,EAAmC,aAAa,EAAwC,MAAM,kCAAkC,CAAC;AACxI,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAE3C,OAAO,EAAyB,kBAAkB,EAAE,MAAM,uCAAuC,CAAC;AAIlG,OAAO,EAAE,QAAQ,EAAwC,MAAM,qBAAqB,CAAC;AAGrF,qBAAa,YAAY;IACvB,OAAO,CAAC,aAAa,CAAgB;IACrC,OAAO,CAAC,YAAY,CAAe;IACnC,OAAO,CAAC,mBAAmB,CAAmB;IAC9C,OAAO,CAAC,GAAG,CAAS;IACpB,OAAO,CAAC,QAAQ,CAAkB;IAClC,OAAO,CAAC,kBAAkB,CAAuB;IACjD,OAAO,CAAC,WAAW,CAAkB;IACrC,OAAO,CAAC,cAAc,CAAkB;IACxC,OAAO,CAAC,cAAc,CAAa;IACnC,OAAO,CAAC,YAAY,CAAyC;IAC7D,OAAO,CAAC,kBAAkB,CAAC,CAA4B;IACvD,OAAO,CAAC,uBAAuB,CAAC,CAA4B;IAC5D,OAAO,CAAC,wBAAwB,CAAC,CAA0B;IAC3D,OAAO,CAAC,uBAAuB,CAAC,CAAa;IAC7C,OAAO,CAAC,uBAAuB,CAAC,CAA4B;IAC5D,OAAO,CAAC,yBAAyB,CAAC,CAAoC;IACtE,OAAO,CAAC,mBAAmB,CAAC,CAAiC;IAC7D,OAAO,CAAC,W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AiB,IAAI,IAAI;IA+BzB;;;OAGG;IACH,4BAA4B,CAAC,OAAO,EAAE,UAAU,CAAC,kBAAkB,GAAG,SAAS,GAAG,IAAI;IAItF;;OAEG;YACW,0BAA0B;CAsfzC"}
@@ -129,6 +129,12 @@ export class CentaurusCLI {
129
129
  learnedWorkflowSteps = [];
130
130
  // Callback to set input value (e.g., for revert)
131
131
  onSetInputCallback = null;
132
+ // Interrupt Queue state tracking
133
+ interruptQueue = [];
134
+ onInterruptQueueUpdateCallback;
135
+ onQueuedMessageDispatchedCallback;
136
+ // Track if we are currently reconnecting to remote sessions (prevent race conditions)
137
+ isReconnecting = false;
132
138
  constructor() {
133
139
  this.configManager = new ConfigManager();
134
140
  this.toolRegistry = new ToolRegistry();
@@ -243,6 +249,12 @@ export class CentaurusCLI {
243
249
  setOnWorkflowSave(callback) {
244
250
  this.onWorkflowSaveCallback = callback;
245
251
  }
252
+ setOnInterruptQueueUpdate(callback) {
253
+ this.onInterruptQueueUpdateCallback = callback;
254
+ }
255
+ setOnQueuedMessageDispatched(callback) {
256
+ this.onQueuedMessageDispatchedCallback = callback;
257
+ }
246
258
  setOnAiAutoSuggestChange(callback) {
247
259
  this.onAiAutoSuggestChange = callback;
248
260
  }
@@ -400,10 +412,8 @@ Begin executing now, starting with Step 1.`;
400
412
  }
401
413
  // Check if we are already in a remote session
402
414
  const currentContext = this.contextManager.getCurrentContext();
415
+ // Setup variables for the new context
403
416
  let context;
404
- // Save current CWD to stack BEFORE entering any new session (local or nested)
405
- // This enables proper restoration when exiting, regardless of nesting level
406
- this.cwdStack.push(this.cwd);
407
417
  if (currentContext.type !== 'local') {
408
418
  // Nested session: connect from remote
409
419
  if (detection.handler.connectFromRemote) {
@@ -411,23 +421,18 @@ Begin executing now, starting with Step 1.`;
411
421
  context = await detection.handler.connectFromRemote(command, this.cwd, currentContext);
412
422
  }
413
423
  else {
414
- // If nested connection fails, pop the CWD we just pushed
415
- this.cwdStack.pop();
416
424
  throw new Error(`Nested connections are not supported by the ${type} handler yet.`);
417
425
  }
418
426
  }
419
427
  else {
420
428
  // Local session: connect from local
421
- // For SSH, we shouldn't pass the local (potentially Windows) CWD as it won't exist remotely.
422
- // For local->WSL or local->Docker, the handler might translate it, but strictly speaking
423
- // starting 'fresh' in the remote user's home/default dir is safer for 'warpify' semantics regardless of type.
424
- // However, to avoid regression for WSL/Docker usage where inheritance is expected, we restricts this fix to SSH.
425
429
  const initialCwd = type === 'ssh' ? undefined : this.cwd;
426
- // Use factory method to create a new handler instance for this session
427
- // This prevents state issues where the singleton handler's client is overwritten by nested sessions
428
430
  const newHandler = detection.handler.createNew();
429
431
  context = await newHandler.connect(command, initialCwd);
430
432
  }
433
+ // Connection succeeded! Now we can safely mutate the stacks.
434
+ // Save current CWD to stack BEFORE entering the new session state (local or nested)
435
+ this.cwdStack.push(this.cwd);
431
436
  this.connectionCommandStack.push(command);
432
437
  this.contextManager.pushContext(context);
433
438
  // Explicitly sync this.cwd with the new context's CWD to ensure consistency immediately
@@ -1081,6 +1086,11 @@ Press Enter to continue...
1081
1086
  this.requestIntentionallyAborted = true;
1082
1087
  this.currentAbortController.abort();
1083
1088
  this.currentAbortController = undefined;
1089
+ // Clear interrupt queue on hard cancel
1090
+ this.interruptQueue = [];
1091
+ if (this.onInterruptQueueUpdateCallback) {
1092
+ this.onInterruptQueueUpdateCallback(this.interruptQueue);
1093
+ }
1084
1094
  }
1085
1095
  }
1086
1096
  /**
@@ -1172,6 +1182,13 @@ Press Enter to continue...
1172
1182
  }
1173
1183
  }
1174
1184
  async handleMessage(message, options = {}) {
1185
+ // Prevent messages from being processed while remote reconnection is ongoing
1186
+ if (this.isReconnecting) {
1187
+ if (this.onDirectMessageCallback) {
1188
+ this.onDirectMessageCallback('⏳ Please wait until the chat is fully reconnected before sending a message.');
1189
+ }
1190
+ return;
1191
+ }
1175
1192
  // Handle command mode - execute commands directly
1176
1193
  if (this.commandMode) {
1177
1194
  // Record command step if workflow learning mode is active
@@ -1247,32 +1264,26 @@ Press Enter to continue...
1247
1264
  // Cancel any active request when a new message comes in
1248
1265
  // This enables "interrupt and replace" - new message takes priority
1249
1266
  if (this.currentAbortController) {
1250
- // Mark as intentionally aborted so error handling knows not to throw or show message
1251
- this.requestIntentionallyAborted = true;
1252
- const oldController = this.currentAbortController;
1253
- // Create new controller BEFORE aborting old one to avoid race condition
1254
- // where new request tries to access undefined controller
1255
- this.currentAbortController = new AbortController();
1256
- oldController.abort();
1257
- // Clean up orphaned tool calls from the interrupted turn
1258
- this.cleanupOrphanedToolCalls();
1259
- // Remove the last user message from history (it's being replaced by the new message)
1260
- // Walk backwards and remove messages until we find and remove a user message
1261
- while (this.conversationHistory.length > 0) {
1262
- const lastMsg = this.conversationHistory[this.conversationHistory.length - 1];
1263
- this.conversationHistory.pop();
1264
- if (lastMsg.role === 'user') {
1265
- // Found and removed the interrupted user message, stop here
1266
- break;
1267
- }
1268
- // Continue removing assistant/tool messages that were part of the interrupted turn
1267
+ // INSTEAD of aborting, enqueue the message as an interrupt.
1268
+ const queuedMessage = options.interruptCleanText || message;
1269
+ this.interruptQueue.push(queuedMessage);
1270
+ if (this.onInterruptQueueUpdateCallback) {
1271
+ this.onInterruptQueueUpdateCallback(this.interruptQueue);
1269
1272
  }
1270
- quickLog(`[${new Date().toISOString()}] [handleMessage] Interrupted active request - cleaned up history for replacement\n`);
1273
+ quickLog(`[${new Date().toISOString()}] [handleMessage] Added message to interrupt queue. Queue length: ${this.interruptQueue.length}\n`);
1274
+ return;
1271
1275
  }
1272
1276
  // Store original request if in planning mode (for execution phase after approval)
1273
1277
  if (this.planMode && !this.pendingPlanRequest) {
1274
1278
  this.pendingPlanRequest = message;
1275
1279
  }
1280
+ // Notify UI that this message is now actively being processed.
1281
+ // Only fire for DIRECT (non-queued) messages here.
1282
+ // For queued interrupts, the finally block fires this BEFORE calling handleMessage,
1283
+ // so we must not fire it again here — that would cause the user bubble to appear twice.
1284
+ if (!options.interruptCleanText && this.onQueuedMessageDispatchedCallback) {
1285
+ this.onQueuedMessageDispatchedCallback(message);
1286
+ }
1276
1287
  // Build the user message content - inject plan mode instructions if active
1277
1288
  let userMessageContent = message;
1278
1289
  // When plan mode is active, explicitly inject planning instructions into the user message
@@ -1297,19 +1308,32 @@ DO NOT use write_to_file, edit_file, or execute_command until the plan is approv
1297
1308
  // This clears thinking from the previous agent loop but thinking will be
1298
1309
  // preserved for all turns within the current agent loop
1299
1310
  this.stripThinkingFromHistory();
1300
- // Add user message to history
1311
+ // Add user message to history, using clean text if it's an interrupt
1312
+ const messageToStore = options.interruptCleanText || userMessageContent;
1301
1313
  this.conversationHistory.push({
1302
1314
  role: 'user',
1303
- content: userMessageContent,
1315
+ content: messageToStore,
1304
1316
  });
1317
+ // Capture the abort controller for THIS request locally so we are entirely immune to race conditions
1318
+ if (!this.currentAbortController) {
1319
+ this.currentAbortController = new AbortController();
1320
+ }
1321
+ const myAbortController = this.currentAbortController;
1305
1322
  // Calculate start index for AI context (0 for normal, current index for isolated workflow)
1306
1323
  const contextStartIndex = options.isolatedWorkflow ? this.conversationHistory.length - 1 : 0;
1307
1324
  // Helper to get messages for AI context respecting isolation
1308
1325
  const getMessagesForContext = () => {
1309
- if (options.isolatedWorkflow) {
1310
- return this.conversationHistory.slice(contextStartIndex);
1326
+ const msgs = options.isolatedWorkflow ? this.conversationHistory.slice(contextStartIndex) : [...this.conversationHistory];
1327
+ // If this is an interrupt, we must ensure the AI sees the wrapped message for this specific turn
1328
+ if (options.interruptCleanText && msgs.length > 0) {
1329
+ // Swap the last user message's content with the wrapped message just for the AI request
1330
+ const lastMsg = msgs[msgs.length - 1];
1331
+ if (lastMsg.role === 'user') {
1332
+ // We map over to not mutate the original history array object
1333
+ msgs[msgs.length - 1] = { ...lastMsg, content: userMessageContent };
1334
+ }
1311
1335
  }
1312
- return [...this.conversationHistory];
1336
+ return msgs;
1313
1337
  };
1314
1338
  // Messages are stored locally only - no backend persistence needed
1315
1339
  // Local storage is handled by saveCurrentChat() which saves to ~/.centaurus/chats/
@@ -1556,16 +1580,16 @@ DO NOT use write_to_file, edit_file, or execute_command until the plan is approv
1556
1580
  });
1557
1581
  // Stream AI response from backend
1558
1582
  // Backend will inject system prompt automatically with environment context
1559
- for await (const chunk of aiServiceClient.streamChat(selectedModel, messages, tools, environmentContext, mode, selectedModelThinkingConfig, this.currentAbortController?.signal)) {
1583
+ for await (const chunk of aiServiceClient.streamChat(selectedModel, messages, tools, environmentContext, mode, selectedModelThinkingConfig, myAbortController.signal)) {
1560
1584
  // Handle error chunks
1561
1585
  if (chunk.type === 'error') {
1562
1586
  // Check if this is an abort situation (user cancelled or sent new message)
1563
- if (chunk.code === 'TIMEOUT' && this.requestIntentionallyAborted) {
1564
- // Reset the flag
1565
- this.requestIntentionallyAborted = false;
1566
- // Clean up orphaned tool_calls from conversation history
1567
- // This prevents 400 Bad Request errors when assistant has tool_calls without matching tool results
1568
- this.cleanupOrphanedToolCalls();
1587
+ if (chunk.code === 'TIMEOUT' && myAbortController.isIntentionalAbort) {
1588
+ if (!myAbortController.isReplacement) {
1589
+ // Clean up orphaned tool_calls from conversation history only if NOT a replacement.
1590
+ // If it's a replacement, the newer handleMessage already cleaned up before starting.
1591
+ this.cleanupOrphanedToolCalls();
1592
+ }
1569
1593
  // Gracefully exit - request was intentionally cancelled
1570
1594
  return;
1571
1595
  }
@@ -2389,18 +2413,18 @@ DO NOT use write_to_file, edit_file, or execute_command until the plan is approv
2389
2413
  }
2390
2414
  catch (e) { }
2391
2415
  this.conversationHistory.push(assistantHistoryMsg);
2392
- }
2393
- // Add tool results to conversation history as tool messages
2394
- // Format: { tool_call_id, name, result: <object or string> }
2395
- // Only add results for unhandled tool calls (handled ones already added their own results)
2396
- for (const toolResult of unhandledToolResults) {
2397
- // Add tool result to conversation history as tool message
2398
- // IMPORTANT: tool_call_id must be a top-level property
2399
- this.conversationHistory.push({
2400
- role: 'tool',
2401
- tool_call_id: toolResult.tool_call_id,
2402
- content: typeof toolResult.result === 'string' ? toolResult.result : JSON.stringify(toolResult.result),
2403
- });
2416
+ // Add tool results to conversation history as tool messages
2417
+ // Format: { tool_call_id, name, result: <object or string> }
2418
+ // Only add results for unhandled tool calls (handled ones already added their own results)
2419
+ for (const toolResult of unhandledToolResults) {
2420
+ // Add tool result to conversation history as tool message
2421
+ // IMPORTANT: tool_call_id must be a top-level property
2422
+ this.conversationHistory.push({
2423
+ role: 'tool',
2424
+ tool_call_id: toolResult.tool_call_id,
2425
+ content: typeof toolResult.result === 'string' ? toolResult.result : JSON.stringify(toolResult.result),
2426
+ });
2427
+ }
2404
2428
  }
2405
2429
  // Rebuild messages array with updated history
2406
2430
  // During agent loop: keep ALL thinking for current task
@@ -2409,6 +2433,34 @@ DO NOT use write_to_file, edit_file, or execute_command until the plan is approv
2409
2433
  // No need to reset currentTurnThinking - keep accumulating for the task
2410
2434
  // Re-inject subshell context
2411
2435
  messages = this.aiContextInjector.injectSubshellContext(messages, currentContext);
2436
+ // ── Mid-turn interrupt check ──────────────────────────────────
2437
+ // If the user sent a message while this turn was executing, inject
2438
+ // it into the conversation now so the AI sees it on the very next
2439
+ // turn — instead of waiting for the entire multi-turn task to end.
2440
+ if (this.interruptQueue.length > 0) {
2441
+ const nextInterrupt = this.interruptQueue.shift();
2442
+ // Update queue UI
2443
+ if (this.onInterruptQueueUpdateCallback) {
2444
+ this.onInterruptQueueUpdateCallback(this.interruptQueue);
2445
+ }
2446
+ // Notify App.tsx to add the user bubble to messageHistory
2447
+ if (this.onQueuedMessageDispatchedCallback) {
2448
+ this.onQueuedMessageDispatchedCallback(nextInterrupt);
2449
+ }
2450
+ quickLog(`[${new Date().toISOString()}] [handleMessage] Processing mid-turn interrupt from user.\n`);
2451
+ // Wrap the interrupt with context for the AI
2452
+ const wrappedInterrupt = `[SYSTEM NOTE: The user interrupted you with the following message. Please address it, adjust your actions, and proceed with the task.]\n\n${nextInterrupt}`;
2453
+ // Push the interrupt into conversation history so the AI
2454
+ // receives both the tool results from THIS turn and the
2455
+ // user's new message together on the next AI call.
2456
+ this.conversationHistory.push({
2457
+ role: 'user',
2458
+ content: wrappedInterrupt,
2459
+ });
2460
+ // Rebuild messages to include the interrupt
2461
+ messages = getMessagesForContext();
2462
+ messages = this.aiContextInjector.injectSubshellContext(messages, currentContext);
2463
+ }
2412
2464
  continue; // Loop back to AI service
2413
2465
  }
2414
2466
  else {
@@ -2515,11 +2567,10 @@ DO NOT use write_to_file, edit_file, or execute_command until the plan is approv
2515
2567
  // Log the error
2516
2568
  conversationLogger.logError('handleMessage', error);
2517
2569
  // Check if this was an abort/cancellation (including timeout errors from aborted requests)
2518
- if (error.name === 'AbortError' || error.message?.includes('aborted') || error.message?.includes('timed out') || this.requestIntentionallyAborted) {
2570
+ if (error.name === 'AbortError' || error.message?.includes('aborted') || error.message?.includes('timed out') || myAbortController.isIntentionalAbort) {
2519
2571
  // If intentionally aborted for replacement by new message, return silently
2520
2572
  // The new message will take over - no need to show cancellation message
2521
- if (this.requestIntentionallyAborted) {
2522
- this.requestIntentionallyAborted = false;
2573
+ if (myAbortController.isIntentionalAbort && myAbortController.isReplacement) {
2523
2574
  return;
2524
2575
  }
2525
2576
  conversationLogger.logError('handleMessage', new Error('Request cancelled by user'));
@@ -2544,6 +2595,29 @@ DO NOT use write_to_file, edit_file, or execute_command until the plan is approv
2544
2595
  }
2545
2596
  // Clean up abort controller
2546
2597
  this.currentAbortController = undefined;
2598
+ // Process any queued interrupts if the task wasn't aborted intentionally
2599
+ if (this.interruptQueue.length > 0 && !this.requestIntentionallyAborted) {
2600
+ // We aren't checking `myAbortController.isIntentionalAbort` here because we don't set it anymore
2601
+ // Next message in queue
2602
+ const nextInterrupt = this.interruptQueue.shift();
2603
+ if (this.onInterruptQueueUpdateCallback) {
2604
+ this.onInterruptQueueUpdateCallback(this.interruptQueue);
2605
+ }
2606
+ // Notify UI that this queued message is now being dispatched for processing.
2607
+ // App.tsx uses this to add the user message to messageHistory at the correct time
2608
+ // (i.e., when the message actually starts being processed, not when it was first queued).
2609
+ if (this.onQueuedMessageDispatchedCallback) {
2610
+ this.onQueuedMessageDispatchedCallback(nextInterrupt);
2611
+ }
2612
+ quickLog(`[${new Date().toISOString()}] [handleMessage] Processing queued interrupt from user.\n`);
2613
+ const wrappedMessage = `[SYSTEM NOTE: The user interrupted you with the following message. Please address it, adjust your actions, and proceed with the task.]\n\n${nextInterrupt}`;
2614
+ // Start next message processing asynchronously so we don't block finally block returning
2615
+ setTimeout(() => {
2616
+ this.handleMessage(wrappedMessage, { interruptCleanText: nextInterrupt }).catch(err => {
2617
+ conversationLogger.logError('Queued interrupt handleMessage', err);
2618
+ });
2619
+ }, 0);
2620
+ }
2547
2621
  }
2548
2622
  }
2549
2623
  async handleSlashCommand(command) {
@@ -3641,7 +3715,12 @@ Create once, run many times across different machines.`;
3641
3715
  const workflowPrompt = this.buildWorkflowPrompt(workflow);
3642
3716
  // Use setTimeout to allow the UI to update before starting execution
3643
3717
  setTimeout(() => {
3644
- this.handleMessage(workflowPrompt, { isolatedWorkflow: true });
3718
+ this.handleMessage(workflowPrompt, { isolatedWorkflow: true }).catch((err) => {
3719
+ quickLog(`[${new Date().toISOString()}] [Workflow] Error executing workflow: ${err.message}\n`);
3720
+ if (this.onDirectMessageCallback) {
3721
+ this.onDirectMessageCallback(`❌ Error executing workflow: ${err.message}`);
3722
+ }
3723
+ });
3645
3724
  }, 100);
3646
3725
  return;
3647
3726
  }
@@ -4456,116 +4535,122 @@ Create once, run many times across different machines.`;
4456
4535
  if (this.onDirectMessageCallback) {
4457
4536
  this.onDirectMessageCallback(`🔄 Reconnecting to session${nestingInfo}...`);
4458
4537
  }
4459
- // Sequential reconnection through the stack
4460
- let previousCwd = baseLocalCwd;
4461
- for (let i = 0; i < contextStackToRestore.length; i++) {
4462
- const remoteCtx = contextStackToRestore[i];
4463
- const { type, connectionCommand, remoteCwd } = remoteCtx;
4464
- const levelInfo = contextStackToRestore.length > 1 ? ` [${i + 1}/${contextStackToRestore.length}]` : '';
4465
- // Show connecting status for this level
4466
- if (this.onDirectMessageCallback) {
4467
- this.onDirectMessageCallback(`🔄${levelInfo} Connecting to ${type.toUpperCase()}...`);
4468
- }
4469
- if (this.onConnectionStatusUpdate) {
4470
- this.onConnectionStatusUpdate({
4471
- type: type,
4472
- status: 'connecting',
4473
- connectionString: this.buildConnectionString(type, remoteCtx.metadata)
4474
- });
4475
- }
4476
- try {
4477
- // Detect and connect using the saved command
4478
- const detection = this.commandDetector.detect(connectionCommand);
4479
- if (!detection) {
4480
- throw new Error(`Could not detect handler for: ${connectionCommand}`);
4481
- }
4482
- // Create a new instance of the handler to ensure each level of the connection
4483
- // has its own state (client, stream, etc.), critical for nested sessions of the same type
4484
- const handler = detection.handler.createNew();
4485
- let context;
4486
- // Check if this is a nested connection (i > 0 means we're inside a remote session)
4487
- if (i > 0) {
4488
- const currentContext = this.contextManager.getCurrentContext();
4489
- if (handler.connectFromRemote) {
4490
- context = await handler.connectFromRemote(connectionCommand, previousCwd, currentContext);
4491
- }
4492
- else {
4493
- throw new Error(`Nested connections not supported by ${type} handler`);
4494
- }
4495
- }
4496
- else {
4497
- // First level: connect from local
4498
- context = await handler.connect(connectionCommand, previousCwd);
4499
- }
4500
- // Push to stacks
4501
- this.connectionCommandStack.push(connectionCommand);
4502
- if (i > 0) {
4503
- this.cwdStack.push(previousCwd); // Save the previous remote CWD for nested exits
4504
- }
4505
- this.contextManager.pushContext(context);
4506
- // Navigate to saved remote CWD
4507
- if (remoteCwd && remoteCwd !== context.metadata.workingDirectory) {
4508
- try {
4509
- await this.contextManager.executeCommand(`cd "${remoteCwd}"`);
4510
- }
4511
- catch (cdError) {
4512
- // Failed to cd to saved path - warn but continue
4513
- if (this.onDirectMessageCallback) {
4514
- this.onDirectMessageCallback(`⚠️ Could not restore ${type} directory: ${remoteCwd}`);
4515
- }
4516
- }
4538
+ this.isReconnecting = true;
4539
+ try {
4540
+ // Sequential reconnection through the stack
4541
+ let previousCwd = baseLocalCwd;
4542
+ for (let i = 0; i < contextStackToRestore.length; i++) {
4543
+ const remoteCtx = contextStackToRestore[i];
4544
+ const { type, connectionCommand, remoteCwd } = remoteCtx;
4545
+ const levelInfo = contextStackToRestore.length > 1 ? ` [${i + 1}/${contextStackToRestore.length}]` : '';
4546
+ // Show connecting status for this level
4547
+ if (this.onDirectMessageCallback) {
4548
+ this.onDirectMessageCallback(`🔄${levelInfo} Connecting to ${type.toUpperCase()}...`);
4517
4549
  }
4518
- // Update previousCwd for next iteration
4519
- previousCwd = this.contextManager.getCurrentContext().metadata.workingDirectory;
4520
- // Show success for this level
4521
4550
  if (this.onConnectionStatusUpdate) {
4522
4551
  this.onConnectionStatusUpdate({
4523
4552
  type: type,
4524
- status: 'connected',
4553
+ status: 'connecting',
4525
4554
  connectionString: this.buildConnectionString(type, remoteCtx.metadata)
4526
4555
  });
4527
4556
  }
4528
- }
4529
- catch (error) {
4530
- // Connection failed at this level - fall back to local mode
4531
- // If we partially connected, disconnect all and reset
4532
- while (this.contextManager.getCurrentContext().type !== 'local') {
4533
- const ctx = this.contextManager.getCurrentContext();
4534
- if (ctx.handler) {
4557
+ try {
4558
+ // Detect and connect using the saved command
4559
+ const detection = this.commandDetector.detect(connectionCommand);
4560
+ if (!detection) {
4561
+ throw new Error(`Could not detect handler for: ${connectionCommand}`);
4562
+ }
4563
+ // Create a new instance of the handler to ensure each level of the connection
4564
+ // has its own state (client, stream, etc.), critical for nested sessions of the same type
4565
+ const handler = detection.handler.createNew();
4566
+ let context;
4567
+ // Check if this is a nested connection (i > 0 means we're inside a remote session)
4568
+ if (i > 0) {
4569
+ const currentContext = this.contextManager.getCurrentContext();
4570
+ if (handler.connectFromRemote) {
4571
+ context = await handler.connectFromRemote(connectionCommand, previousCwd, currentContext);
4572
+ }
4573
+ else {
4574
+ throw new Error(`Nested connections not supported by ${type} handler`);
4575
+ }
4576
+ }
4577
+ else {
4578
+ // First level: connect from local
4579
+ context = await handler.connect(connectionCommand, previousCwd);
4580
+ }
4581
+ // Push to stacks
4582
+ this.connectionCommandStack.push(connectionCommand);
4583
+ if (i > 0) {
4584
+ this.cwdStack.push(previousCwd); // Save the previous remote CWD for nested exits
4585
+ }
4586
+ this.contextManager.pushContext(context);
4587
+ // Navigate to saved remote CWD
4588
+ if (remoteCwd && remoteCwd !== context.metadata.workingDirectory) {
4535
4589
  try {
4536
- await ctx.handler.disconnect();
4590
+ await this.contextManager.executeCommand(`cd "${remoteCwd}"`);
4537
4591
  }
4538
- catch (e) { /* ignore */ }
4592
+ catch (cdError) {
4593
+ // Failed to cd to saved path - warn but continue
4594
+ if (this.onDirectMessageCallback) {
4595
+ this.onDirectMessageCallback(`⚠️ Could not restore ${type} directory: ${remoteCwd}`);
4596
+ }
4597
+ }
4598
+ }
4599
+ // Update previousCwd for next iteration
4600
+ previousCwd = this.contextManager.getCurrentContext().metadata.workingDirectory;
4601
+ // Show success for this level
4602
+ if (this.onConnectionStatusUpdate) {
4603
+ this.onConnectionStatusUpdate({
4604
+ type: type,
4605
+ status: 'connected',
4606
+ connectionString: this.buildConnectionString(type, remoteCtx.metadata)
4607
+ });
4539
4608
  }
4540
- this.contextManager.popContext();
4541
4609
  }
4542
- this.cwdStack = [];
4543
- this.connectionCommandStack = [];
4544
- if (this.onConnectionStatusUpdate) {
4545
- this.onConnectionStatusUpdate({
4546
- type: type,
4547
- status: 'error',
4548
- connectionString: this.buildConnectionString(type, remoteCtx.metadata),
4549
- error: error.message
4550
- });
4610
+ catch (error) {
4611
+ // Connection failed at this level - fall back to local mode
4612
+ // If we partially connected, disconnect all and reset
4613
+ while (this.contextManager.getCurrentContext().type !== 'local') {
4614
+ const ctx = this.contextManager.getCurrentContext();
4615
+ if (ctx.handler) {
4616
+ try {
4617
+ await ctx.handler.disconnect();
4618
+ }
4619
+ catch (e) { /* ignore */ }
4620
+ }
4621
+ this.contextManager.popContext();
4622
+ }
4623
+ this.cwdStack = [];
4624
+ this.connectionCommandStack = [];
4625
+ if (this.onConnectionStatusUpdate) {
4626
+ this.onConnectionStatusUpdate({
4627
+ type: type,
4628
+ status: 'error',
4629
+ connectionString: this.buildConnectionString(type, remoteCtx.metadata),
4630
+ error: error.message
4631
+ });
4632
+ }
4633
+ const failedAt = contextStackToRestore.length > 1 ? ` at level ${i + 1} (${type})` : '';
4634
+ if (this.onDirectMessageCallback) {
4635
+ this.onDirectMessageCallback(`⚠️ Loaded chat: "${chat.title}"\n\n❌ Could not reconnect${failedAt}: ${error.message}\n\n📁 Restored to local directory: ${baseLocalCwd}`);
4636
+ }
4637
+ return;
4551
4638
  }
4552
- const failedAt = contextStackToRestore.length > 1 ? ` at level ${i + 1} (${type})` : '';
4553
- if (this.onDirectMessageCallback) {
4554
- this.onDirectMessageCallback(`⚠️ Loaded chat: "${chat.title}"\n\n❌ Could not reconnect${failedAt}: ${error.message}\n\n📁 Restored to local directory: ${baseLocalCwd}`);
4639
+ }
4640
+ // All levels connected successfully
4641
+ if (this.onDirectMessageCallback) {
4642
+ const successInfo = contextStackToRestore.length > 1
4643
+ ? `🔗 Reconnected through ${contextStackToRestore.length} levels`
4644
+ : '';
4645
+ if (successInfo) {
4646
+ this.onDirectMessageCallback(successInfo);
4555
4647
  }
4556
- return;
4557
4648
  }
4649
+ return;
4558
4650
  }
4559
- // All levels connected successfully
4560
- if (this.onDirectMessageCallback) {
4561
- const successInfo = contextStackToRestore.length > 1
4562
- ? `🔗 Reconnected through ${contextStackToRestore.length} levels`
4563
- : '';
4564
- if (successInfo) {
4565
- this.onDirectMessageCallback(successInfo);
4566
- }
4651
+ finally {
4652
+ this.isReconnecting = false;
4567
4653
  }
4568
- return;
4569
4654
  }
4570
4655
  // No remote context - show regular confirmation and restore CWD
4571
4656
  if (!shouldPreserveRemote && chat.cwd && !chat.remoteContext) {