fix(app): every stop voids waiting requests and pending addressed questions

- A voice stop also voids pending "addressed" questions, so a yes that
  arrives afterwards starts nothing.
- The core sends Stopped before the SpeakEnds of what stop() or the end
  of a session cancelled; the conversation drops its queue on it, so the
  slash command's stop no longer starts the next waiting request.
- An addressed answer after its 5 s timeout counts as no even when it is
  handled before the timer.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
javis-bot
2026-11-11 22:32:32 +09:00
parent f892a1dce9
commit de35573e5f
4 changed files with 85 additions and 22 deletions

View File

@@ -139,8 +139,9 @@ and the late "left" update cancelled the new join (seen on real Discord).
sends `speaker_leave`, so their utterance finishes and the worker frees their place.
- **Events** for the layers above: `SpeechStart`, `Partial` and `Final` with the speaker's ID and
server display name; `SpeakingStopped` with the speaker's ID when their `speaking_end` is sent;
`SpeakStart` and `SpeakEnd`; `Joined` and `Left` (with a reason: `command`, `moved`, `disconnected`,
`shutdown`); `Addressed` and `Ranked` with the brain's answers to `ask_addressed` and `ask_rank`.
`SpeakStart` and `SpeakEnd`; `Stopped` when all speech is stopped (`stop()`, the slash command or the
session ending), sent before the `SpeakEnd`s it causes; `Joined` and `Left` (with a reason: `command`,
`moved`, `disconnected`, `shutdown`); `Addressed` and `Ranked` with the brain's answers to `ask_addressed` and `ask_rank`.
- **Speaking**: `say(text, more)` queues a TTS request and returns its id (`None` when not in a voice
channel); `continue_text(id, text, more)` adds text to an open request. Each sentence the worker
sends becomes one clip (a 48 kHz stereo WAV played through songbird without resampling); clips play