fix(discord-voice): wake/addressed state stranded on torn-down session after watchdog reset — bot permanently muted despite owner summons
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 396
- Forks
- 92
- Avg merge
- 22h 26m
- Merged PRs (30d)
- 622
Description
Symptom (live, 2026-06-11 14:38-14:43 UTC, group session w/ 2 humans)
After the watchdog's forced full reset recovered a hung Gemini session (the #1600 M-fix working as designed — hang detected at 65s-since-last-turn, re-handshake in 2s), the bot never spoke again: every model turn after the reset was muted by the speak gate, including direct responses to 20+ owner name-summons and the canonical wake phrase ("Lucy, wake up", 14:39:54). ~450 muted audio chunks over 5+ minutes; Gemini alive and completing turns (turn_101, turn_102, …) the whole time.
Audit evidence (the #1600 observability rows made this diagnosable)
name_gaterows: owner + second human summons all detected —aiAddressed:1, namedDet:1(20+ rows 14:39:06→14:43:24).speak_decisionrows: simultaneous, continuous{"speak":false,"regime":"group","reason":"group-active-unaddressed"}.- Signature: name detection says ADDRESSED, speak gate says UNADDRESSED → the two layers stopped sharing state exactly at the reset boundary (14:38:12 "reconnect — per-turn latches reset").
Root cause (same class as the fixed _recountHumans stale-ref)
The watchdog reset path (handleTransportClose(4002) → session rebuild) leaves the wake/addressed plumbing pointing at the torn-down session's state: summons recorded post-reset never reach the gate the audio-mute path consults (s.gate.lastAddressedToMe / wake-stamp window). The #1600 fix hoisted the human-recount into a module-level ref (_recountHumansRef) for exactly this reason; the gate/wake state needs the same treatment.
Proposed minimal fix
Hoist the gate/wake state wiring to survive resets the way _recountHumansRef does: after the in-place session rebuild, re-bind the STT-side writers (decideForTurn target, wake stamps) and the audio-gate readers to the SAME live object. One mechanism, no behavior change outside the reset path.
Acceptance (live, per the smoke-checklist discipline)
- Trigger or wait for a watchdog reset mid-group-session; owner says the bot's name once afterwards → bot responds audibly.
name_gate.aiAddressed:1rows are followed byspeak_decision speak:true(notgroup-active-unaddressed) within the sticky window.- Existing 419-test suite stays green.
Related: the watchdog rework + audit rows on PR #1427 (this bug is only visible because of them); same-class precedent: the _recountHumansRef fix (#1600 count-drift).
— filed by Lucy (Mac Studio bot), diagnosed live with Susan + Chi in-session
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at handleTransportClose(4002) and the in-place session rebuild, then compare the gate/wake wiring with the module-level _recountHumansRef precedent. Run the 419-test suite and follow the live smoke checklist; done means a post-reset owner summons produces audible speech and name_gate detection is followed by speak:true within the sticky window.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- audio-video-rtc
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 48/100