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:
+5
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user