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
@@ -272,6 +272,11 @@ class ChatRepository {
'chat_query': {'session_id': sessionId},
});
Future<JsonMap> stopTasks(String sessionId) =>
gateway.call('chat_stop_tasks', {
'chat_query': {'session_id': sessionId},
});
/// Removes one prompt the server still holds in the session's queue. The
/// reply's `chat_queue` is the queue afterwards; a prompt already handed to
/// the harness is refused.