Skip to content

Use Claude Code, Codex, VSCode, Pi, and OpenCode (and 6 other harnesses) for free (1.3B+ free tokens) from your terminal, app, IDE, or phone, and now from the browser with native browser sessions (multi-harness + multi-model) like OpenClaw (voice supported + ToS friendly)

Python

fixed /stop

Alishahryar1e6bf052edfe4
diff --git a/messaging/handler.py b/messaging/handler.py
index f299cc04..72177f05 100644
--- a/messaging/handler.py
+++ b/messaging/handler.py
@@ -473,15 +473,16 @@ class ClaudeMessageHandler:
2. Cancel async tasks in tree queue
3. Update UI for all affected nodes
"""
- # 1. Stop CLI sessions FIRST - this kills subprocess and unblocks I/O
- logger.info("Stopping all CLI sessions...")
- await self.cli_manager.stop_all()
-
- # 2. Cancel tree queue tasks (now they should unblock immediately)
+ # 1. Cancel tree queue tasks FIRST
+ # This ensures we capture the count of active tasks before they clean up
logger.info("Cancelling tree queue tasks...")
cancelled_nodes = await self.tree_queue.cancel_all()
logger.info(f"Cancelled {len(cancelled_nodes)} nodes")
+ # 2. Stop CLI sessions - this kills subprocesses and ensures everything is dead
+ logger.info("Stopping all CLI sessions...")
+ await self.cli_manager.stop_all()
+
# 3. Update UI for all cancelled nodes
for node in cancelled_nodes:
# Fire and forget to avoid blocking the cleanup process