Skip to content

fix(episodes): a finished live recording no longer waits without limit for its notes - #25380

Merged
Git-on-my-level merged 12 commits into
BasedHardware:mainfrom
Git-on-my-level:lane/q12-live-notes
Nov 15, 2026
Merged

Git-on-my-level merged 12 commits into
BasedHardware:mainfrom
Git-on-my-level:lane/q12-live-notes

Conversation

@Git-on-my-level

@Git-on-my-level Git-on-my-level commented Nov 15, 2026 •

Copy link
Copy Markdown
Member

A finished non-batch pendant recording can wait forever for its live episode owner even when the owner has been idle past the close gap. Reuse Home's activity-fenced idle close on durable member retries; after 180 seconds of job age, admit one member-note attempt per finalization/content revision while preserving episode grouping. Other sources and batch_live_v1 stay on the original gate.

Failure-Class: none

Tuning and paid-work budget

LIVE_MEMBER_NOTES_MAX_DEFERRAL_SECONDS is new: 180 seconds. Before: no finite ownership age cap (0 age exits); after: eligibility at 180 seconds since finalization job creation, observed at the next existing worker delivery. The existing 1,800-second occasion grouping window and default 300-second reconciliation interval are unchanged. In the ro-prod evidence linked by the quality run, 23 of the original 34 Japanese deferrals were still stuck after about one hour. Three minutes permits ordinary settlement while avoiding that unbounded wait. This does not meet five minutes from last speech: Japanese/English job creation p50 was about 30 minutes after speech.

The age path applies only to a finished source=omi, non-batch member whose owner remains live after the idle-close attempt, when a finalization retry arrives at least 180 seconds after job creation. At most one additional logical notes-model run per member revision: about 641 measured marker records/day implies at most 641 extra runs/day, roughly US $2.70/day at the fleet mean token estimate of $0.00421338/run. The 47 currently stuck rows imply at most 47 catch-up runs, roughly US $0.20. Optional agent tool/repair model turns are included in that logical-run estimate. These are measured-volume estimates rather than a vendor-spend cap; newer revisions have a separate revision budget. The broader 14,493-record non-batch population does not describe this age-path cohort. Evidence: workspace data/run-2026-11-15-quality-12h/Q12-Q-cost-scope.json and Q12-Q-model-stage-metrics.json.

State and rollback

live_member_notes_fallback_revision is a consumed paid-attempt permit, fenced by job identity, lease epoch/generation and content/finalization revision. Retries and concurrent finalizers cannot buy that same fallback twice. Its terminal/exit path is persisted completion, a newer revision, ordinary processing after owner closure, or explicit recording-detail/user reprocess. An aged finalizer defers without calling the model or consuming a permit when a detail lease owns the obligation, or when the owner snapshot cannot be read. A crash after consumption can leave this extra attempt uncertain; it is not automatically purchased again while the same owner is live.

HOME_LIVE_MEMBER_NOTES_BOUNDED_ENABLED defaults on, bound on all five requested finalization hosts plus the cohost pusher in dev and prod. Set off to restore main's original gate and make permit metadata inert. HOME_LIVE_MEMBER_NOTES_DEFERRED_ENABLED remains unchanged. No startup scan, historical recompose, new jobstore read API, grouping change, or composer edit. Required eventual deployment: backend, backend-sync, backend-sync-backfill, backend-integration backend-listen and pusher. The pusher binding preserves the enforced cohost env contract and covers its finalizer entrypoint.

Product invariants affected

  • INV-MEM-4: the notes admission guard preserves canonical memory promotion and derived-effect fences.
  • INV-TASK-2: the existing source-specific task policy stays unchanged; this guard adds no task writer or auto-accept path.

Verification

The original idle-owner and age-bound regressions fail against the original member-note gate. Both final-round regressions (detail lease present and owner read failure) fail before the admission fixes and pass afterward; neither reaches the model or consumes a permit. The new main playback-metadata timeout test now raises TimeoutError from a scoped Future.result stub instead of setting a 1 ms real-clock budget; the production timeout and running-work reservation semantics are preserved. Focused unit tests enforce a 0.25-second call-phase CPU guard. Real loopback Firestore contention verifies exactly one admitted paid attempt per revision under concurrent finalizers and lease retries. Affected suites, cross-service contract, canonical typecheck and installed pre-push hook results are recorded in the final lane handoff. No live acceptance, push, PR, deploy or production mutation is claimed.

Line-Count-Exception: backend/utils/conversations/process_conversation.py | 3413 -> 3414 | Keep the single pre-model admission call beside the existing notes invocation and preserve scheduling exceptions.

Prepared: 2026-11-15T08:25:25Z

One independent review round (GPT-6 Luna, head 179116c): one blocker (paid-once permit could be bypassed when a recording-detail lease held the obligation; owner-read failure failed open), fixed in this head with a failing-first test for each. This head also makes tests/unit/test_sync_playback_metadata.py expire deterministically, which repairs the real-clock ratchet left red on main by #25352.

Author model: GPT-6.1 Sol; integrated by Claude Fable 5.2.

🤖 Generated with Claude Code

View guided diff

Git-on-my-level and others added 12 commits November 15, 2026 13:52
Failure-Class: none

Co-Authored-By: Claude Fable 5.2 <[email protected]>
Failure-Class: none

Co-Authored-By: Claude Fable 5.2 <[email protected]>
Failure-Class: none

Co-Authored-By: Claude Fable 5.2 <[email protected]>
Failure-Class: none

Co-Authored-By: Claude Fable 5.2 <[email protected]>
Failure-Class: none

Co-Authored-By: Claude Fable 5.2 <[email protected]>
Defer aged finalizers while a detail lease owns notes or the owner snapshot is unavailable. Preserve the per-revision paid permit and main flag inventory format.

Failure-Class: none

Co-Authored-By: Claude Fable 5.2 <[email protected]>
Replace the new main test's 1 ms wall-clock wait with a Future result stub that raises TimeoutError, preserving the running single-flight reservation assertion.

Failure-Class: none

Co-Authored-By: Claude Fable 5.2 <[email protected]>
…ndings

Failure-Class: none

Co-Authored-By: Claude Fable 5.2 <[email protected]>
Deferring whenever the owner snapshot read failed stalled recovery finalizations for as long
as the read kept failing (tests/unit/test_recovery_discard_pipeline.py caught it), which
recreates the unbounded wait this change removes. The finalizer now proceeds as main does,
without consuming the aged permit, and records the fallback. The detail-lease case still
defers.

Failure-Class: none

Co-Authored-By: Claude Fable 5.2 <[email protected]>
Git-on-my-level added a commit that referenced this pull request Nov 15, 2026
…-clock ratchet red on main) (#25383)

One test added by #25352 hands production code a 0.001-second real-clock
budget, which the slow-marked real-clock ratchet forbids; that guard has
been red on main since #25352 merged. This makes the test's timeout
deterministic. Test-only.

Failure-Class: none

## What changed


`tests/unit/test_sync_playback_metadata.py::test_single_flight_and_user_process_bounds_keep_running_timeout_reserved`
no longer sets `OPEN_TIMEOUT_SECONDS` to 0.001 s; it simulates the
Future timeout deterministically and still asserts that a running repair
keeps its single-flight, per-user and per-process reservations while the
caller is told to poll. The ratchet and its allowlist are unchanged. No
production code changes.

## Verification

`tests/unit/test_real_clock_budget_ratchet.py`,
`tests/unit/test_sync_playback_metadata.py` and
`tests/unit/test_llm_gateway_coverage_guardrails.py` with slow tests
selected: 44 passed on this head (main b78ea01 plus this commit).

The same commit is also carried by #25380; whichever merges first makes
the other a no-op for this file.

Rollback: revert this commit.

Author model: GPT-6.1 Sol; integrated by Claude Fable 5.2.

🤖 Generated with [Claude Code](https://claude.com/claude-code)


<!-- This is an auto-generated description by cubic. -->
<a
href="https://cubic.dev/pr/BasedHardware/omi/pull/25383?utm_source=github"
target="_blank" rel="noopener noreferrer"
data-no-image-dialog="true"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"><source
media="(prefers-color-scheme: light)"
srcset="https://www.cubic.dev/buttons/review-in-cubic-light.svg"><img
alt="View guided diff"
src="https://www.cubic.dev/buttons/review-in-cubic-light.svg"></picture></a>
<!-- End of auto-generated description by cubic. -->
@Git-on-my-level
Git-on-my-level merged commit 6ed88ea into BasedHardware:main Nov 15, 2026
53 of 55 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant