Repository navigation
fix(episodes): keep memo optimizations safe across async and repair paths (#24582 follow-up) - #24604
Merged
Merged
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Git-on-my-level
added a commit
that referenced
this pull request
Nov 4, 2026
) <!-- claude-projects-attribution: {"github_login":"Git-on-my-level"} --> _Requested by **David**_ Batch captures previously stayed outside episodes until transcription finished. Audio close now attaches retained captures by committed audio bounds before queueing finalization, through the shared fenced recorded-time membership transaction. Arrival and processing clocks never select the episode or change its live pointer. The membership transaction stamps a fixed pending-transcription entry time and two-hour deadline. Replays preserve the deadline. Home shows “Transcribing…” while awaiting the durable batch projection; a dead letter, failed upload/status or elapsed deadline shows “Couldn't transcribe” with the committed audio finish time. A later successful projection restores ordinary member metadata. Audio and retry work remain retained. `EPISODE_BATCH_CLOSE_ATTACH_ENABLED` defaults on. Setting it to false/off/0/no restores attach-after-transcription. Episode/cohort, privacy, custom-STT, retention, lock, deletion and donor guards remain authoritative. Attachment adds no model calls and does not require a client-seen marker. Failure emits shared degraded-fallback telemetry and leaves finalization as the repair path. The overdue metric is an unlabeled read-observation counter; the info alert remains in the pending catalog, with no monitoring provisioning in this PR. Refreshed with merge commits through main `563e6c240944` (#24577, #24579, #24582/#24604 and subsequent main changes, including #24509). The resolution keeps batch 1's shared transaction/fence, attempt-local candidate reuse, current canonical partition proof, visibility validation, deduplicated memberships and recovery memo. Pending close writes its deadline inside that transaction without claiming/resetting completed transcript recovery. Close replay validates current committed archive bounds, normalized through the same datetime conversion used at admission, and is a true no-op with attach optimizations on or off. Changed bounds still update the episode without renewing the deadline. Composer settling, foreground promotion, Home read cuts and recording-speaker carry remain intact. The five original conflicts were in `episode_recorded_components.py`, `episode_timeline.py`, `service.py`, the Firestore query-driver registry and the generated feature-flag catalog. The sync callback and affected tests now use the public `attach_recorded` helper. The final speaker-tip merge was clean; the core episode resolution is unchanged. Validation at `817784dced26`: **858 passed across 21 focused backend files** through `backend/test.sh` with an explicit file list and four workers; **4 real Firestore emulator replay cases passed**, covering integer/fractional archive epochs and attach optimizations on/off. All tests/build gates run through `omi-heavy` at low priority, with no production credentials. Emulator limitation: the full 28-case episode suite alternated SDK transaction-lock timeouts between two old concurrency cases. Its last full run was **27 passed / 1 failed**, not all green. Both concurrency cases then passed together in a targeted run on exact main `cf601889c67b` and exact candidate `b8633977345c`. All 28 cases have passing candidate executions across full plus targeted runs; this does not establish a cause for the intermittent timeout. Core episode/emulator source is byte-identical after the final main merge, and the four new replay cases were rerun on the final head. Firestore clients now close at fixture teardown; test concurrency and transaction retry budgets are unchanged. Final hermetic e2e at `817784dced26`: **205 passed, 3 skipped, 2 xfailed in 101.14s**, within the unchanged **120s** limit. Native-library threads were capped at one; `--disable-warnings` suppressed only the console warning summary, without filtering warnings or changing warning assertions. Two earlier final-head attempts reached the wall limit (one at 100% test progress while rendering warnings). The lead authorized a documented 300s diagnostic if necessary, but it was **not used**. Committed and remote-CI budgets remain 120s. `make preflight` passed **43/43** before the final clean main merge; the normal push hook runs the final required gates again. Failure-Class: FC-finalize-hook-allowlist-omits-ingestion-path Product invariants: INV-MEM-4 and INV-TASK-2. Canonical episode ownership and task/enrichment authority remain unchanged. No PR merge, deploy, production account access or GCP calls. GCP tier: none. No rebase, force-push, workflow additions or firmware edits. The lead owns merge and the backend/listen release train. UI-Evidence: none -- backend response projection; related mobile fixture evidence belongs to #24541.
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.
Follow-up to #24582 (squash-merged at 93d8c89 before this round landed). This is a cherry-pick of the episodes fix lane's unpushed commit
02372e29c75f, which fixes 4 safety issues the review follow-up found after the published head:live.on_realtime_segmentsawaits the DB executor around the scheduler, so a blocking Firestore call no longer runs on the event loop.noop_schedule_enabled.memo.completecatches stamp failures and falls back to the old path instead of failing.EPISODE_ATTACH_OPTIMIZATIONS_ENABLEDstill restores the old paths.17 files, +184/−31. The cherry-pick onto main was clean apart from an auto-merge in
tests/unit/test_sync_reprocess_coalesce.py.Authorization: David, 2026-11-04 ~12:55Z, in chat: skip pre-push and CI to ship ASAP.
Verification
bin/omi-heavy run -- pytest): episode_attach_cost, episode_attach_review, episodes_finalizer_hook, late_audio_recorded_time, sync_intake_content_shadow, sync_reprocess_coalesce. Result: 227 passed.🤖 Generated with Claude Code