Repository navigation
voice-agent: deliver in-flight note view on reconnect - #246
Merged
Merged
Conversation
PR #241 added note-view injection but the debounce in startNoteViewingWatcher bumped lastNoteViewingTs before the session-active check. Consequence: a note opened while voice was disconnected was marked "handled" even though the callback no-op'd, so the view was silently dropped and the user had to click the note again after reconnecting. Two small changes: 1. startNoteViewingWatcher callback now returns boolean | void. The watcher only bumps lastNoteViewingTs when the callback returns anything other than false. The voice-agent callback returns true when it actually injects, false when the session isn't connected. Un-handled events stay pending. 2. New resetNoteViewingDebounce() is called from the MainAgent greeting getter — which fires on each fresh connect AND reconnect — so the current note-viewing event re-delivers on the next watcher poll (within 2s of reconnect). Also extracts readCurrentNoteViewing() as a shared reader so future callers (e.g. the reconnect flow itself, if we want to inject synchronously) don't need to reimplement the parse logic. Verified locally with tsc --noEmit. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
sonichi
added a commit
that referenced
this pull request
Apr 9, 2026
PR #246's keep-pending-on-disconnect path retries an unhandled note-view event every 2s until the client reconnects. Each retry also logged "[TaskBridge] Note view detected: <slug>", producing ~30 identical log lines per minute whenever a user opened a note while voice was disconnected. Noticed this afternoon filling voice-agent.log with `uiuc-trip-conflicts` spam when the user's voice session was idle. Track the last *logged* ts separately from the last *handled* ts. The detection log line now fires once per unique event.ts; resetNoteView- ingDebounce() (called on reconnect) clears both so a reconnect event is visible in the log again. The underlying retry behavior from PR #246 is unchanged — we still try to deliver every 2s, which is correct. Only the log side is quieter. Test plan: - ✓ tsc clean (`npx tsc --noEmit`) - ✓ npm test: 48/48 pass (was 27/28, cartesia-tts now passes after today's bodhi bump pulled the optional dep) - ✓ Restarted voice-agent against a still-viewed note with client disconnected → exactly 1 "Note view detected" line in 20s of log tail (was 30+ previously) 🤖 Generated with [Claude Code](https://claude.com/claude-code)
3 tasks done
sonichi
added a commit
that referenced
this pull request
Apr 10, 2026
PR #246's keep-pending-on-disconnect path retries an unhandled note-view event every 2s until the client reconnects. Each retry also logged "[TaskBridge] Note view detected: <slug>", producing ~30 identical log lines per minute whenever a user opened a note while voice was disconnected. Noticed this afternoon filling voice-agent.log with `uiuc-trip-conflicts` spam when the user's voice session was idle. Track the last *logged* ts separately from the last *handled* ts. The detection log line now fires once per unique event.ts; resetNoteView- ingDebounce() (called on reconnect) clears both so a reconnect event is visible in the log again. The underlying retry behavior from PR #246 is unchanged — we still try to deliver every 2s, which is correct. Only the log side is quieter. Test plan: - ✓ tsc clean (`npx tsc --noEmit`) - ✓ npm test: 48/48 pass (was 27/28, cartesia-tts now passes after today's bodhi bump pulled the optional dep) - ✓ Restarted voice-agent against a still-viewed note with client disconnected → exactly 1 "Note view detected" line in 20s of log tail (was 30+ previously) 🤖 Generated with [Claude Code](https://claude.com/claude-code)
liususan091219
pushed a commit
to liususan091219/sutando-fork
that referenced
this pull request
May 28, 2026
PR sonichi#241 added note-view injection but the debounce in startNoteViewingWatcher bumped lastNoteViewingTs before the session-active check. Consequence: a note opened while voice was disconnected was marked "handled" even though the callback no-op'd, so the view was silently dropped and the user had to click the note again after reconnecting. Two small changes: 1. startNoteViewingWatcher callback now returns boolean | void. The watcher only bumps lastNoteViewingTs when the callback returns anything other than false. The voice-agent callback returns true when it actually injects, false when the session isn't connected. Un-handled events stay pending. 2. New resetNoteViewingDebounce() is called from the MainAgent greeting getter — which fires on each fresh connect AND reconnect — so the current note-viewing event re-delivers on the next watcher poll (within 2s of reconnect). Also extracts readCurrentNoteViewing() as a shared reader so future callers (e.g. the reconnect flow itself, if we want to inject synchronously) don't need to reimplement the parse logic. Verified locally with tsc --noEmit. Co-authored-by: Chi <wangchi@Chis-Mac-mini.local> Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
liususan091219
pushed a commit
to liususan091219/sutando-fork
that referenced
this pull request
May 28, 2026
PR sonichi#246's keep-pending-on-disconnect path retries an unhandled note-view event every 2s until the client reconnects. Each retry also logged "[TaskBridge] Note view detected: <slug>", producing ~30 identical log lines per minute whenever a user opened a note while voice was disconnected. Noticed this afternoon filling voice-agent.log with `uiuc-trip-conflicts` spam when the user's voice session was idle. Track the last *logged* ts separately from the last *handled* ts. The detection log line now fires once per unique event.ts; resetNoteView- ingDebounce() (called on reconnect) clears both so a reconnect event is visible in the log again. The underlying retry behavior from PR sonichi#246 is unchanged — we still try to deliver every 2s, which is correct. Only the log side is quieter. Test plan: - ✓ tsc clean (`npx tsc --noEmit`) - ✓ npm test: 48/48 pass (was 27/28, cartesia-tts now passes after today's bodhi bump pulled the optional dep) - ✓ Restarted voice-agent against a still-viewed note with client disconnected → exactly 1 "Note view detected" line in 20s of log tail (was 30+ previously) 🤖 Generated with [Claude Code](https://claude.com/claude-code)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Follow-up to #241. The note-view debounce in
startNoteViewingWatcherbumpedlastNoteViewingTsbefore the session-active check in the voice-agent callback. Consequence: a note opened while voice was disconnected was marked "handled" even though the callback no-op'd, so the view was silently dropped and the user had to click the note again after reconnecting.What this fixes
Scenario: Voice session closed → user opens a note in the web UI → user reconnects voice → Gemini has no idea what note is on screen unless the user re-clicks it.
Owner wanted this fixed as a follow-up to #241 (which merged as-is with the bug documented as non-blocking).
Changes
startNoteViewingWatchercallback now returnsboolean | void. The watcher only bumpslastNoteViewingTswhen the callback returns anything other thanfalse. Voice-agent callback returnstruewhen it injects,falsewhen the session isn't connected. Un-handled events stay pending for the next poll.New
resetNoteViewingDebounce()called from theMainAgentgreeting getter — fires on each fresh connect AND reconnect — so the current note-viewing event re-delivers within 2 seconds of reconnect (the watcher poll interval).Extracted
readCurrentNoteViewing()as a shared reader so future synchronous injection paths don't need to re-implement the parse.What this doesn't do
Test plan
🤖 Generated with Claude Code