Repository navigation
Harden phone capture against silent audio loss - #20902
Merged
Git-on-my-level merged 9 commits intoOct 7, 2026
Merged
Git-on-my-level merged 9 commits into
Git-on-my-level merged 9 commits into
Conversation
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.
What changed and why
Hardens the never-lose-audio paths on the phone:
live, a watchdog now detects "socket down or no audio frames flowing" and
forces recovery at a WAL boundary instead of silently continuing to
believe audio is being captured.
misspast a thresholdare reported at startup/foreground instead of only retrying silently, so
uploads that never land are visible.
attending is active and capture is not owning, the app records a
capture-gap signal through the existing calendar capture telemetry —
post-capture visibility, not the conversation-list placeholders removed
in Remove the not-captured calendar gap UI from conversations #20884.
capture_evidence.coverageand covered-span vs wall-span seconds, sopartial captures are countable in metrics.
Why
A real 120-minute meeting produced zero server-side audio for its first 70
minutes (device made no server contact), and nothing in the product noticed.
The server cannot transcribe audio it never receives, so the fix is at the
capture client: notice silence-while-live, surface not-owning-during-meeting,
and account for partial coverage server-side.
Failure-Class
Failure-Class: none
Product invariants affected
app/lib/services/capture/**andapp/lib/services/wals/**. It adds no pause, unsubscribe, or fence: thewatchdog only forces recovery (WAL finalize + new session) when frames
have already stopped flowing, and the gap monitor is telemetry-only.
Every audio frame captured still reaches the socket or a durable WAL
write; nothing discards frames.
backend/utils/conversations/process_conversation.pyis inits path globs. The change adds a telemetry emission next to finalization;
it does not create an intake route, promote, archive, or fast-track any
memory, and canonical intake routing is untouched.
backend/utils/conversations/process_conversation.pyis inits path globs. The change adds no capture proposal surface; task
suggestion policy and its Suggested surfaces are untouched.
Line-Count-Exception
Line-Count-Exception: app/lib/services/capture/capture_controller.dart | 4081 -> 4211 | watchdog state hooks, suspension invalidation and socket-aware recovery callbacks; split deferred to the #9838 follow-up
Line-Count-Exception: app/lib/services/capture/capture_coordinator.dart | 2842 -> 2932 | watchdog wiring, socket-aware recovery dispatch and suspension-gap tracking
Line-Count-Exception: app/lib/services/wals/local_wal_sync.dart | 2576 -> 2636 | stale-miss reporting and reconciliation on startup and foreground
Line-Count-Exception: backend/utils/conversations/process_conversation.py | 3574 -> 3577 | three-line coverage counter emission at conversation finalize
Test plan
app: capture/watchdog/WAL-stale suites — 138 spine + 412 affected testspass (coordinator re-runs the load-bearing subset before review)
backend:tests/unit/test_capture_loss_accounting.py— 14 passedUI-Evidence
UI-Evidence: none -- no user-visible surface changed in this PR; the gap monitor is telemetry-only and recovery is behavior-preserving at equal UX.
Known limitations
before capture starts is covered by the calendar gap monitor's signal,
not prevention — prevention (meeting-aware capture nudge) is a follow-up.
Review round 1 fixes (grok REQUEST CHANGES → addressed)
onAppResumedclears pending failures before the reducer can apply them — no mid-sentence mic stop after screen lock (0f58880).CaptureEvidenceMetadatapath (faf763f).