Show server-queued chat prompts from the server, with Remove

The thread reads the session's queued prompts from the chat_subscribe reply
and chat_queue frames: a reload draws them as Queued after the transcript,
a delivered one enters the transcript as Sent, a refused one becomes Not
sent, and Remove sends chat_unqueue. A prompt the server reports queued is
dropped from the device unsent store; the any-frame queued heuristic is
used only with a server that does not report its queue.
This commit is contained in:
2026-11-01 18:42:10 +00:00
parent e42f9cc031
commit 70cdf985c5
9 changed files with 565 additions and 17 deletions
@@ -217,6 +217,14 @@ class ChatRepository {
gateway.call('chat_interrupt', {
'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.
Future<JsonMap> unqueue(String sessionId, String operationId) =>
gateway.call('chat_unqueue', {
'chat_unqueue': {'session_id': sessionId, 'operation_id': operationId},
});
Future<JsonMap> answerForm(
String sessionId,
String formId,