Stop background tasks separately from chat turns

Keep Esc and /stop scoped to the foreground turn while exposing an explicit stop-tasks operation for supported chat backends. Add the protocol, server routing, app command, and coverage for task stopping and unsupported harnesses.
This commit is contained in:
2026-11-13 16:47:41 +00:00
parent c3c2c1bbc9
commit 2a182d7f17
19 changed files with 331 additions and 2 deletions
+5
View File
@@ -243,6 +243,11 @@ def handle(line):
state["pending"] = None
send({"type": "result", "subtype": "error_during_execution", "is_error": True,
"result": "Interrupted", "session_id": state["session"]})
elif subtype == "stop_task":
respond(value.get("request_id"), {})
send({"type": "system", "subtype": "task_notification",
"task_id": request.get("task_id"), "tool_use_id": "toolu_bg_fake",
"status": "stopped", "summary": "Background task stopped"})
elif subtype == "get_usage":
respond(value.get("request_id"), {"session": {
"total_cost_usd": 0.25,