Repository navigation
fix: reconcile abandoned recording producer seals in cluster - #24105
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. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1e434ee9ae
ℹ️ 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".
|
The alert-filter P1 from the independent Grok review does not match the published bytes at 2ae1b58. I compared the checked-in log-metrics.json blob to the worktree byte-for-byte, decoded each Cloud Logging string literal, and checked all five predicates against the actual json.dumps report. Every event separator is ASCII58 (colon), not ASCII44 (comma); all five predicates match. The existing alert-filter contract also validates the value extractors, age predicate and bare-token policy and passes locally and in terminal CI at that exact head. No filter semantics need changing for this finding. The next Grok delta will receive the decoded byte evidence and reassess it alongside the mechanical main merge. The minor reused age-metric description will be clarified. |
Preserve both flag registries and regenerate the shared documentation. Clarify monitoring descriptions and CronJob deletion behavior; no sweeper logic changes.
Retain both the executor isolation paragraph and the new sweeper paragraph at their shared insertion point. The conflict resolution changes docs only; the reviewed executor, seal and alert implementation is unchanged.
#24107) Record-barrier Firestore retries currently occupy the shared DB pool used by transcript and audio webhook consumers. The 2026-10-30 custody verdict measured DB saturation at 24/24 after #24084, 121-163 session closures/hour, and roughly 10k transcript queue drops/hour. This isolates all four barrier dispatches (begin, clear, seal, failure marker) on a monitored `record_barrier` executor: 16 workers, 64 queued calls, asynchronous capacity waits. Existing pusher call sites inherit the isolation without editing `routers/pusher.py` or #24101's seal behavior. Shared DB capacity becomes 32 via `PUSHER_DB_EXECUTOR_WORKERS`; 32 supplies 12 workers of headroom above the verdict's pre-regression peak of 20, while isolation removes the new workload. The barrier worker count is tunable through `PUSHER_RECORD_BARRIER_EXECUTOR_WORKERS`. Adds `omi_executor_max_workers` so the Prometheus-backed Grafana pusher alert fires per scrape target at configured DB capacity for 10 minutes, summing all task labels. Both maintained and combined alert exports are updated. No production state has been accessed or changed; the lead must provision the alert and roll pusher in the same train as #24101. Shared executor defaults also apply to other processes importing `utils.executors`; no extra threads start until work is submitted. Validation: - Targeted `backend/test.sh` via `BACKEND_UNIT_TEST_FILE_LIST`, 4 workers, under `omi-heavy` and `nice -n 19`: executor, strict Firestore seal, pusher timeline, transcript dispatch, and monitoring contracts. - New behavioral test forbids shared DB submission during all four barrier operations and records the actual worker thread. - New real pusher session test drains transcript and audio webhook queues through DB-backed fake integrations while a fake barrier executor holds a transaction pending. - Based on #24101 merge `f436f8821b58`, preserving its returned seal-refusal handling and shutdown/ACK logic. After syncing #24105/main, targeted 15-file unit shard: 362 passed, including the strict custody and seal/ACK cases. The full 24-file monitoring selector passed 558 tests. Hermetic E2E on the combined tree: 175 passed, 3 skipped, 2 expected failures. Repository preflight: 38 checks passed; full ordinary push hooks run on each published head. The first CI run found two alert metadata requirements outside the initial local subset: a dashboard link and a current source-only GMP query inventory. Both failures reproduced locally. The correction adds the committed Pusher dashboard URL to both exports and regenerates the query inventory offline; it changes no executor or seal logic. All 24 files from the monitoring changed-file selector pass locally (558 tests), including both formerly failing contracts; the expanded 14-file functional set also passed 327 tests. Review: Luna full read-only round 1 at `9320e0eae81eb924f92ab5bb9d0890d8e3d86fb5` was **SHIP, no findings** (execution `exec-deputy-theme-bottom-donkey-butter-section`). Delta round 2 at reviewed implementation head `569982c171eb6d693e819c0771a0ccb8a3d72076` was also **SHIP, no findings** (execution `exec-endless-unfold-occur-october-leg-meadow`). Reviewers did not run tests; local validation is recorded above. Each published head passed ordinary push hooks; fresh exact-head terminal CI remains required for merge. Lead owns merge and deploy. No `.github/` edits, data changes, or flag changes. Main sync: #24105 added the sweeper paragraph at our executor paragraph's insertion point. Merge `8e35ec63a5146a153dac65cbcef7acefa286dabe` retains both paragraphs; the reviewed executor, seal and alert files are byte-identical to `569982c171eb` (which completed all 64 CI checks green). Lead ruling `5f2fd4` explicitly approves this docs-only resolution and reuse of both SHIP reviews without a third round. The synced head requires its own green CI before the lead merges. Rollback: restore prior worker env values through the normal release path for tuning; code rollback requires lead review to retain #24084/#24101 custody semantics. Failure-Class: none Failure-Class-Reason: The registry has no matching shared Firestore worker contention class; GPU batch/live scheduling and lifecycle ownership classes describe different contracts. The new consumer-isolation behavioral test guards this mechanism without changing registry/workflows in this urgent PR.
Dead pusher producers can leave upload tokens on completed recordings, holding existing record-pending jobs indefinitely. Add a separate five-minute CronJob that proves producer death from a fresh, scoped PodList and reuses the existing retained-tail repair unchanged. Discovery is capped at 128 jobs and repair attempts at 64 per run.
The worker chart owns the job and pins its existing worker image/KSA/GSA. The only new permission is namespaced pods:list. Ship on with enabled=true and mode=apply; dev/staging remain disabled because the proof is prod-namespace-only. Chart and runtime controls provide kill switches. Live or unknown producers, stale/partial inventories, read errors, upload-failed rows and bare tokens never authorize clearing. Transactions recheck exact job, row, privacy and token state; ordinary admission independently re-proves the retained tail. No jobs are synthesized or audio deleted.
One structured run summary contains counts/dispositions only. Checked-in Cloud Logging metrics and Monitoring policies cover a two-hour nonempty sampled backlog, sampled unsealed finishes over four hours, bare-token skips and missing successful cycles. Backlog counts are bounded lower bounds. Alert provisioning and delivery verification belong to the lead. The worker image adds the CPU entrypoint and locked SDK closure; the sweeper does not initialize GPU models.
Validation: 286 tests in 11 files pass through backend/test.sh with an explicit BACKEND_UNIT_TEST_FILE_LIST; the canonical backend ratchet harness passes 51 tests in six files. All 39 local preflight checks pass, full Pyright reports zero errors, and source closure passes for all 18 registered images. These gates passed again on the final merge head. A network-denied import probe loads repair without provider keys. Luna full and delta reviews say SHIP. Grok final delta review says SHIP at d4e3f83; its earlier filter punctuation finding was withdrawn after frozen-byte verification. Exact-head CI completed with 37 SUCCESS and 25 SKIPPED, no pending/failure/cancel, and CLEAN/MERGEABLE at 10:52Z. Local checks, CI and review do not establish image, cluster or notification-delivery acceptance.
Deploy: lead builds/admit the worker image from merged source, installs the worker chart and provisions monitoring with the existing agent channel. Per ruling f52d5e, observe one production mode=plan cycle before restoring apply. Verify CPU-node image startup within 240 seconds and runtime permissions. No backend/listen/pusher or Cloud Run rollout is needed. Kill: enabled=false removes the CronJob and RBAC; deleting the CronJob can cascade to owned Jobs. runtimeEnabled=false stops future Jobs; already active Jobs retain startup settings until completion/deadline or exact Job termination. Written seals persist.
Product invariants: INV-DATA-1, INV-CAP-1.
Failure-Class: none
This adds the missing recurring host for an existing digest/state-fenced operator repair. Existing durable-terminal-projection and obligation-retirement classes concern different terminal transitions; no failure registry definition changes. No .github or production resources are changed by this PR.