fix(sessions): void the open ask_user form when a chat message arrives

An ordinary chat message answers the session's open ask in the user's
own words, so keeping the form open would invite answers to questions
the conversation has already moved past. The form now closes as
cancelled, browsers clear the live card, and the model is told without
being woken so the notice rides into the turn the message itself
starts. Ignored duplicate queued messages skip the void on purpose:
they must not void an ask posted after the queued original.
This commit is contained in:
Federico Jaramillo Martinez
2026-07-28 23:14:21 +02:00
parent f9d0b2b8d5
commit 12f25282fc
7 changed files with 83 additions and 2 deletions
+4
View File
@@ -831,6 +831,10 @@
and its unanswered questions to the model, and turns the earlier card into a read-only transcript record.
Submitted and cancelled asks likewise remain readable in the transcript.
</p>
<p>
Sending an ordinary chat message while a form is open voids the form: the card closes as cancelled and
the model is told its questions went unanswered as part of the turn the message itself starts.
</p>
<div class="callout warning">
<strong>Restart required:</strong> restart the session daemon after changing <code>askUser</code> or after
upgrading PI WEB to a version that introduces this tool. For the systemd user service, run
+2
View File
@@ -285,6 +285,8 @@ Calling `ask_user` posts the whole set as one browser form and ends the current
PI WEB confirms a partial submission before sending it and names the unanswered questions. Only one ask can be open per session: a later `ask_user` call supersedes the earlier one, reports that fact and its unanswered questions to the model, and turns the earlier card into a read-only transcript record. Submitted and cancelled asks likewise remain readable in the transcript.
Sending an ordinary chat message while a form is open voids the form: the card closes as cancelled and the model is told its questions went unanswered as part of the turn the message itself starts.
Restart the session daemon after changing `askUser` or after upgrading PI WEB to a version that introduces this tool. For the systemd user service, run `systemctl --user restart pi-web-sessiond`.
### Plugin config