Commit 3265e65
authored
fix(desktop): detect Telegram calls and gate meeting treatment at finalization (#11832)
## 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](https://claude.com/claude-code)
<!-- This is an auto-generated description by cubic. -->
<a
href="https://cubic.dev/pr/BasedHardware/omi/pull/11832?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. -->31 files changed
Lines changed: 480 additions & 78 deletions
File tree
- backend
- database
- models
- routers
- tests/unit
- utils
- conversations
- task_intelligence
- desktop
- macos
- Desktop
- Sources
- ProactiveAssistants/Core
- Services/APIClient
- Tests
- changelog/unreleased
- windows/src/renderer/src/lib
- docs
- api-reference
- doc/developer/backend
- web
- admin/lib/services/omi-api
- app/src/lib
- personas-open-source/src/lib
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
731 | 731 | | |
732 | 732 | | |
733 | 733 | | |
| 734 | + | |
734 | 735 | | |
735 | 736 | | |
736 | 737 | | |
| |||
745 | 746 | | |
746 | 747 | | |
747 | 748 | | |
| 749 | + | |
748 | 750 | | |
749 | 751 | | |
750 | 752 | | |
| |||
756 | 758 | | |
757 | 759 | | |
758 | 760 | | |
| 761 | + | |
759 | 762 | | |
760 | 763 | | |
761 | 764 | | |
762 | 765 | | |
763 | 766 | | |
764 | | - | |
| 767 | + | |
| 768 | + | |
| 769 | + | |
| 770 | + | |
| 771 | + | |
| 772 | + | |
| 773 | + | |
| 774 | + | |
765 | 775 | | |
766 | 776 | | |
767 | 777 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
348 | 348 | | |
349 | 349 | | |
350 | 350 | | |
| 351 | + | |
351 | 352 | | |
352 | 353 | | |
353 | 354 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
| 59 | + | |
59 | 60 | | |
60 | 61 | | |
61 | 62 | | |
| |||
1084 | 1085 | | |
1085 | 1086 | | |
1086 | 1087 | | |
| 1088 | + | |
1087 | 1089 | | |
1088 | 1090 | | |
1089 | 1091 | | |
| |||
1474 | 1476 | | |
1475 | 1477 | | |
1476 | 1478 | | |
| 1479 | + | |
1477 | 1480 | | |
1478 | 1481 | | |
1479 | 1482 | | |
| |||
1670 | 1673 | | |
1671 | 1674 | | |
1672 | 1675 | | |
| 1676 | + | |
1673 | 1677 | | |
1674 | 1678 | | |
1675 | 1679 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
18 | 24 | | |
19 | 25 | | |
20 | 26 | | |
| |||
223 | 229 | | |
224 | 230 | | |
225 | 231 | | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
226 | 235 | | |
227 | 236 | | |
228 | 237 | | |
| |||
254 | 263 | | |
255 | 264 | | |
256 | 265 | | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
257 | 295 | | |
258 | 296 | | |
259 | 297 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
493 | 493 | | |
494 | 494 | | |
495 | 495 | | |
496 | | - | |
| 496 | + | |
| 497 | + | |
497 | 498 | | |
498 | 499 | | |
499 | 500 | | |
| |||
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
696 | 696 | | |
697 | 697 | | |
698 | 698 | | |
| 699 | + | |
699 | 700 | | |
700 | 701 | | |
701 | 702 | | |
| |||
Lines changed: 56 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
173 | 173 | | |
174 | 174 | | |
175 | 175 | | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
176 | 195 | | |
177 | 196 | | |
178 | 197 | | |
| |||
200 | 219 | | |
201 | 220 | | |
202 | 221 | | |
203 | | - | |
| 222 | + | |
204 | 223 | | |
205 | 224 | | |
206 | 225 | | |
| |||
281 | 300 | | |
282 | 301 | | |
283 | 302 | | |
284 | | - | |
| 303 | + | |
285 | 304 | | |
286 | 305 | | |
287 | 306 | | |
| 307 | + | |
288 | 308 | | |
289 | 309 | | |
290 | 310 | | |
| |||
342 | 362 | | |
343 | 363 | | |
344 | 364 | | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
345 | 368 | | |
346 | 369 | | |
347 | 370 | | |
| |||
353 | 376 | | |
354 | 377 | | |
355 | 378 | | |
356 | | - | |
| 379 | + | |
357 | 380 | | |
358 | 381 | | |
359 | 382 | | |
| 383 | + | |
360 | 384 | | |
361 | 385 | | |
362 | 386 | | |
363 | 387 | | |
364 | 388 | | |
365 | 389 | | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
366 | 419 | | |
367 | 420 | | |
368 | 421 | | |
| |||
Lines changed: 15 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
| |||
315 | 316 | | |
316 | 317 | | |
317 | 318 | | |
| 319 | + | |
318 | 320 | | |
319 | 321 | | |
320 | 322 | | |
321 | 323 | | |
| 324 | + | |
322 | 325 | | |
323 | 326 | | |
324 | 327 | | |
325 | 328 | | |
326 | 329 | | |
327 | 330 | | |
328 | 331 | | |
| 332 | + | |
329 | 333 | | |
330 | 334 | | |
331 | 335 | | |
| |||
1054 | 1058 | | |
1055 | 1059 | | |
1056 | 1060 | | |
| 1061 | + | |
| 1062 | + | |
| 1063 | + | |
1057 | 1064 | | |
1058 | 1065 | | |
1059 | 1066 | | |
| |||
1097 | 1104 | | |
1098 | 1105 | | |
1099 | 1106 | | |
1100 | | - | |
| 1107 | + | |
| 1108 | + | |
| 1109 | + | |
| 1110 | + | |
| 1111 | + | |
| 1112 | + | |
1101 | 1113 | | |
1102 | 1114 | | |
1103 | 1115 | | |
| |||
1440 | 1452 | | |
1441 | 1453 | | |
1442 | 1454 | | |
1443 | | - | |
| 1455 | + | |
1444 | 1456 | | |
1445 | 1457 | | |
1446 | 1458 | | |
| |||
1520 | 1532 | | |
1521 | 1533 | | |
1522 | 1534 | | |
1523 | | - | |
| 1535 | + | |
1524 | 1536 | | |
1525 | 1537 | | |
1526 | 1538 | | |
| |||
0 commit comments