Skip to content

[P1] One PR: arm PTT dead-mic recovery correctly + prove the realtime provider path on every dev deploy #9757

Closed

Description

@Git-on-my-level

Decision

Ship one PR that makes desktop PTT truthful in the two places field evidence says it lies, and wires the live proof into an existing automatic pipeline so it can never go stale:

  1. Dead-mic recovery arms correctly — fixes the evidence policy so silent-capture turns actually trigger the existing recovery machinery (closes fix(desktop): keep PTT dead-mic recovery armed across zero-frame turns (#9081) #9677 and the macOS PTT hold mode records silent turns for 169 users with no recovery attempted #9081 failure class).
  2. Every dev deploy of the desktop Rust backend proves the realtime provider path end-to-end — a mint→connect→commit→response probe runs as a post-deploy step in desktop_backend_auto_dev.yml, failing closed (closes Gemini realtime token mint still fails after #9102 diagnostics fix #9190 by live verification).

One PR, one reviewable unit, commits split per testable surface per repo convention (Swift fix / probe script / workflow wiring). No new state machines, no funnel taxonomy, no SLO dashboards, no scheduled jobs, no release-gate apparatus. The probe is alive because it rides a pipeline that already runs on every main push touching the desktop backend — not because anyone remembers to run it.

This PR closes: #9677, #9081, #9190, and this issue.

Grounding (verified in current code)

Authoritative owners are unchanged: VoiceTurnStateMachine/VoiceTurnCoordinator own PTT semantics, PushToTalkManager is the physical capture adapter, RealtimeHubController owns provider sessions. This PR must not add a second phase machine or a new provider path.

Commit 1 — Swift: dead-mic evidence policy (closes #9677, #9081)

In PushToTalkManager's dead-mic policy, implement exactly:

The asynchronous capture-start/finalize race that produces some zero-frame turns stays out of scope — once zero-frame turns are neutral evidence, the race costs one retry instead of disarming recovery. If someone later wants explicit capture-ready modeling, that is a new issue.

Required tests (extend PTTSilentMicRecoveryPolicyTests / PTTSilentTurnRecoveryWiringTests; they must drive the production policy and wiring, not reimplementations):

# Case Asserts
1 Zero-frame turn between two near-zero turns count preserved across the zero-frame turn (the #9677 regression test)
2 N consecutive judgeable near-zero turns count reaches threshold, rebuild fires exactly once
3 Audible turn after near-zero turns count resets
4 Rebuild fires → next simulated turn delivers audio recovery outcome recorded as success; policy re-arms (the #9081 test — recovery must be proven, not just invoked)
5 Rebuild fires → next turn still near-zero recovery recorded as failed; policy does not spin (bounded re-attempt)

Commit 2 — Probe script: scripts/voice-provider-probe.sh

A self-contained script (bash or Python, no new dependencies beyond what CI has) that, given <openai|gemini> and a backend base URL:

  1. authenticates as the dev probe identity (a dedicated dev test account; token from env/secret — never a real user);
  2. calls the deployed realtime mint route;
  3. validates the typed mint response (OpenAI ek_… secret / Gemini auth_tokens/… name);
  4. establishes a usable provider connection with the minted credential;
  5. commits a deterministic non-sensitive input fixture;
  6. awaits a valid response event;
  7. closes cleanly, classifying expected-idle teardown separately from failure.

Output: one line per step with a bounded failure class (mint_http_4xx, mint_schema, connect_failed, no_response, upstream_5xx, …), sanitized (no tokens, no transcript content), exit nonzero on any failure. A 2xx mint alone does not pass; step 6 is the pass condition. This encodes the #9080→#9190 lesson: token minted ≠ provider path works.

Commit 3 — Wiring: probe runs on every dev deploy

In desktop_backend_auto_dev.yml, after "Verify development backend release identity":

  • run the probe for both providers against the just-deployed revision URL;
  • bounded retry (e.g. 2 retries, upstream 5xx/timeout only — schema/4xx failures never retry);
  • fail the workflow on probe failure, so a broken provider path is red at the moment someone merged the change that broke it (or upstream drifted), with the diff still in context;
  • a skip_provider_probe workflow input allows override during a genuine provider outage — it must leave a visible notice in the run log, never a silent skip.

No scheduled/cron lane, no dashboard, no separate alerting: the check lives exactly where its failure has an audience. Because this workflow runs on every main push touching the desktop backend, upstream contract drift is caught within one merge cycle.

Docs in the same commit (Definition of Done): note the probe in the backend service map / desktop backend docs, and add one line to desktop/macos/AGENTS.md: verification of voice-path changes means a natural authenticated PTT turn on a named bundle — signed-out, forced-transcript, or reducer-only runs do not count; provider mint/payload changes must show a probe run.

Real-path verification (attach evidence to the PR)

  1. Dead-mic recovery: named bundle (omi-ptt-recovery), fault the mic input (or physically mute), perform PTT turns until the threshold trips; confirm from logs that the rebuild fires and the next turn works. Record the log lines.
  2. Probe: run scripts/voice-provider-probe.sh for both providers against the deployed dev backend; paste sanitized output. The Gemini pass is the live verification that closes Gemini realtime token mint still fails after #9102 diagnostics fix #9190.
  3. One ordinary authenticated PTT turn per provider on the named bundle (the new verification bar applied to this PR itself).

Acceptance criteria

What was deliberately cut from the original epic, and why

The earlier version of this issue prescribed a 13-milestone turn funnel, terminal-outcome SLOs, capture-ready reducer states, an authenticated desktop canary suite, scheduled provider drift probes, staged incident-completion workflow, and beta/stable promotion gates. Those are cut, not deferred into hidden expectations:

  • Funnel/SLOs/dashboards/promotion gates — standing operational surface with no owner; checks whose failure has no audience are dead checks. The deploy-inline probe preserves the live-proof intent inside a lane that already has an audience.
  • Capture-ready state modeling and the full 11-case capture fault seam — demoted by the evidence-policy fix: once zero frames are neutral, the race is a one-retry annoyance, not a recovery-disarming defect. New issue if field data ever says otherwise.
  • Authenticated canary suites, rotation soak, 20-turn continuity — the existing hermetic reducer/coordinator/fuzz suites already cover lifecycle semantics; the marginal live coverage did not justify a credentialed, hardware-bound pipeline nobody owns.
  • Staged completion states — replaced by the concrete instance: Gemini realtime token mint still fails after #9102 diagnostics fix #9190 closes on live probe evidence, not code merge.

If any cut item is revived, write a fresh issue against then-current code with this issue's constraint: automatic-or-dead — every check must run in an existing CI/deploy lane.

Related issues

Activity

  1. added
    maintainer
    p1
    on Jul 14, 2026
  2. changed the title [-][P1] Make desktop voice production-proven: turn outcome SLOs, authenticated canaries, and release gates[/-] [+][P1] One PR: arm PTT dead-mic recovery correctly + prove the realtime provider path on every dev deploy[/+] on Jul 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    desktopmaintainerp1

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions