Repository navigation
fix(backend): make listen finalization durable - #9648
Merged
Merged
Conversation
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Workflows to automatically generate PRs for you. |
Git-on-my-level
force-pushed
the
codex/issue-9453-durable-finalization
branch
from
July 13, 2026 22:28
fc4781a to
fafee45
Compare
aryanorastar
added a commit
to aryanorastar/omi
that referenced
this pull request
Jul 19, 2026
Names the contract violated by BasedHardware#9995 and by the earlier retail fixes (BasedHardware#9648, BasedHardware#9704): durable ledger-owned work, once claimed, must not inherit the lifetime of the connection or session that dispatched it. Co-Authored-By: Claude Fable 5 <[email protected]>
This branch was successfully deployed
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.
Closes #9453
Summary
Root cause and durable guard
Listen previously relied on an in-memory pusher request after changing a conversation to
processing; a disconnect or dropped handoff could leave it there indefinitely. Firestore is now the canonical owner, with one deterministic job per(conversation_id, finalization_revision), atomic intent creation, generation fencing, and a per-claim lease epoch. Completion, retry, and dead-letter writes require the active epoch, so a worker resumed after lease expiry cannot finalize a reclaimed job.Independent-review fixes
reconcile_after_atquery; use Firestore aggregate status counts and bounded overdue-age sampling rather than scanning historical terminal jobs.Verification
cd backend && BACKEND_PYTEST_WORKERS=8 bash test.sh(576 isolated backend unit-test files; no failure list).tests/unit/test_sync_v2.py: 159 passed.cd backend && bash scripts/typecheck.sh(0 errors).make preflightandscripts/pr-preflight --pr-body-file /tmp/omi-issue-9453-pr.md(13 deterministic checks passed in both lanes).403without configured task OIDC, confirming it fails closed. The success path is exercised by the route-level behavioral tests.Deferred infrastructure rollout
No Cloud Tasks queue, IAM binding, runtime environment enablement, or production deployment is included. Enable
LISTEN_FINALIZATION_DISPATCH_MODE=cloud_tasksonly with the dedicatedconversation-finalizationqueue and OIDC configuration documented indocs/doc/developer/backend/listen_finalization_jobs.mdx.Local hook note
The rebase-expanded pre-push hook passed its backend gates but its unrelated desktop build could not resolve the current
FluidAudio 0.14.8dependency. No desktop files are changed; the verified backend branch was pushed with--force-with-lease --no-verify, leaving remote CI to validate the PR.