Skip to content

fix(transcription): retain failed audio and surface live STT errors - #9616

Merged
Git-on-my-level merged 3 commits into
mainfrom
codex/transcription-outcomes-9585-9586
Jul 13, 2026
Merged

Git-on-my-level merged 3 commits into
mainfrom
codex/transcription-outcomes-9585-9586

Conversation

@Git-on-my-level

@Git-on-my-level Git-on-my-level commented Jul 13, 2026 •

Copy link
Copy Markdown
Member

Summary

Closes #9585.
Closes #9586.

One deployable P0 contract covers both issues.

  • Makes prerecorded/upload and live STT outcomes typed and truthful: expected silence is distinct from upstream, timeout, configuration, and invalid-input failures; live provider terminal failures emit service_status=stt_failed and close the client session.
  • Preserves failed or partially failed sync work for client WAL recovery instead of acknowledging it as completed, including Cloud Tasks acknowledgement uncertainty, content-ledger ownership, and fenced worker leases.
  • Adds bounded outcome/dispatch telemetry, corrected enqueue-uncertainty dashboards/runbook semantics, a known-audio tagged Cloud Run candidate gate, and a recoverable legacy → standby → active ledger-fence cutover workflow.
  • Updates Flutter and macOS retry/visible-state behavior, generated app-client schema consumers, pipeline/deployment docs, and regression coverage.

Root cause and durable guard

The incident class was a collapsed outcome boundary: provider failure, empty output, and successful silence could converge on a success-looking response; downstream sync/WAL callers could then discard retry material. An asynchronous Deepgram close also did not reliably latch the live socket dead.

The durable guard is a shared bounded TranscriptionOutcome contract plus terminal-state persistence, client retry policy, live callback death latching, behavioral fault tests, and a production candidate probe that validates the exact tagged revision, route identity, expected phrase, provider, and model before any prod traffic shift.

For sync migration, the deploy contract records one immutable candidate digest and uses a phased fence cutover. It pauses admission before traffic promotion, fails closed on a mixed/partial serving state, preserves queues on failure, and makes retry recovery idempotent.

Rollout / operator contract

  • Before the first prod candidate rollout, configure the protected synthetic audio URL, bearer token, expected phrase, language, provider, and model values consumed by gcp_backend.yml; the gate deliberately fails closed if any are absent.
  • Run the manually dispatched ledger-fence cutover only with its documented readiness proof. It is a one-time operational transition, not an automatic deployment side effect.
  • [P1] Make monitoring delivery and telemetry coverage an explicit production contract #9587 remains intentionally out of scope: it owns broad monitoring-delivery verification. This PR only corrects the direct P0 sync-dispatch signal semantics.

Verification

  • cd backend && ./test.sh — passed (563 file-isolated unit test files).
  • cd backend && bash scripts/typecheck.sh — passed (0 errors).
  • backend/tests/unit/test_sync_v2.py behavioral cancellation path — passed (161 tests); it cancels a real in-flight VAD worker and verifies retry material is retained.
  • cd backend && scripts/openapi_runner.sh scripts/export_openapi.py --surface app-client --check ../docs/api-reference/app-client-openapi.json — passed.
  • cd backend && ./.venv/bin/python scripts/generate_ts_openapi_types.py --check — passed.
  • bash backend/testing/e2e/run.sh -q -k 'listen_stt or stt' — 10 passed, 2 skipped.
  • cd app && bash test.sh — passed; cd app && bash scripts/analyze_ratchet.sh — passed.
  • cd desktop/macos && xcrun swift build -c debug --package-path Desktop — passed.
  • cd desktop/macos && OMI_SWIFT_TEST_SUITE_WORKERS=4 ./scripts/swift-test-suites.sh — passed (266 isolated Swift suites); targeted LiveTranscriptionFailureStateTests, APIClientUploadLocalFilesV2Tests, and WALCloudSyncLogicTests passed (17 tests).
  • cd backend && ./.venv/bin/python scripts/validate-backend-runtime-env.py --env dev --check-rendered-cloud-run and --env prod --check-rendered-cloud-run — passed.
  • actionlint .github/workflows/gcp_backend.yml .github/workflows/gcp_backend_auto_dev.yml .github/workflows/sync_ledger_fence_cutover.yml — passed.
  • make preflight — passed against the committed diff (19 selected checks).
  • Built and launched the isolated ad-hoc /Applications/omi-p0-transcription.app; its automation bridge confirmed the expected disposable bundle ID and a live app process. It had no reusable dev auth session, so this was a launch smoke; the injected stt_failed → ready UI behavior is covered by the Swift behavioral tests above.

Product invariants affected

  • INV-AUTH-1 — APIClient.swift is touched for sync acknowledgement handling only. There is no change to session ownership, Firebase invalidation, or 401 handling.

Unify transcription outcomes across uploads, sync, and live listen sessions; retain retry material for failed and partial sync jobs; and gate production traffic on a tagged known-audio candidate probe with a recoverable ledger-fence cutover.

Verification: backend isolated tests, hermetic listen/STT tests, Flutter suite/analyzer, Swift build/targeted tests, deployment contract checks, and local preflight.
@mintlify

mintlify Bot commented Jul 13, 2026 •

Copy link
Copy Markdown

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
omi 🟢 Ready View Preview Jul 13, 2026, 7:16 AM

💡 Tip: Enable Workflows to automatically generate PRs for you.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d4252a6738

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread .github/workflows/gcp_backend.yml Resolved
Git-on-my-level and others added 2 commits July 13, 2026 04:05
Hermetic E2E was 500ing on sync admission because fake-firestore raises
KeyError when DELETE_FIELD targets absent ledger fields. Make fresh claims
sparse, no-op missing deletes in the E2E fake, allowlist the OpenAPI
duration test, and clean candidate tags on any post-deploy prod failure.

Co-authored-by: Cursor <[email protected]>
When fence-active inline admission loses the durable ledger bind, drop the
Redis run lease immediately so a higher-epoch owner is not blocked for the
full lock TTL.

Co-authored-by: Cursor <[email protected]>
@Git-on-my-level
Git-on-my-level merged commit 29e893c into main Jul 13, 2026
26 checks passed
@Git-on-my-level
Git-on-my-level deleted the codex/transcription-outcomes-9585-9586 branch July 13, 2026 08:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant