Skip to content

fix(backend): make the meeting Chat receipt a durable reconciled projection - #11888

Merged
Git-on-my-level merged 2 commits into
mainfrom
agent/m4-air-codex-sol/meeting-receipt-unification
Aug 20, 2026
Merged

Git-on-my-level merged 2 commits into
mainfrom
agent/m4-air-codex-sol/meeting-receipt-unification

Conversation

@Git-on-my-level

@Git-on-my-level Git-on-my-level commented Aug 19, 2026 •

Copy link
Copy Markdown
Member

The incident

A 28m40s Google Meet call on 2026-08-19 (06542b24-ddfe-5dfb-810a-4c57ff407b98, 15:00:52–15:29:32 UTC) produced a correct summary but no meeting-notes card in Chat.

Everything upstream of the receipt worked, and this was measured rather than assumed:

  • Local transcription_sessions shows the ambient session closing on meeting_started at 15:00:52, a conversationRole=meeting session running to 15:29:32, closing on meeting_ended, strategy local_segments.
  • The backend record carries conversation_role=meeting, conversation_finalization_reason=meeting_ended, source=desktop, status=completed.
  • is_meeting_treatment_eligible against the real record returns True: duration_s=1720.0 (needs ≥300), dedup_speech_s=1719.8 (needs ≥60).
  • The notes exist and are good.

Chat received only a notification-journal row, not a conversationLink receipt. Two earlier meetings the same day did get receipts — and both were 1m24s and 1m52s, i.e. below the ≥5 min bar, so the behaviour had inverted.

Which link dropped the receipt is not determinable from the data. That is the defect this PR addresses.

Why it happened

Meeting-treatment eligibility was recomputed at five call sites, against four different in-memory snapshots, at four different lifecycle moments, and the verdict was never persisted:

  • routers/developer.py (×2), utils/conversations/process_conversation.py, utils/conversations/finalizer.py, utils/task_intelligence/proactive_engine.py

#11836 was already one bug in exactly that seam — a snapshot that answered before finalization and therefore carried the default false. It fixed one caller. This is the next instance, and production could not attribute it either.

The change

Compute the verdict once, persist it with its inputs, and reconcile the receipt instead of emitting it as a one-shot event.

  • conversation_finalization_jobs becomes the durable receipt authority — no competing collection. The five call sites read the stored verdict.
  • One shared post-finalization receipt service covers both the cloud path and the local-segments (from-segments) path, so the receipt is written exactly once for either.
  • Intent persistence is distinguished from kernel materialization — the seam the receipt exists to close.
  • Reconciliation rides the existing five-minute finalization sweep; eligible-and-unmaterialized receipts are re-driven, idempotent through the existing capture:{conversation_id} continuity key. This also covers a v1 client, which deliberately leaves conversationLink intents pending and previously had nothing to retry it.
  • The obsolete persist_desktop_meeting_arrival adapter is removed. Its test now proves the end-to-end contract: one eligible meeting yields exactly one conversationLink receipt; ambient and rotation yield none.

Rollout

MEETING_RECEIPT_RECONCILER_ENABLED defaults false, declared on both backend-listen and the Cloud Run backend service — they co-host this code path via POST /v1/conversations/{id}/reprocess. Declaring it on only one would give a v2 receipt on capture and a legacy path on regenerate, which reads as nondeterminism rather than a config gap.

Tests

Per-file, all green (211 total across the touched suites):

suite result
test_meeting_treatment.py 10 passed
test_meeting_receipt_runtime_flag.py 1 passed
test_conversation_finalization_jobs.py 47 passed
test_conversation_finalization.py 9 passed
test_chat_first_proactive_engine.py 17 passed
test_chat_first_proactive_router.py 8 passed
test_chat_first_blocks.py 11 passed
test_developer_from_segments_idempotency.py 17 passed
test_listen_finalization_cloud_tasks.py 90 passed
test_stale_processing_periodic_scheduling.py 1 passed

There is pre-existing test-order pollution in the chat-first suites: base 091a65bef4 fails 14 tests when those files are run in one process. On this branch that combined run fails 0.

Deliberately out of scope

Client-side simplification (the desktop should stop gating Chat arrival at all) and the duplicate local session rows — every meeting currently has a shadow ambient row sharing its backendId. Also the two detection workstreams (tier-2 mic detection, idle rotation): those are detection problems and this is a delivery problem, and the project already ruled telemetry-first on one and "must not become a second rotation authority" on the other.

Failure-Class: FC-durable-terminal-projection

Line-Count-Exception: backend/database/conversation_finalization_jobs.py | 1403 -> 1729 | The receipt is deliberately stored on the finalization job rather than in a competing collection, so the durable verdict, its reason, its measured inputs, and the reconciliation query belong to this module's existing transactional ownership. Splitting it would separate the receipt from the transaction that makes it authoritative, which is the property the change exists to establish.
Line-Count-Exception: backend/routers/developer.py | 2115 -> 2126 | +11 lines routing the from-segments path through the shared receipt service so the cloud and local-segments paths write exactly one receipt. No new responsibility is added to this router; the recomputation it previously did is removed.

Review in cubic

@mintlify

mintlify Bot commented Aug 19, 2026 •

Copy link
Copy Markdown

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
omi 🟢 Ready View Preview Aug 19, 2026, 9:25 PM

💡 Tip: Enable Workflows to automatically generate PRs for you.

Git-on-my-level and others added 2 commits August 20, 2026 01:03
…ection

A 28m40s Google Meet call produced a correct summary but no meeting-notes card
in Chat. Detection, rotation and finalization all worked: the conversation
carries conversation_role=meeting, conversation_finalization_reason=meeting_ended,
and is_meeting_treatment_eligible returns True against the real record
(duration 1720s, deduplicated speech 1719.8s). The receipt simply never arrived,
and nothing in the system recorded why.

The cause is structural rather than a single bad line. Meeting-treatment
eligibility was recomputed at five call sites, against four different in-memory
snapshots, at four different lifecycle moments, and the verdict was never
persisted. #11836 was already one bug in that seam - a snapshot that answered
before finalization and returned the default false. It fixed one caller. This
was the next instance, and production could not attribute it either.

Record the verdict once on the durable finalization job, with its reason and its
measured inputs, and reconcile the receipt instead of emitting it as a one-shot
event:

- conversation_finalization_jobs becomes the receipt authority; the five call
  sites read the stored verdict rather than recomputing it.
- One shared post-finalization receipt service covers both the cloud path and
  the local-segments (from-segments) path, so the receipt is written exactly
  once for either.
- Intent persistence is distinguished from kernel materialization, which is the
  seam the receipt exists to close.
- Reconciliation rides the existing five-minute finalization sweep - eligible
  and unmaterialized receipts are re-driven, idempotent through the existing
  capture:{conversation_id} continuity key. This also covers a v1 client, which
  deliberately leaves conversationLink intents pending and previously had
  nothing to retry it.
- The obsolete persist_desktop_meeting_arrival adapter is removed; its test now
  proves the end-to-end contract instead - one eligible meeting yields exactly
  one conversationLink receipt, while ambient and rotation yield none.

MEETING_RECEIPT_RECONCILER_ENABLED defaults false and is declared on both
backend-listen and the Cloud Run backend service, which co-host this code path
via POST /v1/conversations/{id}/reprocess.

Client-side simplification and the duplicate local session rows are deliberately
left as follow-ups, as are the separate detection workstreams (tier-2 mic
detection, idle rotation) - those are detection problems and this is a delivery
problem.

Failure-Class: FC-durable-terminal-projection

Co-Authored-By: Claude Opus 5 <[email protected]>
…e and flag

CI surfaced two lists that did not learn about this change.

The conversation-events and conversation-search suites stub their dependencies
through a hand-maintained dict of module names. routers/conversations.py now
imports utils.conversations.meeting_receipt, which was absent from that dict, so
both suites failed at collection with ModuleNotFoundError rather than any
behavioural error. This is the drift FC-hand-listed-test-isolation-membership
describes: omission is not an opt-out.

The runtime-env validator builds a synthetic Cloud Run state to assert against
the real manifest contract. That fixture did not declare
MEETING_RECEIPT_RECONCILER_ENABLED, so the validator correctly reported it
missing on cloud_run/backend - and the extra error also perturbed two unrelated
assertions that count errors. Add a with_meeting_receipt_reconciler_env helper
modelled on the existing with_conversation_notes_v2_env sibling, scoped to the
backend service only, and wire it into the fixture composition chain.

The flag itself was already correctly declared on both backend-listen and the
Cloud Run backend service; no deployment configuration changed, and no assertion
was weakened.

Failure-Class: FC-hand-listed-test-isolation-membership

Co-Authored-By: Claude Opus 5 <[email protected]>
@Git-on-my-level
Git-on-my-level force-pushed the agent/m4-air-codex-sol/meeting-receipt-unification branch from d2cbc7c to 7d74f6b Compare August 20, 2026 05:12
@Git-on-my-level
Git-on-my-level merged commit 6f4b997 into main Aug 20, 2026
42 checks passed
@Git-on-my-level
Git-on-my-level deleted the agent/m4-air-codex-sol/meeting-receipt-unification branch August 20, 2026 05:34
Git-on-my-level added a commit that referenced this pull request Aug 20, 2026
…listing it (#11946)

33 backend test files stub `utils.conversations.*` with hand-maintained lists of
module names, for a package holding 25 submodules; each file names only the few
it happens to need. #11888 added `utils/conversations/meeting_receipt.py` and
imported it from `routers/conversations.py`, and two of those suites failed in CI
at *collection* with ModuleNotFoundError - which reads as a product bug rather
than a stale fixture, and which the module's author hits in CI rather than the
fixture's owner hitting it locally.

FC-hand-listed-test-isolation-membership already describes this exactly, and
prescribes the cure: derive membership from the source signal, union it with the
explicit list so omission is not an opt-out, and prove the derivation with an
adopter deliberately absent from that list. Its canonical_prevention_artifact
named only the Swift runner; the backend carried the same class with no guard.

Add `package_submodule_stubs`, which enumerates a package's real submodules from
disk - never importing them, so no package side effect runs - and unions `extra`.
It resolves the directory relative to the backend root rather than through
`importlib.util.find_spec`, because inside a `stub_modules` block the package is
already a stub whose `__spec__` is None, so spec lookup would report the fake.

Three properties matter and are covered by tests. Private `_`-prefixed modules
are included: a router can `from pkg._private import X`, which is the same
omission bug. Enumeration recurses, because a stubbed sub-package carries an
empty `__path__` and would otherwise block `from pkg.child.leaf import X` from
resolving. And `utils.conversations` has no `__init__.py`, so a package is
detected by containing modules rather than by that file.

Adopt it in the two suites that actually broke. Verified by adding a module to
the package and importing it dotted from the router: 10 errors before, 10 passed
after. The import form matters - `from pkg import new` resolves through the
stubbed parent's __getattr__ and does not reproduce the failure.

The remaining ~31 hand-listed suites are untouched and remain follow-up work.

Failure-Class: FC-hand-listed-test-isolation-membership

Co-authored-by: Claude Opus 5 <[email protected]>

This branch was successfully deployed

1 active deployment
staging - docs — 7d74f6b9 Deployed Aug 20, 2026 by mintlify[bot]
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