Skip to content

fix(desktop): detect Telegram calls and gate meeting treatment at finalization - #11832

Merged
Git-on-my-level merged 1 commit into
mainfrom
codex/meeting-detect-reliability
Aug 19, 2026
Merged

Git-on-my-level merged 1 commit into
mainfrom
codex/meeting-detect-reliability

Conversation

@Git-on-my-level

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

Copy link
Copy Markdown
Member

What and why

  • Add Telegram Desktop's shipping bundle ID (com.tdesktop.Telegram, normalized to lowercase) and legacy ru.keepcoder.telegram ID to native call detection. The proactive chat-app policy consumes the same Telegram ID set so the catalogs cannot drift independently.
  • Keep conversation_role as OPEN-time session provenance. Introduce a separate backend-owned meeting_treatment_eligible finalization result, persist it with the durable finalization job, and expose it through both the finalization-status and synchronous from-segments responses.
  • Gate the meeting Chat arrival and desktop completion notification on that finalization result. Short or mostly silent calls still finalize as ordinary conversations without rewriting their role or provenance.
  • Count actual speech as the union of non-empty transcript intervals, preventing simultaneous microphone and system-audio transcript twins from roughly doubling the speech measure.

Meeting treatment requires at least five minutes of wall-clock duration and at least 60 seconds of deduplicated transcribed speech. Five minutes filters quick calls that should remain ordinary conversations. The smaller speech floor still admits listening-heavy meetings and natural pauses while rejecting long hold/silence captures with only a brief accidental transcription. Interval union makes the floor independent of whether one or both desktop audio streams transcribed the same remote speech.

Line-count exception

Line-Count-Exception: backend/routers/developer.py | 2111 -> 2115 | propagates the new meeting_treatment_eligible field through the existing conversation response model and its two projection sites; splitting this router is unrelated to this fix and would make the change unreviewable.

Failure class

Failure-Class: none

No registered failure class matches this macOS native-process catalog omission or the separate finalization-time treatment boundary. FC-meeting-trigger-title-identity-drift is a Windows browser-title/event identity contract. The production isNativeCallApp regression and shared Telegram ID set guard the catalog boundary; backend behavioral tests guard duration, deduplicated speech, finalization persistence, Chat arrival, and response projection.

Verification

  • PYTHON=/Users/dazheng/workspace/omi/upstream-keep-clean/backend/.venv/bin/python bash test-preflight.sh (from backend/) — 17 passed, 9 optional warnings, 0 failed.
  • PYTHON=/Users/dazheng/workspace/omi/upstream-keep-clean/backend/.venv/bin/python BACKEND_PYTEST_WORKERS=6 BACKEND_UNIT_TEST_FILE_LIST=../.backend-meeting-test-files.txt bash test.sh (from backend/; the temporary selector listed the six changed/new backend test files and was then deleted) — 195 passed, including the four dedicated meeting-treatment policy tests.
  • PYTHON=/Users/dazheng/workspace/omi/upstream-keep-clean/backend/.venv/bin/python BACKEND_PYTEST_WORKERS=10 bash test.sh (from backend/) — all 856 backend unit-test files were selected and the runner progressed through nearly the entire suite, but one remaining file produced no output for several minutes and the file-isolated runner has no per-file timeout. The run was interrupted and did not produce a terminal pass/fail summary; full-suite status is therefore unverified.
  • ./scripts/run-swift-ci.sh --test (from desktop/macos/) — could not start because the pinned /Applications/Xcode_16.4.app toolchain is unavailable in this environment.
  • CLANG_MODULE_CACHE_PATH=/Volumes/scratch/tmp/meeting-detect-swift-cache/clang SWIFTPM_MODULECACHE_OVERRIDE=/Volumes/scratch/tmp/meeting-detect-swift-cache/clang xcrun swift test --jobs 1 -Xswiftc -j1 --disable-index-store --disable-sandbox --skip-update --disable-build-manifest-caching --manifest-cache none --cache-path /Volumes/scratch/tmp/meeting-detect-swift-cache/swiftpm-cache --config-path /Volumes/scratch/tmp/meeting-detect-swift-cache/swiftpm-config --security-path /Volumes/scratch/tmp/meeting-detect-swift-cache/swiftpm-security --scratch-path /private/tmp/meeting-swift-build --package-path desktop/macos/Desktop --filter 'ConferencingAppsTests|TranscriptionFinalizationStateMachineTests|ProactiveAssistantOrchestrationPolicyTests|APIClientConversationCountTests' — SwiftPM reached the debug build and then failed with opaque error: fatalError; tests did not execute.
  • CLANG_MODULE_CACHE_PATH=/Volumes/scratch/tmp/meeting-detect-swift-cache/harness-clang SWIFTPM_MODULECACHE_OVERRIDE=/Volumes/scratch/tmp/meeting-detect-swift-cache/harness-clang xcrun swiftc -module-cache-path /Volumes/scratch/tmp/meeting-detect-swift-cache/harness-clang desktop/macos/Desktop/Sources/ConferencingApps.swift .meeting-detect-catalog-harness.swift -o /private/tmp/meeting-detect-catalog-harness && /private/tmp/meeting-detect-catalog-harness — directly compiled the production classifier; both Telegram IDs classified as native call apps and Omi did not. Printed Telegram catalog classification passed; the temporary source was deleted.
  • python3 scripts/check_desktop_test_quality.py (from desktop/macos/) — passed with no new source-reading tests, trapping dictionary initializers, or wall-clock waits.
  • scripts/swift-format-wrapper.sh lint <nine changed Swift files> (from desktop/macos/) — passed.
  • make preflight — all 11 manifest checks passed. Because the changes were still uncommitted, the preflight runner reported files=0; rerun after the commit so diff-scoped selection is meaningful.
  • git diff --check — passed.

Verification limits

  • A real Telegram call and named desktop bundle were not exercised because the pinned desktop toolchain is unavailable and SwiftPM cannot complete whole-module emission with the available toolchain.
  • The full backend suite did not reach a terminal summary; the changed-area component run is green, but the remaining backend files are not claimed as verified.

Follow-ups

  • Add Tier-2 detection for unknown CoreAudio processes only after a telemetry-only phase builds an observed allowlist from real process topologies. isRunningOutput means an active output stream, not audible speech; games, DAWs, and media apps can satisfy it, while split-process Electron/browser calls can fail a same-process input+output rule.
  • Design idle-based conversation rotation through the existing serialized meeting-boundary path. It must never become a second rotation authority: a failed meeting rotation can call stopTranscription(), so an independent idle race could stop always-on capture.

🤖 Generated with Claude Code

Review in cubic

@mintlify

mintlify Bot commented Aug 18, 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 18, 2026, 11:52 PM

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

…alization

Always-listen produced no meeting summary for a 17.5 min Telegram call:
MeetingDetector never fired because callAppIsUsingMicrophone() gates on a
9-entry bundle-ID allowlist that omitted Telegram Desktop
(com.tdesktop.Telegram), and the browser window-title fallback does not
cover it either. The CoreAudio signal was available and discarded.

Add Telegram's shipping and legacy bundle IDs to the native call catalog,
shared with ProactiveAssistantOrchestrationPolicy so the two catalogs
cannot drift independently.

Keep conversation_role as OPEN-time session provenance committed locally
and to the backend. Introduce a separate backend-owned
meeting_treatment_eligible result computed at finalization, and gate
meeting Chat arrival and desktop completion notification on it. Meeting
treatment requires >=5 min wall-clock and >=60s of deduplicated
transcribed speech; short or mostly silent calls still finalize as
ordinary conversations without rewriting their role.

Speech is counted as the union of non-empty transcript intervals, so the
simultaneous microphone and system-audio streams — which emit twins for
the same remote speech — cannot roughly double the measure.

Failure-Class: none

Co-Authored-By: Claude Opus 5 <[email protected]>
@Git-on-my-level
Git-on-my-level force-pushed the codex/meeting-detect-reliability branch from 4849940 to e5be633 Compare August 19, 2026 00:06
@Git-on-my-level
Git-on-my-level merged commit 3265e65 into main Aug 19, 2026
39 of 40 checks passed
@Git-on-my-level
Git-on-my-level deleted the codex/meeting-detect-reliability branch August 19, 2026 00:31
Git-on-my-level added a commit that referenced this pull request Aug 19, 2026
#11832 threaded meetingTreatmentEligible into postMeetingCompletionIfReady
and returned early whenever it was non-nil. uploadLocalSegments always
returns a non-nil value, so the local-fallback recovery path stopped
calling waitForFinalizationProjectionIfNeeded.

The threaded value cannot be authoritative: it comes from the
from-segments response, which returns before the backend finalizes the
conversation, so it carries the default false rather than a decided
verdict. That both suppressed the notification and skipped the real
check.

waitForFinalizationProjectionIfNeeded already reads the finalization
projection, applies the same rule via shouldWakeMeetingCompletion, and
fails closed on 404 so a short meeting cannot bypass backend policy.
Defer to it unconditionally: the >=5 min gate stays enforced, and the
wake waits for the projection as it did before #11832.

testRecoverPendingFinalizationsProcessesExhaustedBackendBoundLocalFallback
already asserts the /finalization request on this path and caught the
regression in CI; it is the guard for this fix.

Failure-Class: none

Co-Authored-By: Claude Opus 5 <[email protected]>
Git-on-my-level added a commit that referenced this pull request Aug 19, 2026
…ifying (#11836)

## What and why

`#11832` threaded `meetingTreatmentEligible` into
`postMeetingCompletionIfReady` and returned early whenever it was
non-nil:

```swift
if let meetingTreatmentEligible {
    guard meetingTreatmentEligible else { return }
    scheduleMeetingCompletionNotification(conversationID: conversationID)
    return                                    // skips the projection wait
}
guard await waitForFinalizationProjectionIfNeeded(...) else { return }
```

`uploadLocalSegments` always returns a non-nil value, so on the
local-fallback recovery path the new branch always won and
`waitForFinalizationProjectionIfNeeded` never ran.

That wait is what guarantees the backend has projected the conversation
before the user is told it is ready. Skipping it can schedule a
meeting-completion notification that opens an unhydrated conversation —
the same class of failure `#11832` set out to fix.

This gates on eligibility without discarding the wait. A
known-ineligible finalization (short or mostly silent call) still
returns early and never notifies; an eligible one waits for the
projection exactly as it did before `#11832`.

## Failure class

Failure-Class: none

## Verification

-
`testRecoverPendingFinalizationsProcessesExhaustedBackendBoundLocalFallback`
(`desktop/macos/Desktop/Tests/TranscriptionFinalizationStateMachineTests.swift:606`)
asserts the `/v1/conversations/{id}/finalization` request on this exact
path. It predates `#11832`, passed on main before it, and failed in CI
afterwards with `("[]") is not equal to
("["/v1/conversations/local-fallback-conversation/finalization"]")`. It
is the guard for this fix; no new test is added because the existing one
already covers the boundary.
- `make preflight` — see CI.
- The Swift suite could not be run locally:
`desktop/macos/scripts/run-swift-ci.sh` requires Xcode 16.4 and rejects
the installed Xcode 26.2 regardless of `OMI_SWIFT_CI_XCODE_APP`. **CI is
the verifier for this change.**

## Context

`#11832` was merged while its 45-minute `Desktop Swift Static & Test
Contracts` job was still running; the failure surfaced after the merge.
Everything else in that PR — the Telegram catalog fix and the
finalization-time meeting-treatment gate — passed CI and is unaffected
by this change.

🤖 Generated with [Claude Code](https://claude.com/claude-code)


<!-- This is an auto-generated description by cubic. -->
<a
href="https://cubic.dev/pr/BasedHardware/omi/pull/11836?utm_source=github"
target="_blank" rel="noopener noreferrer"
data-no-image-dialog="true"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"><source
media="(prefers-color-scheme: light)"
srcset="https://www.cubic.dev/buttons/review-in-cubic-light.svg"><img
alt="Review in cubic"
src="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"></picture></a>
<!-- End of auto-generated description by cubic. -->
Git-on-my-level added a commit that referenced this pull request Aug 19, 2026
…ibility policy

Integrates with the meeting-detection track (#11832, #11836), merged into this
branch from main.

conversation_role is open-time durable identity, not the treatment decision.
Enrichment gated on the role alone would spend a Google Calendar read, a
screen-activity query, and a stored-meetings row on a 90-second call that the
authoritative finalization policy has already ruled out — and that row would
then be visible to our own time-overlap resolver for unrelated conversations in
the same window. Desktop meeting-role conversations now defer to
is_meeting_treatment_eligible; every other source keeps its prior behaviour.

The existing wiring fixture was a zero-segment 'meeting', which the gate
correctly skips, so it now carries qualifying speech. That is a fixture
correction, not a weakened assertion: a silent conversation was never eligible
for meeting treatment.

Also folds the bare-meeting-code title pattern ('Meet - amc-iajq-asx') into
ConferencingApps as browserCallTitlePattern/isBrowserCallTitle. #11832
consolidated two divergent conferencing catalogs; leaving this pattern in the
extractor would have made a third.

Failure-Class: none

Verified per-file: enrichment_wiring 10, meeting_context_resolution 28,
meeting_treatment 4, screen_activity_identity 19, notes_v2 5,
usage_context 33, action_item_date_validation 26, structure_timezone 16.
All four contract surfaces regenerate with no diff after the merge.

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

This branch was successfully deployed

1 active deployment
staging - docs — e5be633f Deployed Aug 19, 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