Repository navigation
fix(transcription): retain failed audio and surface live STT errors - #9616
Merged
Merged
Conversation
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.
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Workflows to automatically generate PRs for you. |
There was a problem hiding this comment.
💡 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".
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]>
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 #9585.
Closes #9586.
One deployable P0 contract covers both issues.
service_status=stt_failedand close the client session.legacy → standby → activeledger-fence cutover workflow.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
TranscriptionOutcomecontract 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
gcp_backend.yml; the gate deliberately fails closed if any are absent.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.pybehavioral 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); targetedLiveTranscriptionFailureStateTests,APIClientUploadLocalFilesV2Tests, andWALCloudSyncLogicTestspassed (17 tests).cd backend && ./.venv/bin/python scripts/validate-backend-runtime-env.py --env dev --check-rendered-cloud-runand--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)./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 injectedstt_failed → readyUI behavior is covered by the Swift behavioral tests above.Product invariants affected
APIClient.swiftis touched for sync acknowledgement handling only. There is no change to session ownership, Firebase invalidation, or 401 handling.