Skip to content

fix(conversations): isolate first summaries from transcription stalls - #22172

Merged
Git-on-my-level merged 6 commits into
mainfrom
lane/sol-summary-stall
Oct 18, 2026
Merged

Git-on-my-level merged 6 commits into
mainfrom
lane/sol-summary-stall

Conversation

@Git-on-my-level

@Git-on-my-level Git-on-my-level commented Oct 18, 2026 •

Copy link
Copy Markdown
Member

Summary enrichment shared the sixteen-thread sync executor with long transcription jobs. Production warnings in the same six-hour latency window show fresh sync at 100% utilization with up to 52 queued calls and backfill with up to 15. An on-time Cloud Tasks wake and faster batch projection still wait in that pool. Route enrichment through the existing conversation post-processing pool on both HTTP adapters, under the existing first-summary master kill switch. No pool, instance or queue capacity is increased.

Completed conversations can also contain only a server minimum, but the finalizer skipped all completed rows and the summary-debt sweep correctly refused finalization-owned generations. Let the already admitted finalizer finish its own eligible minimum under its original lease and retry/fanout fences. Require its current job binding; rich summaries, manual edits, deletion/discard, privacy/local-only and exhausted rows remain excluded.

The production first-summary policy was also restricted to an allowlist and absent on live processing hosts. Enable its existing 120-second first-dispatch/lease policy across all six production producers/workers, with matching Helm settings, and enable the existing bounded debt sweep on scheduled backend-sync. Existing master and repair flags remain kill switches. Later revisions/effects keep their coalescing behavior. The sweep is capped at 100 scan reads and ten admission attempts per two-minute tick (documented worst case 182 document reads/tick including its transaction reads).

Investigation correction: the twelve initially suspected queued-but-not-accepted rows already have summaries and terminal-success jobs; the conversation's queued admission projection is stale. A separate observed extreme waited about 130 minutes before its finalization job was created, then summarized in about six seconds. Add a post-speech histogram using the later of acceptance and persisted last-speech time to separate open-speech overlap from the existing acceptance metric. This does not force a recording to close or promise provider completion in 120 seconds.

Validation:

  • Isolated serving, finalization, summary and production-policy files: 26 + 278 + 18 + 18 + 1 + 11 passed. Includes a real saturated transcription executor, both adapters' pool rollback, and replaced/unbound job rejection.
  • Isolated reprocess: 88 passed; persistence: 9 passed.
  • Loopback-only Firestore emulator debt-repair proofs: 21 passed (crash/lost enqueue ACK, active/expired/replaced leases, BYOK/privacy/manual/generation fences).
  • Hermetic pre-deploy checks: 320 passed; manifest composition and Helm parity checked.
  • Final bounded pre-push: 45 contract checks passed, type-checking had zero errors, and all 352 focused tests passed the canonical test.sh CPU-duration guard. Exact-head CI on b046fc7 is GREEN: 34 passed and 22 skipped checks, zero pending/failed. All six backend shards, backend guardrails, hermetic merge gate/E2E, listen-pusher gauntlet, static contracts and CodeQL passed.

No production writes, index changes, repair, deployment or merge. Do not repair the twelve already summarized rows. Historical unmarked minima require a separately reviewed provenance inventory. Rollback: repair flag false stops the scan; master deadline flag false on all hosts restores the prior executor and scheduling/processing policy. A percentage rollback to zero retains the existing allowlist/admitted-debt semantics.

INV-MEM-4: canonical memory admission and promotion authority are unchanged; summary work continues through the existing fenced processing path.

Failure-Class: FC-rollout-flag-absent-from-a-cohost-of-its-code-path

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 18, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-18T16:37:36.451150Z 6db2c16 New commits
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6db2c162b2

ℹ️ 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".

Comment on lines +29 to +33
CLOSED_LATENCY = Histogram(
'omi_closed_to_summary_seconds',
'First durable summary after both server acceptance and last speech',
['lane'],
buckets=(30, 60, 120, 180, 300, 600, 1800, 3600, 14400),

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Add the close-latency metric to the Cloud Run allowlist

On backend-sync, backend-sync-backfill, and backend-integration, the collector applies the keep regex in backend/deploy/cloud_run_gmp_sync.yaml:22, which includes omi_accept_to_summary_seconds* but not this new omi_closed_to_summary_seconds* family. Consequently, all fresh, backfill, and integration samples emitted here are dropped before ingestion, making the new production latency signal incomplete and potentially misleading; add the histogram family to that allowlist and its sidecar coverage test.

Useful? React with 👍 / 👎.

Comment on lines +238 to +240
if conversation.status != ConversationStatus.completed or finalization_pending(
conversation_data, uid, finalization_job_id
):

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Terminalize completed minima when retries are exhausted

When this newly admitted completed-minimum path repeatedly fails because the summary provider is unavailable or returns unusable output, the final attempt dead-letters the job through mark_finalization_dead_letter; however, that transaction updates the conversation only when its status is processing (backend/database/conversation_finalization_jobs.py:1197-1205). This row is already completed, so it retains its finalization_job_id, receives no summary_retryable marker, and summary_delivery.refusal() permanently rejects debt repair as generation_owned. Ensure exhausted retries clear or terminalize summary ownership for this completed-row case so the user is not left permanently on the server minimum.

Useful? React with 👍 / 👎.

@Git-on-my-level
Git-on-my-level merged commit d6b7032 into main Oct 18, 2026
57 checks passed
@Git-on-my-level
Git-on-my-level deleted the lane/sol-summary-stall branch October 18, 2026 16:42
Git-on-my-level added a commit that referenced this pull request Oct 21, 2026
… env in prod manifest (#22978)

## Summary
Two toil killers from the two-lane rollout (P12, `toil-killers`).

**1. Pre-push: skip the duplicated local suite for CI-green exact
SHAs.** Fast-forwarding a branch to a SHA that GitHub CI already
certified re-ran the whole local pre-push suite against an unchanged
tree. That cost about 55 minutes on sync 14 and again on sync 15.
`scripts/pre-push` now calls `scripts/pre_push_ci_verified.py` right
after reading the pushed refs, and exits early only when **every**
pushed SHA meets all of these:
- GitHub returns that exact commit, and its tree equals the local tree.
- At least one `push` or `merge_group` run on that SHA concluded
`success`. Those are the only runs that check out the commit itself. A
`pull_request` run tests the PR merge ref, whose tree differs whenever
the branch is behind main.
- Every `push`, `merge_group`, `pull_request` and default-CodeQL
(`dynamic`) run on it is terminal and concluded `success` or `skipped`.
`pull_request_target` runs, which check out the base, are ignored.
- If it has any commit statuses, their combined state is `success`.

In practice the skip applies to fast-forwards onto a main commit whose
push CI has settled. A PR head that only has `pull_request` runs always
runs the full suite.

Deployment writers (the `LOCK_CONTRACTS` registry in
`check-deployment-concurrency.py`, fetched from the push remote's `main`
on GitHub, never from a local file or ref) neither certify nor block. On
main they sit parked behind their lock or get cancelled by a newer push,
and that says nothing about the commit.

This is **not a skip hatch.** The check reads no environment variable.
It fails closed on any error, timeout, unknown SHA, non-GitHub remote or
unparseable answer, and then the full suite runs. Every verdict is
printed and appended to `<git-common-dir>/omi-pre-push-ci-verified.log`.
The hook lives in `scripts/`; nothing under `.github/workflows` changes.
The new test goes in `.github/scripts/`, registered in
`.github/checks-manifest.yaml`, next to its sibling
`test_pre_push_ci_prediction.py`.

**2. Ops-env drift after every Cloud Run train.** The prod overlay
pinned old values for keys the lead hand-sets live, so every train reset
them and they were restored by hand. The train logs (`ops_env.py restore
… drifted:`) and a `ro-prod` read of the live services agree on the set.
The overlay now records today's live values (values only, no secrets, no
allowlists):

| key | service(s) | was in manifest | live / now |
| --- | --- | --- | --- |
| `BATCH_PIPELINE_SPEECH_EMPTY_MULTILINGUAL_ENABLED` | backend,
backend-sync, backend-sync-backfill | false | **true** (integration was
already true) |
| `SUMMARY_DEBT_REPAIR_ENABLED` | backend-sync | true | **false** |
| `BATCH_PIPELINE_RECOVERY_ALL_ADMITTED` | backend-integration | false |
**true** |

After the change, a `ro-prod` diff of live env against the regenerated
manifest shows no remaining value differences for the ops prefixes
`ops_env.py` covers. Live-only keys (allowlists,
`FIRST_SUMMARY_DEADLINE_SECONDS`, `SYNC_ASSIGNMENT_RECOVERY_ENABLED`)
are not in the manifest, so deploys preserve them. They were never reset
and are left alone.

The deploy-time assertion lives in `render_backend_runtime_env.py`,
which the deploy action already runs before every Cloud Run deploy.
Before emitting any output, it parses each service's and job's rendered
`env_vars` text back through deploy-cloudrun's escape grammar. It fails
the deploy if a manifest key is missing, duplicated or changed, or if it
is also named in that service's `--remove-env-vars` set. Unset
provisional keys keep their documented preserve-live omission.

`test_summary_production_policy.py` pinned
`SUMMARY_DEBT_REPAIR_ENABLED=true` (#22172). It now pins the live
`false`, with a comment. The rollout lead was notified on the bus before
merge.

## Lane / contract
P12 `toil-killers` (two-lane rollout swarm). Owner sign-offs for edits
to other lanes' files: none.

## Product invariants affected
- INV-MEM-4: path match only. `backend/deploy/runtime_env*` is the
production runtime manifest; no memory admission behaviour changes.

## Verification
- `.github/scripts/test_pre_push_ci_verified.py`: 25 tests pass, at two
layers. Unit tests cover green, unknown, red, neutral, in-progress,
pull_request-blocks-but-never-certifies, CodeQL dynamic,
pull_request_target, wrong commit payload, deploy-writer, unreadable
registry, tree-mismatch, commit-status, multi-SHA, unreachable and
unexpected-error verdicts. Hook-level tests run the real
`scripts/pre-push` in a fixture repo with a fake `gh`: a green exact SHA
ends the hook before check selection; unknown, red and unreachable reach
the full suite; env vars cannot force the skip.
- Live, read-only `gh api` against BasedHardware/omi:
- `e6877adc9f06` (settled main head): verified, 8 successful push runs,
tree matches, about 4s.
- The current main head `34b3396cc208`: not verified while its CodeQL
`dynamic` run is still queued.
  - `origin/main~6`: not verified, because `Repo Checks` was cancelled.
  - An older SHA: not verified, no CI run on that exact SHA.
- Backend: 49 runtime-manifest, renderer and registry test files through
`backend/test.sh` (`nice -n 19`, `omi-heavy`). All pass, including 7 new
renderer tests: every dev/prod Cloud Run service and job renders every
manifest key, escape round-trip, missing / changed / duplicated / stray
/ removed keys fail, provisional omission allowed, and a full `--env
prod` render emits nothing on failure.
- `compose_runtime_env.py` and `render_feature_flag_registry.py` were
regenerated. PR preflight passed.
- Not run: the full backend suite (the selector widens to 2,092 files
for overlay changes; CI runs it), and a real deploy (out of scope; the
lead trains it).

## Review response (Grok, FIX-FIRST on `e9a6ab2b`)
- **Blocker, `pull_request`/`pull_request_target` certify a tree they
did not run.** Fixed: only `push`/`merge_group` successes certify.
`pull_request` blocks, `pull_request_target` is ignored, and `neutral`
is no longer green.
- **Blocker, red CodeQL (`dynamic`) did not block.** Fixed: a `dynamic`
run blocks when non-terminal or red, and never certifies.
- **Major, `PRE_PUSH_BASE_*` could widen the ignore set.** Fixed: the
registry is fetched from GitHub `main` via `gh api …/contents`. On any
failure it is empty, so deploy runs are judged as CI. `--registry-ref`
is gone. The commit payload must now also carry the requested SHA.
- **Minor, the job removal set was only `forbidden_env`.** Fixed: job
renders also pass their own `--remove-env-vars` flag. **Not done:**
moving `gcp_notifications_job.yml`'s hardcoded removal list onto the
job's manifest flags, because it needs a `.github/workflows` edit, which
David must name. No key in that list is in the notifications job env
today. `desktop_backend` stays outside the assertion; its env keys don't
intersect its workflow's removal list today.
- **Minor, docs said debt repair is on in prod.** Fixed:
`config/feature-flags.yaml` summary (registry regenerated),
`runbooks/summary-guarantee.md` and `listen_pusher_pipeline.mdx` now say
it is held off (deferred 2026-10-20).

## Rollback
Revert the PR. For the pre-push skip alone, revert `scripts/pre-push`'s
new block. For one ops value, flip it in
`backend/deploy/runtime_env/prod.overlay.yaml` and regenerate.

Failure-Class: none

🤖 Generated with [Claude Code](https://claude.com/claude-code)
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