Skip to content

fix(conversations): use transcript span for meeting-treatment duration - #19391

Merged
kodjima33 merged 1 commit into
BasedHardware:mainfrom
kduailabs:fix/meeting-duration-use-transcript-span
Sep 27, 2026
Merged

kodjima33 merged 1 commit into
BasedHardware:mainfrom
kduailabs:fix/meeting-duration-use-transcript-span

Conversation

@kduailabs

@kduailabs kduailabs commented Sep 27, 2026 •

Copy link
Copy Markdown
Contributor

What

meeting_treatment_verdict (utils/conversations/meeting_treatment.py) computed its policy duration as the wall window finished_at - started_at. started_at is the live-socket streaming-session origin, not the moment the conversation's speech began — it drifts tens of minutes behind wall clock across a long socket (#4056). A 90-second desktop call that began 40 minutes into a live socket therefore measured as ~2400s.

Impact

The 5-minute too_short gate never fired for those captures, so a short call received the full meeting treatment: the verdict is persisted in the meeting receipt (utils/conversations/meeting_receipt.py, duration_s field) and eligible=True creates the durable capture-arrival intent and a "meeting ready" notification, plus LLM notes for a capture with 90 seconds of speech. This is the same defect class #13047 fixed at the discard gate; the policy gate was missed. backend/utils/conversations/duration.py is the repo's declared single authority for this exact question ("Any consumer that computes finished_at - started_at therefore over-counts…"), and its helper already existed — this site just wasn't routed through it.

Fix

Use conversation_duration_seconds(conversation) (transcript span, with the wall window as the documented degraded fallback for transcript-free captures). The duration_s in every MeetingTreatmentVerdict — and the receipt written from it — now matches what the clients display and what the discard gate measures.

Tests

backend/tests/unit/test_meeting_treatment_duration_span.py — hermetic, stdlib only:

  1. a 90-second call inside a 40-minute socket window is too_short with duration_s ≈ 90;
  2. a genuinely long call stays eligible;
  3. a transcript-free capture still falls back to the wall window (and is excluded by the speech minimum, not the duration gate).

Verification

  • Ran the three cases locally against the edited policy: 3/3 passed.
  • git grep confirms the check module is the only consumer of the wall-window formula in this file.

Failure-Class: none

Review in cubic

@kduailabs

Copy link
Copy Markdown
Contributor Author

Bounty proposal for this fix: #19393 ($50 proposed).

@Git-on-my-level

Copy link
Copy Markdown
Member

Verified against the current head — correct and well-scoped fix.

  • backend/utils/conversations/meeting_treatment.py — meeting_treatment_verdict() now sources duration_s from conversation_duration_seconds() (transcript span, wall-window fallback) instead of recomputing finished_at - started_at. That removes the last policy-gate consumer of the raw wall window: started_at is the live-socket streaming origin (the drift behind Bug conversation durations  #4056), so a 90-second call late in a long socket previously measured ~2400s, never hit the 5-minute too_short gate, and received full meeting treatment. The routing mirrors what fix(conversations): compute duration from the transcript span on the backend discard gate and macOS #13047 already did at the discard gate, and duration.py itself is untouched by this branch (pre-existing helper, no new duration semantics introduced).
  • backend/tests/unit/test_meeting_treatment_duration_span.py — hermetic, stdlib-only, and covering the three load-bearing cases: short-call-inside-long-socket returns too_short with duration_s ~= 90 (not ~2400); a genuinely long call stays eligible; a transcript-free capture falls back to the wall window and is excluded by insufficient_speech rather than the duration gate. Asserting both reason and duration_s pins the actual regression.

The corrected duration_s also flows into the persisted meeting receipt (meeting_receipt.py), so receipts now match what the clients display. Backend unit suite, Hermetic Backend E2E, and the Backend Hermetic Merge Gate all pass on this head.

Formal sign-off stays with a human maintainer since this gate decides which captures get LLM meeting treatment and a persisted receipt — from the automation side the change looks solid.

This review is automated on behalf of the Omi maintainer team.


by AI on behalf of David — if you need David’s attention urgently, please @Git-on-my-level and escalate with need human response.

@Git-on-my-level Git-on-my-level added positive-signal Automation verified a genuine fix/quality contribution backend Backend Task (python) labels Sep 27, 2026

@kodjima33 kodjima33 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

backend bug-fix, confidence 5/5 (root cause tied to #4056/#13047, scoped diff, tests, CI green) — merging.

@kodjima33
kodjima33 merged commit 5559b5e into BasedHardware:main Sep 27, 2026
51 of 52 checks passed
Git-on-my-level added a commit that referenced this pull request Sep 27, 2026
…th transcript-span duration

#19391 switched meeting_treatment_verdict to the transcript-span duration
rule but left wall-window fixtures in test_meeting_treatment.py and
test_chat_first_proactive_engine.py, red on origin/main and on this PR's
shards. Extend the alignment begun in the previous commit: eligible
fixtures now carry a five-minute transcript span, the too_short and
insufficient_speech parametrizations vary the span/speech instead of the
wall window, and expected verdicts assert the span-derived inputs.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Git-on-my-level added a commit that referenced this pull request Sep 28, 2026
* draft(capture-timeline): explore S1 evidence envelope dark write

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* draft(capture-timeline): mark dark client writes internal only

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* draft(capture-timeline): export optional evidence request contract

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* draft(capture-timeline): regenerate first-party API types

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* draft(capture-timeline): explore S1 evidence envelope dark write

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* draft(capture-timeline): mark dark client writes internal only

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* draft(capture-timeline): export optional evidence request contract

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* draft(capture-timeline): regenerate first-party API types

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* test(capture-timeline): register evidence module in sync harnesses and pin capture_evidence

- Pre-register the real pure utils.capture_evidence module in the
  sync_v2/cloud_tasks stub harnesses (manual_speaker_assignments pattern);
  the pipeline's new module-scope import broke the file-path re-exec.
- Pin Conversation.capture_evidence as server-authored, NOT
  projection-family (processing_state precedent): Field(exclude=True),
  never client-visible; projection-family would strip/delete the dark
  write itself.
- Regenerate public docs/api-reference/openapi.json for the optional
  CaptureEvidenceLineage request contract.

* feat(capture-timeline): bridge phone source positions through live and WAL sync

Carry bounded source maps through decode, VAD, transcript persistence and multi-track assignment. Exercise the actual listen and sync paths with hermetic fixtures.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* harden(capture-timeline): keep bounded receipt typing explicit

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* chore(capture-timeline): export mapped evidence wire shape

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* test(capture-timeline): update paced upload fakes for evidence header

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* test(capture-timeline): align meeting fixture with transcript duration rule

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* test(capture-timeline): finish meeting-treatment fixture alignment with transcript-span duration

#19391 switched meeting_treatment_verdict to the transcript-span duration
rule but left wall-window fixtures in test_meeting_treatment.py and
test_chat_first_proactive_engine.py, red on origin/main and on this PR's
shards. Extend the alignment begun in the previous commit: eligible
fixtures now carry a five-minute transcript span, the too_short and
insufficient_speech parametrizations vary the span/speech instead of the
wall window, and expected verdicts assert the span-derived inputs.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* test(capture-timeline): preserve measured meeting fixture

* test(capture-timeline): align uploader fake with evidence API

* test(desktop-ci): serialize owner-scoped embedding suite

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
Co-authored-by: David Zhang <[email protected]>
Co-authored-by: David Zhang <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend Backend Task (python) positive-signal Automation verified a genuine fix/quality contribution

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants