Repository navigation
fix(desktop): defer auto-update relaunch while a call is being captured - #18842
Merged
Merged
Conversation
The Sparkle quiet-moment gate read VADGateService.lastSpeechAt, whose only producer has not been constructed since 32cbe7d, so every silent update installed immediately and a mid-call relaunch split one meeting into two conversations (crash_recovery + a new session). Capture now publishes its own activity: an in-progress meeting-role conversation is active now, and any transcribed segment marks speech. A single deferral is capped at 3 hours so a stuck meeting detector cannot block updates. Also adds a read-only call-audio probe for measuring per-app mic/speaker boundaries ahead of a MeetingDetector redesign. Failure-Class: new Co-Authored-By: Claude Opus 5.5 <[email protected]>
…on live capture Review follow-ups for the capture-aware update deferral: - The 3 h cap restarted whenever Sparkle re-offered or superseded an update, so a stuck detector plus the hourly release train could defer forever. The cap now runs from the first deferral since the last install. - Meeting activity is published from isLiveCapturing, not isTranscribing, so an Only-Meetings session armed with the mic paused is not "active". - Probe: unregister CoreAudio listeners for gone processes and handle Ctrl-C through a dispatch signal source instead of an async-signal-unsafe handler. Failure-Class: FC-guard-reads-unproduced-signal Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ease test compile Desktop Swift Release Compile builds the test target in release, where the DEBUG-gated resetForTesting() did not exist. Failure-Class: FC-guard-reads-unproduced-signal Co-Authored-By: Claude Opus 5.5 <[email protected]>
undivisible
added a commit
that referenced
this pull request
Sep 25, 2026
Main moved capture_controller.dart forward (silent pendant capture, #18842/#18900) and the branch conflicted. Resolution: keep main's _flushPhoneFrames() extraction and apply this PR's phoneSync hoist inside that helper, so all four per-frame loops still bind _wal.getSyncs().phone once. Amp-Thread-ID: https://ampcode.com/threads/T-01a0d866-81c0-732a-aee5-a5d50ddad64c Co-authored-by: Max Carter <[email protected]>
undivisible
added a commit
that referenced
this pull request
Sep 25, 2026
…2405605885 Main moved capture_controller.dart forward (silent pendant capture, #18842/#18900) and the branch conflicted. Resolution: take main's constructor and _flushPhoneFrames() extraction wholesale, apply this PR's phoneSync hoist inside the helper, and run dart format --line-length 120 so CI's formatter check is clean. Amp-Thread-ID: https://ampcode.com/threads/T-01a0d866-81c0-732a-aee5-a5d50ddad64c Co-authored-by: Max Carter <[email protected]>
undivisible
added a commit
that referenced
this pull request
Sep 25, 2026
Main moved capture_controller.dart forward (silent pendant capture, #18842/#18900) and the branch conflicted. Resolution: keep main's _flushPhoneFrames() extraction and apply this PR's phoneSync hoist inside that helper, so all four per-frame loops still bind _wal.getSyncs().phone once. Amp-Thread-ID: https://ampcode.com/threads/T-01a0d866-81c0-732a-aee5-a5d50ddad64c Co-authored-by: Max Carter <[email protected]>
This was referenced Sep 25, 2026
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
An automatic update restarted the desktop app in the middle of a call on 2026-09-25 (0.12.386 → 0.12.387 at 02:45:01Z). The relaunch recovered the interrupted session as
crash_recoveryand opened a new one, so one call became two conversations.The updater is meant to wait until nobody has spoken for 120 s, but it read
VADGateService.lastSpeechAt, and nothing has createdVADGateServicesince 32cbe7d (2026-04-05). That timestamp was always nil, so every silent auto-update installed immediately. A local Omi Beta log shows zeroSparkle: Deferringlines across four consecutive updates.This PR:
UpdateInstallActivity, which live capture updates:lastSpeechAt/markSpeechDetectedfromVADGateService.desktop/macos/scripts/call-audio-probe.swift, a read-only diagnostic. It logs mic/speaker start and stop per process (CoreAudio listeners, no polling) plus call-window titles as JSONL. It is for measuring call boundaries across call apps (Meet→Meet switch, mute, Telegram, Zoom, …) before redesigningMeetingDetector, which today cannot tell one call from the next.User-initiated "Install and Relaunch" is unchanged; only the silent
willInstallUpdateOnQuitpath is gated.Review
Independent review by zcode (GLM-5.3), read-only: no blockers. Addressed in f9e6a2c:
testCapCountsFromTheFirstDeferralWhenAnUpdateIsReoffered).isLiveCapturing, so an Only-Meetings session armed with the mic paused is not treated as active (test extended).Not changed: the probe sits outside the swift-format/SwiftLint scope (it is a standalone diagnostic), and deleting the now-provably-dead
VADGateServiceis left to a follow-up.Product invariants affected
UpdaterViewModel.swiftis under its globs. The beta identity, feed, and channel handling are unchanged; only the timing of the silent install changes.Verification
DeferredUpdateInstallTests: existing timing cases, plus the cap (still defers before it, installs at it) andstart()with a zero cap.UpdateInstallActivityTests: transcript activity, meeting-active-now, and thatAppStatepublishes meeting capture only while live-capturing (not while an Only-Meetings mic is paused).xcrun swift build --build-tests(Xcode 27, not CI's pinned toolchain) and the 12 focused tests pass.input_startfor a live Omi Beta capture, a stdinnotemarker, andprobe_stoppedon SIGINT.Failure class (fixes)
Failure-Class: new
Failure-class transition narrative (only when needed)
New class
FC-guard-reads-unproduced-signal. Violated contract: a safety gate must read a signal that the protected live path actually produces. The Sparkle deferral readVADGateService.lastSpeechAt, whose only producer stopped being constructed in 32cbe7d, and it treated nil as "quiet". For about six months it compiled, its arithmetic tests passed, and it never deferred once. Canonical guard: the capture path publishes the signal itself (UpdateInstallActivity), and a behavioral test drivesAppStatestate changes and asserts the gate observes them (UpdateInstallActivityTests). Evidence: this PR; 2026-09-25 mid-call relaunch split (PostHogUpdate Install Started02:45:01Z during an active meeting capture).🤖 Generated with Claude Code