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

Implemented fixes using test case errors

Alishahryar15bc978c5455a
diff --git a/messaging/tree_queue.py b/messaging/tree_queue.py
index c884e069..0784ee65 100644
--- a/messaging/tree_queue.py
+++ b/messaging/tree_queue.py
@@ -271,8 +271,16 @@ class TreeQueueManager:
logger.info(f"Cancelled {len(cancelled_nodes)} nodes in tree {root_id}")
return cancelled_nodes
+ async def cancel_all(self) -> List[MessageNode]:
+ """Cancel all messages in all trees (async wrapper)."""
+ async with self._lock:
+ return self.cancel_all_sync()
+
def cancel_all_sync(self) -> List[MessageNode]:
- """Cancel all messages in all trees (synchronous/locked version)."""
+ """
+ Cancel all messages in all trees (synchronous/locked version).
+ NOTE: Must be called with self._lock held.
+ """
all_cancelled = []
for root_id in list(self._repository.tree_ids()):
all_cancelled.extend(self.cancel_tree(root_id))
diff --git a/tests/test_handler.py b/tests/test_handler.py
index ae96efc4..100cea95 100644
--- a/tests/test_handler.py
+++ b/tests/test_handler.py
@@ -114,7 +114,7 @@ async def test_stop_all_tasks(handler, mock_cli_manager, mock_platform):
mock_node.status_message_id = "status_1"
with patch.object(
- handler.tree_queue, "cancel_all", AsyncMock(return_value=[mock_node])
+ handler.tree_queue, "cancel_all_sync", MagicMock(return_value=[mock_node])
):
count = await handler.stop_all_tasks()