fix(app): a transcript belongs to the voice session its utterance started in

Each Joined carries a new session number; the core records, when an
utterance's speech_start arrives, the session Jarvis is in, and its Partial
and Final carry that number (Heard.session) even when they arrive after a
leave or a move. The dashboard shows only the current session's captions.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
javis-bot
2026-11-12 14:00:21 +09:00
parent 371e87f553
commit e8ddde5be6
6 changed files with 129 additions and 25 deletions

View File

@@ -140,8 +140,11 @@ and the late "left" update cancelled the new join (seen on real Discord).
`speaking_end` is sent.
- When a person leaves the channel (gateway voice state or songbird's client disconnect), the bot
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;
- **Events** for the layers above: `SpeechStart`, `Partial` and `Final` with the speaker's ID,
server display name and voice session. Each `Joined` carries a new session number (from 1); an
utterance belongs to the session Jarvis was in when its `speech_start` came (none outside a
session, and none once that session ended or the worker restarted), and its `Partial` and
`Final` carry that number even when they arrive later; `SpeakingStopped` with the speaker's ID when their `speaking_end` is sent;
`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`. `WorkerLost` when the voice worker connection ends: the finals of utterances in progress will not