Repository navigation
Fix PTT dead-mic recovery and prove realtime providers - #9770
Merged
Merged
Conversation
…at mint 429 as retryable Bluetooth silent-mic fallback was sharing recordCaptureRebuild's outcome arm with CoreAudio rebuilds, so switch_to_built_in_mic results were mislabeled. Keep arming on the dead-mic threshold path only. Map probe HTTP 429 to exit 75 to match desktop mint transient handling. Co-authored-by: Cursor <[email protected]>
Bluetooth silent-mic fallback correctly leaves outcomes unarmed, but the mid-turn CoreAudio watchdog rebuild also stopped arming after that split. Arm only inside requestCoreAudioCaptureRecovery so both threshold and watchdog CoreAudio rebuilds get truthful next-turn success/failure. Co-authored-by: Cursor <[email protected]>
This was referenced Jul 15, 2026
Git-on-my-level
added a commit
to Git-on-my-level/omi
that referenced
this pull request
Jul 23, 2026
Add a per-PTT-attempt lifecycle correlation model that classifies a silent capture failure into one of four causally distinct boundaries the existing late ptt_audio_capture_silent_turn snapshot cannot locate: 1. capture_never_operational (start failed / async start race, no callback) 2. zero_or_near_zero_samples (operational but only zero frames) 3. released_before_usable_audio (key up before first usable frame) 4. recovery_outcome_* (rebuild did/did-not restore next judgeable turn) PTTAttemptLifecycleRecorder accumulates the capture boundaries that already exist (press, capture-start requested/accepted/failed, first audio callback, first usable frame, release/disposition, recovery) into one redacted snapshot emitted as ptt_audio_capture_lifecycle at termination. Fields are bounded, low-cardinality buckets/classes only — never raw audio, device names, hardware IDs, paths, OSStatus, or error strings. Raw PCM is reduced to an energy bucket while searching for the first usable frame, then scanning stops. A recovery requested on attempt N is resolved by the next judgeable attempt N+1 (recovery_attempt_id join; a non-judgeable turn does not consume it). Routes through DesktopDiagnosticsManager into the existing ring buffer + Sentry incident attachment; remote (PostHog) only for non-committed terminations. Wired into PushToTalkManager at the existing seams and AudioCaptureService (onInputRouteChanged for the route-change flag). Product behavior and capture/ recovery semantics unchanged; silence gates and silent-audio provider routing untouched. Motivated by the BasedHardware#9081 dead-mic incident cluster (resolved by BasedHardware#9770); closes the residual capture-boundary observability gap that cluster left out of scope.
Git-on-my-level
added a commit
to Git-on-my-level/omi
that referenced
this pull request
Jul 23, 2026
Add a per-PTT-attempt lifecycle correlation model that classifies a silent capture failure into one of four causally distinct boundaries the existing late ptt_audio_capture_silent_turn snapshot cannot locate: 1. capture_never_operational (start failed / async start race, no callback) 2. zero_or_near_zero_samples (operational but only zero frames) 3. released_before_usable_audio (key up before first usable frame) 4. recovery_outcome_* (rebuild did/did-not restore next judgeable turn) PTTAttemptLifecycleRecorder accumulates the capture boundaries that already exist (press, capture-start requested/accepted/failed, first audio callback, first usable frame, release/disposition, recovery) into one redacted snapshot emitted as ptt_audio_capture_lifecycle at termination. Fields are bounded, low-cardinality buckets/classes only — never raw audio, device names, hardware IDs, paths, OSStatus, or error strings. Raw PCM is reduced to an energy bucket while searching for the first usable frame, then scanning stops. A recovery requested on attempt N is resolved by the next judgeable attempt N+1 (recovery_attempt_id join; a non-judgeable turn does not consume it). Routes through DesktopDiagnosticsManager into the existing ring buffer + Sentry incident attachment; remote (PostHog) only for non-committed terminations. Wired into PushToTalkManager at the existing seams and AudioCaptureService (onInputRouteChanged for the route-change flag). Product behavior and capture/ recovery semantics unchanged; silence gates and silent-audio provider routing untouched. Motivated by the BasedHardware#9081 dead-mic incident cluster (resolved by BasedHardware#9770); closes the residual capture-boundary observability gap that cluster left out of scope.
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
Closes #9757
Closes #9677
Closes #9081
Closes #9190
Root cause and durable guard
A zero-frame PTT turn previously reset the silent-capture evidence, while recovery was logged as successful when it was merely attempted. The policy now treats zero frames as neutral, keeps its threshold bounded, and waits for the next judgeable turn to record the rebuild outcome. Behavioral policy tests and wiring checks cover the affected discard and completion paths.
The development desktop-backend workflow verified revision identity but did not prove the direct managed provider websocket paths. It now mints a fixed non-human identity token, validates its auth-project audience/issuer/subject without exposing it, calls each provider directly, requires its terminal event, sanitizes all bounded results, and retries only timeouts or upstream 5xx responses. Hermetic tests cover OpenAI, Gemini, token contract mismatch, and transport timeout behavior.
Verification
cd desktop/macos && ./scripts/swift-test-suites.shBACKEND_PYTEST_WORKERS=4 PYTHON=/Users/david/workspace/omi/backend/.venv/bin/python ./backend/test.shactionlint .github/workflows/desktop_backend_auto_dev.yml .github/workflows/gcp_backend.yml .github/workflows/sync_ledger_fence_cutover.ymlpython3 -m py_compile backend/scripts/firebase_release_probe_token.py scripts/voice-provider-probe.shmake preflightomi-9757-pttbundle launched with the automation bridge; exercisedptt_startthenptt_stopwith no invalid lifecycle transition. The local bundle had no seeded auth session, so it correctly reached signed-out cancellation rather than an authenticated provider turn; the deployed workflow probe is the authenticated provider-path guard.Product invariants affected