Skip to content

fix: skip no-device recording-start failures and catch onboarding audio NSException - #12656

Merged
Git-on-my-level merged 60 commits into
mainfrom
fix/push-influx-followups
Sep 3, 2026
Merged

Git-on-my-level merged 60 commits into
mainfrom
fix/push-influx-followups

Conversation

@Git-on-my-level

@Git-on-my-level Git-on-my-level commented Sep 3, 2026 •

Copy link
Copy Markdown
Member

What changed and why

Two independent production reliability fixes.

Mobile — false Recording Start Failed telemetry. The Recording Start Failed / Recording Started events shipped 2026-08-31 in #11539. On 2026-09-02 PostHog showed 247 Recording Start Failed events (93 users, all failure_class=capture_unavailable) against 157 Recording Started (58 users). Failures outnumbering starts is impossible for a real failure rate.

Cause: streamDeviceRecording called _recordingTelemetry.prepare(...) unconditionally, then emitted capture_unavailable whenever the start did not reach deviceRecord. HomePage calls this with device == null on every entry as a check-only path, so every home-page entry with no pendant connected was counted as a failed start.

A no-device / check-only call now skips prepare() and does not emit start-failed. A real device start (a device was passed, or a recording device is already set) that does not reach deviceRecord still emits capture_unavailable.

macOS — onboarding sound engine crash. Sentry OMI-DESKTOP-4EK, title com.apple.coreaudio.avfaudio: player did not see an IO cycle., level fatal, mechanism=nsexception, handled=no. 25 distinct users since 2026-08-24; 8 of them on 2026-09-02 while the flag-driven onboarding rerun (#12597) pushed ~218 dormant users back through onboarding. This is the only AVAudioPlayerNode usage in the onboarding path.

AVAudioPlayerNode.play() raises that NSException when the engine is not running or has not completed an IO cycle. Every scheduleBuffer/play() now re-checks engine.isRunning on the audio queue, is wrapped in the existing ObjCExceptionCatcher, and a caught exception logs once then sets isSilenced so onboarding continues without retrying in a loop. rebuildAfterConfigurationChange does not play until the rebuilt engine is running.

Product invariants affected

none

How it was verified

Mobile

cd app
flutter analyze lib/services/capture/capture_controller.dart lib/providers/capture_provider.dart

No issues found! (ran in 32.2s)

cd app
flutter analyze lib/services/capture/capture_controller.dart lib/providers/capture_provider.dart test/unit/recording_lifecycle_telemetry_test.dart test/providers/capture_provider_test.dart

3 pre-existing infos in capture_provider_test.dart (depend_on_referenced_packages, two no_leading_underscores_for_local_identifiers); 0 issues in the production files.

cd app
flutter test test/unit/recording_lifecycle_telemetry_test.dart test/providers/capture_provider_test.dart

All 93 tests passed.

macOS

cd desktop/macos
python3 scripts/dev-feedback.py --once swift 'OmiOnboardingSoundTests'

OmiOnboardingSoundTests: 17 tests, 0 failures. Iteration 1: PASS.

cd desktop/macos
python3 scripts/check_desktop_test_quality.py
./scripts/swiftlint-wrapper.sh lint

check_desktop_test_quality.py: OK (debt at or below baseline).
SwiftLint: 0 violations, 0 serious in 3052 files.

Did not exercise the onboarding cinematic in a named bundle: the crash is an ObjC exception from AVAudioPlayerNode.play() when the engine has no IO cycle, which the unit tests cannot drive. The decision guard is covered by OmiAVSoundPlayback.mayPlay.

Tests

  • app/test/unit/recording_lifecycle_telemetry_test.dart: failStart without prepare emits nothing; a prepared device start still emits capture_unavailable.
  • app/test/providers/capture_provider_test.dart: homepage no-device streamDeviceRecording emits no events; a requested device that cannot reach deviceRecord emits capture_unavailable.
  • desktop/macos/Desktop/Tests/OmiOnboardingSoundTests.swift: mayPlay is false when the engine is not running or the output is silenced.

Failure class (fixes)

Failure-Class: none

🤖 Generated with Claude Code

Review in cubic

Git-on-my-level and others added 24 commits September 2, 2026 14:41
…ait, and an exit

A conversation that is still being summarized used to render as
"Processing…" with a fallback 💬, a pulsing pill that promised "shortly"
without a bound, and a client that stopped checking after ~230s. The
transcript was already on disk and the reprocess route already worked from
a processing row; the UI just never used either.

Row identity
- The title slot carries the first substantive transcript line (or the
  recording time when no transcript is loaded). Status moves to the badge.
- No fake emoji while the pipeline has not produced one: a waveform tile.
- List refreshes keep an already-loaded transcript when the server list
  omits transcript_segments (omitted means "not loaded", not "empty").

Bounded wait
- Pill reads Summarizing → Taking longer than usual (2 min) → Stuck
  (10 min), driven by a 15s TimelineView only on live-pipeline rows.
- Stuck rows show Reprocess inline; the detail banner does the same.
- ProcessingConversationWatcher follows every visible processing row to a
  terminal state with backoff (3s→60s) and never gives up while the row is
  visible; the detail view's poll uses the same backoff instead of 15×2s.

Two waves
- After status flips to completed the row shows "Adding memories & tasks…"
  for a 45s grace and refetches once so action items land without a manual
  refresh.

Four meanings, split
- Deferred free-tier desktop rows (`deferred=true`, `processing` on the
  wire, nothing running) now read "Tap to summarize" instead of
  "Processing…", are not timed, and are not polled.

Continuity
- The Live card's slot stays occupied by a "Saving" card until the capture
  is a row in the list; row insertion animates.

Telemetry
- "Conversation Processing Completed" (elapsed_seconds, outcome) and
  "Conversation Processing Stalled" (elapsed_seconds), so the thresholds
  can be re-set from a measured p95 instead of a guess.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
`action_items_list` was 48.8% of every billable Firestore document read
(~$328/day) until #12258 exempted the `action_items:list` policy from
`RATE_LIMIT_BOOST` and its 12/min per-uid cap started firing. That removed the
*frequency* half of the problem: 6,600 -> 692 docs/sec (24h mean, 2026-09-02),
121 -> 3.1 ops/sec, and a 3-minute prod capture shows the route at 3.0 req/s
with 11.7% 429s, 98% of them `omi-windows`.

What is left is fan-out, not frequency. Documents-per-operation went the other
way, 54.5 -> ~223, because the cheap requests are exactly the ones the cap
removed. The surviving traffic is large-backlog accounts, still 90% on the
pre-fix `omi-windows/1.0.0` build asking for `limit=500`, re-reading an
unchanged backlog on every allowed poll.

Three changes, all env-tunable and all off-by-one-env-var:

1. Per-uid response cache + ETag/`If-None-Match` -> 304 for the unfiltered
   listing. A cache hit and a 304 both perform zero Firestore reads. The key
   carries a per-uid version that every action-item write bumps, so a write
   invalidates every cached page for that user in one INCR — no key
   enumeration, no per-mutation invalidation list to keep in sync. The TTL
   (`ACTION_ITEMS_LIST_CACHE_TTL_SECONDS`, default 30s, 0 disables) is the
   safety net rather than the mechanism: a writer that ever forgets to bump
   costs bounded staleness, never a permanently wrong list.

2. A second, stricter ceiling for the known hot-loop client class
   (`action_items:list_hot_client`, `ACTION_ITEMS_LIST_HOT_CLIENT_MAX`,
   default 4/min, 0 disables). It composes with `action_items:list` rather
   than replacing it: every client keeps the 12/min bucket, and only the stale
   build is additionally charged the second one. Refusal happens before any
   Firestore work, so a throttled poll costs zero reads.

3. `omi_action_items_list_cache_total{outcome}` and
   `omi_action_items_list_throttled_total{client,policy}` — the metrics that
   prove within 24h of a deploy that the reads actually went away, instead of
   inferring it from the billing export a week later.

Classification is deliberately narrow: only the exact `omi-windows/1.0.0`
product token counts as hot. An unrecognised user agent is not, because a
misclassification here degrades a real client and the 12/min policy already
covers the general case. Redis is fail-open on both paths, matching
`_enforce_rate_limit`'s first-party contract.

Failure-Class: none

Co-Authored-By: Claude Fable 5.1 <[email protected]>
The on-device realtime voice lane already ends ~65% of its answers with a
grounded question and those sessions run ~4 turns. The typed lanes end with a
question 4-9% of the time, and recall answers ("what did X say", "when did
we...") 0% of the time even though 71% of them have a strong next hop into the
same source available. 57% of asker-days are exactly one question; the 1->2
continuation rate among those who do continue is 83%. The missing turn is the
one Omi never invited.

The agentic chat lane now asks the model to append exactly one specific,
grounded, answerable question after a `<<<FOLLOWUP>>>` marker on its own final
line. The backend strips the marker and everything after it from the visible
text and delivers the question as a `followUp` content block on the persisted
assistant message, so the chip's words are never also in the prose. A streaming
filter withholds the tail (and any partial marker) from the token stream the
user watches, so it never flashes into the answer before the terminal frame.

Suppression is the other half: no block on a turn that failed, errored, timed
out, or was cut short, none on an empty answer, and none when the answer is
itself a clarifying question back to the user. The prompt adds refusals,
capability denials, "I couldn't find that", and general-knowledge questions to
that list.

Verification:
  backend/.venv/bin/python -m pytest tests/unit/test_chat_followup_block.py -q
    -> 20 passed
  ... tests/unit/test_chat_stream_error_fallback.py
      tests/unit/test_chat_quota_counting_router.py
      tests/unit/test_chat_agent_loop_guard.py -q
    -> 27 passed
  ... tests/unit/test_agentic_web_search_taint.py
      tests/unit/test_chat_async_offload.py -q
    -> passed (a pre-existing sys.modules ordering failure in
       test_prompt_cache_integration.py reproduces identically with this
       file restored from HEAD, so it is not from this change)
  scripts/backend-python-format --write <changed files>

Co-Authored-By: Claude Fable 5.1 <[email protected]>
…mmary

`knowledge_nuggets` is LLM prose with no memory identity, so a shell cannot
show what Omi actually stored, and the owner cannot accept, reject, or correct
it. Add `memories_learned: list[LearnedMemoryRef]` (memory_id, content,
category, captured_at) to the stored daily summary and to
`DailySummaryResponse`, plus a `memoryReviewCard` content block on the
`day_summary` push so both shells can render a native check / cross / fix card.

Selection is deterministic — zero new LLM calls. `utils/memory/learned_today.py`
reads one bounded page through the canonical `MemoryService.read` path (so
canonical and historical rows both qualify under one visibility policy), keeps
memories attributed to the same conversation set the summary was built from
(falling back to the local-day window for a memory with no conversation
evidence), drops rejected / locked / invalidated / superseded / empty rows,
orders by capture_confidence then veracity then newest, and caps at 3. A memory
read failure degrades to "no card", never to "no summary".

Review state is deliberately absent from the stored summary: clients read
`user_review`/`edited` live from the memory, so a vote on one device shows on
the other. Votes go through the existing
`POST /v3/memories/{memory_id}/review?value=<bool>` and edits through
`PATCH /v3/memories/{memory_id}` with `{"value": "..."}` — no new mutations.

The push `text` is unchanged and the block is omitted entirely when nothing
qualifies, so clients that do not know the block render exactly what they
rendered before. FCM data is Dict[str, str], so `content_blocks` travels as
JSON text, matching the batched-action-item payload already in
`utils/notifications.py`.

Verification:
  backend/.venv/bin/python -m pytest tests/unit/test_daily_summary_memories_learned.py -q
    -> 25 passed
  BACKEND_UNIT_TEST_FILE_LIST=<150 daily-summary/notification/users/generator files> bash test.sh
    -> all tests passed; one unrelated file (test_action_item_idempotency.py)
       tripped test.sh's load-sensitive CPU duration guard at 0.31s > 0.30s
       with all 13 of its tests PASSED
  backend/scripts/typecheck.sh -> 0 errors
  scripts/backend-python-format --write <changed files>
Regenerated artifacts for the `memories_learned` daily-summary field:

- docs/api-reference/app-client-openapi.json — new `LearnedMemoryRef` schema
  and the `DailySummaryResponse.memories_learned` array (additive optional
  response field only).
- app/lib/backend/schema/gen/users_wire.g.dart — `GeneratedLearnedMemoryRef`
  and `GeneratedDailySummaryResponse.memoriesLearned`.
- backend/scripts/generate_dart_models.py — the Dart `users` group selects
  schemas explicitly, so `LearnedMemoryRef` is registered there; without it the
  generator refuses the $ref rather than emitting an untyped map.

The Swift generator's TARGET_SCHEMAS does not include DailySummaryResponse and
nothing transitively pulls the new schema, so OmiApi.generated.swift is
unchanged and its freshness check still passes.

Verification:
  backend/scripts/openapi_runner.sh scripts/export_openapi.py --surface app-client \
    --write ../docs/api-reference/app-client-openapi.json
  backend/scripts/openapi_runner.sh scripts/export_openapi.py --check ../docs/api-reference/openapi.json
    -> up to date
  backend/scripts/openapi_runner.sh scripts/export_openapi.py --surface integration-public \
    --check ../docs/api-reference/integration-public-openapi.json -> up to date
  python3 backend/scripts/check_app_client_openapi_compatibility.py --base-ref origin/main
    -> compatibility passed against merge-base f502297
  backend/scripts/generate_dart_models.py --all --check -> up to date
  backend/scripts/generate_swift_openapi_types.py --check -> up to date
  pytest tests/unit/test_app_client_dart_generator.py tests/unit/test_app_client_swift_generator.py -> passed
Mobile decoded `content_blocks` but rendered none of them natively, so the two
new blocks would have shown as fallback prose or nothing at all. Render both:

- `memoryReviewCard` becomes a "Things I learned today" card of up to three
  rows, each with the paraphrase, a small category label, and ✓ Right /
  ✗ Wrong / Fix. It appears under the `day_summary` chat message and, from
  `memories_learned`, on the daily-summary detail page above the existing
  prose learnings, which are untouched.
- `followUp` becomes one tappable chip under an answer; tapping sends the
  chip's own words through the existing chat send path.

Review state is never stored in the message or in preferences. Each row reads
`user_review`/`edited` live from `MemoriesProvider`, which stays the single
mutation owner: ✓/✗ go through `reviewMemory` (POST /v3/memories/{id}/review)
and Fix through `editMemory` (PATCH /v3/memories/{id}). A tap paints
optimistically only until its request returns, then the row goes back to
reading the live memory, so a verdict cast on desktop shows here and a failed
write reverts with "Couldn't save, try again" inline. A memory the provider has
not loaded renders its content with the controls disabled and asks the provider
to load once, bounded per id so a scrolled chat list cannot refetch in a loop.

The `day_summary` message reaches mobile only as an FCM push, and FCM data is
Dict[str, str], so `content_blocks` arrives as JSON text. The strict generated
`List<Map>` reader rejected that outright, which would have dropped the whole
message. `ServerMessage` now decodes content blocks the way it already decodes
evidence — outside the generated DTO, through a fail-soft parser that tolerates
JSON text and degrades anything malformed to no blocks. `_blockFallbackText`
answers "Things I learned today" and the question text for the two new types;
every other block type is unchanged.

Verification:
  bash app/test.sh -> +1695 ~5, All tests passed
  flutter test test/unit/memory_review_block_test.dart
    test/unit/server_message_content_blocks_test.dart
    test/widgets/memory_review_card_test.dart
    test/widgets/chat_content_block_test.dart
    test/widgets/daily_summary_detail_page_test.dart
    test/widgets/chat_scroll_layout_test.dart
    test/widgets/chat_citation_taps_test.dart
    test/widgets/daily_summary_card_test.dart
    test/providers/knowledge_ledger_review_test.dart -> +66, All tests passed
  bash app/scripts/analyze_ratchet.sh -> Analyzer ratchet passed
  dart format --line-length 120 <changed .dart files> -> 0 changed

Co-Authored-By: Claude Fable 5.1 <[email protected]>
The daily-summary Cloud Run Job has a hard 600s task timeout and serves
tens of thousands of users. An execution that ran out of wall clock was
SIGKILLed mid-batch and the next execution restarted from the head, so
users past the kill point were never reached on any run and produced no
error of their own — the owner's dogfood account received nothing from
2026-08-23 onward while the pipeline looked healthy (#12530).

Three unbounded fault domains, all in the same job:

* The hour-group loop sat inside one try/except, and the per-hour user
  query fanned out with a bare `asyncio.gather`. One group's Firestore
  failure threw away the other 23 groups.
* Nothing bounded a single user. A wedged provider call held the
  batch-of-8 barrier for as long as it liked.
* Nothing bounded the generator's input. The summary prompt renders the
  user's whole day, and one account's day overflowed the model context
  window (~290k tokens against a 272k limit), returning a provider 400
  every day since at least 2026-08-25.

The job now runs to its own budget (480s, below the task timeout),
processes hour groups and users in a deterministic order rotated to a
Redis checkpoint so the next execution starts at the unfinished tail,
isolates and records every per-user failure, and closes with one
attempted/succeeded/failed/timed_out/skipped_for_budget line. Fail-open
branches go through the shared `record_fallback` helper under a new
`daily_summary` component. Losing Redis costs a re-walk, never a summary.

Also wires the `memoryReviewCard` content block into the scheduled send,
which previously only existed on the /v1/users/daily-summary-settings/test
path. The message text is byte-identical and the block is omitted when the
day produced nothing to review.

Failure-Class: FC-batch-fault-domain-head-of-line-poison

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Over 14 days on the owner's account the hub's knows-list re-showed the same
four commitments 8-12 times each ("meet with <person>" ~9x, "improve meeting
notes quality" ~8x) and its only engagement was the reader asking the card to
explain itself. The composer deliberately fills fixed typed slots so the list
stays diverse, but it had no memory of what it had already shown: dismissals
lived in a `@State Set<String>` that died with the view, and nothing recorded
an impression at all, so a thin source repeated itself on every visit.

Add an owner-scoped impression ledger (`ScopedDefaultsKey.homeKnowsImpressions`)
with a single mutation owner, `HomeKnowsImpressionStore`. The view reads a
snapshot taken when the list appears and hands every show, open, and dismiss
back to the store; it never writes the ledger itself.

Rules, all deterministic and clock-injected in `HomeKnowsRotationPolicy`:

- a row shown 3 times without ever being opened rotates out for 7 days;
- a dismissed row never returns unless its underlying object changes (new
  updated_at or new content hash) - which also resets the show cap;
- a task more than 14 days past due, or completed/deleted, is excluded;
- the same row is not shown twice in one calendar day unless nothing else
  qualifies for that slot AND the reader has opened it before;
- a slot with no qualifying candidate stays empty. The list may be shorter
  than four rows; it never falls back to the repeated row.

Within a slot, candidates are ordered never-shown first, then fewest shows,
then most recent underlying update. The diverse task - tip - task - ask
structure is unchanged.

One impression is one visit, not one render: the existing 7-second rotation
timer re-renders the same row every few seconds and must not burn through the
show cap, so the store de-duplicates per visit.

Telemetry: `desktop_home_knows_row` with `{kind, slot, shows_before}` for a
shown row and `{kind: "empty", slot, rotated_out_reason}` for a slot left
empty. Bounded dimensions only - row text is the reader's own tasks and
questions and never leaves the device. Existing open/dismiss paths
(intelligence-store feedback, task navigation) are unchanged.

Verification:
- desktop/macos/scripts/swift-format-wrapper.sh lint on all seven changed
  files: clean.
- desktop/macos/scripts/swiftlint-wrapper.sh lint: 0 violations in the changed
  files (one inline-UserDefaults-key violation found and fixed).
- python3 desktop/macos/scripts/check_desktop_test_quality.py: OK, debt at or
  below baseline.
- Standalone swiftc build of HomeKnowsComposer.swift +
  HomeKnowsImpressionLedger.swift under -strict-concurrency=complete, driving
  17 rule assertions (shorter-list-not-repeat, all-four-slots-empty, show cap
  in and out of cooldown, dismissal and its content-change return, stale/
  completed exclusion, freshness order, same-day relaxation): ALL PASS. This
  standalone harness exists because the shared branch was mid-flight from
  other workstreams; the committed XCTest suites are the durable coverage.

Failure-Class: FC-durable-state-scoped-to-view-lifetime
The typed lanes end an answer with a question 4-9% of the time; the realtime
voice lane does it 65% of the time and those sessions run ~4 turns. Recall
answers ("what did X say", "when did we...") end with a question 0% of the time
even though 71% of them have a strong next hop into the same source. This is
the client half of inviting that turn.

`ChatPrompts.desktopChat` (the prompt that owns both typed lanes — chat window
and floating-bar typed, via ChatProvider) now asks for exactly one specific,
grounded, answerable question after a `<<<FOLLOWUP>>>` marker, with the same
wording and the same suppression list as the backend lane. `ChatFollowUpTail`
lifts it off the authoritative answer into a `followUp` content block, and
`normalizeStreamingAssistantText` withholds the marker (and any unambiguous
partial one) from the streaming projection so the chip's words never appear in
the prose first and get removed at finalize.

Rendered as one chip under the answer in both shells: the chat window
(`ChatBubble` + `FollowUpChip`, sends the question as a new main-chat turn) and
the floating bar (`AIResponseView` -> `openAIInputWithQuery`, same lane). The
"or hold ⌥ to ask aloud" hint names the shortcut actually bound and is absent
when push-to-talk is off. It is never spoken aloud — it is a control, not
narration — and never rendered mid-stream.

Attribution: `question_asked` gains an `origin` property
(`followup` | `unprompted` | `chip` | `card`, default `unprompted`), added
alongside the existing `surface`/`source`/`message_length` and never replacing
them, so "did Omi invite this question" is answerable at all. A chip arms the
origin at the tap and the first accepted question consumes it, so a send the
provider refuses can never mislabel a later one.

Failure suppression: the floating bar's empty-response copy drops its
"Please try again" invitation — the measured behaviour is that nobody takes it,
they re-send the question themselves — and a failed, empty, or
clarifying-question turn never gets a chip, because the block is appended only
on the provider's accepted-answer path.

Verification:
  desktop/macos/scripts/swift-format-wrapper.sh format -i <changed files>
  python3 desktop/macos/scripts/check_desktop_test_quality.py -> OK (at baseline)
  xcrun swift build -c debug --package-path Desktop
    -> every remaining error in the shared worktree is
       "add missing case: '.memoryReviewCard(...)'" (plus a `maxRows` actor
       error in Dashboard/ChatDailySummaryCard.swift) from a sibling
       workstream's in-flight block type. No error asks for `.followUp`:
       all seven exhaustive switches over ChatContentBlock /
       ContentBlockGroup are updated here. `swift test --filter
       ChatFollowUpChipTests` is owed once that sibling lands and the tree
       compiles.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
…ummary generator

Corrects a false verification claim in 65586c6 and the layering defect it
hid. That commit's message says the focused backend suite passed with one
unrelated timing failure. It did not: the run failed 7 files. My grep for the
reasons matched a single global summary block and reprinted it once per file,
which read like confirmation instead of one repeated block.

Re-read honestly, the run had zero assertion failures — all 7 were test.sh's
fast-unit CPU guard — but two were mine and were real:

  3.72s > 0.30s  test_daily_summary_memories_learned.py::test_response_model_...
  0.77s > 0.30s  test_daily_summary_zero_coordinate_locations.py::test_zero_...

The second is the important one. 65586c6 called the memory selection from
inside generate_comprehensive_daily_summary, so the LLM summary builder gained
a memory dependency: every caller and every existing test of it lazily imported
utils.memory.memory_service and attempted a real MemoryService().read(), whose
failure my broad `except Exception` swallowed. An existing hermetic test was
silently exercising a fail-open Firestore path. The duration guard was the
symptom; the layering was the bug.

- generate_comprehensive_daily_summary now takes `memories_learned=None` and
  external_integrations.py imports nothing from the memory stack. The read
  moves to routers/users.py `_memories_learned_payload`, next to the uid,
  window and storage it already owns.
- Wired at BOTH generator call sites. 65586c6 missed
  regenerate_daily_summary entirely, so regenerating a summary would have
  silently dropped the review card.
- The fail-open read now calls record_fallback (component=daily_summary,
  outcome=degraded) per .github/agent-docs/fallback-telemetry.md. A missing
  card is a correctness change; silent UX healing is allowed, silent ops is not.
- utils/memory/learned_today.py is now a light leaf: `models.memories` moved
  behind TYPE_CHECKING because it pulled in google.cloud.firestore and
  database._client transitively. That import chain was also breaking
  test_daily_summary_race_condition.py (duplicate proto descriptor
  registration) for the workstream importing this module into
  utils/other/notifications.py; that file needs no change on its side.
- The 3.72s was `from routers.users import ...` inside a test body, charged to
  the call phase; hoisted to module scope.

Four regression tests added: the generator does not read memories itself
(source + signature), the endpoint hands its selection to the generator, the
fail-open path records a fallback, and the default-empty case.

Verification (all run after the fix):
  BACKEND_UNIT_TEST_FILE_LIST=<6 daily-summary files> bash test.sh -> RC=0
    no duration-guard failures; only a 0.16s > 0.10s warn (fail limit 0.30) on
    a pre-existing test. test_daily_summary_race_condition.py 16 passed
    (was 8 passed + 8 errors); test_daily_summary_zero_coordinate_locations.py
    2 passed (was 0.77s > 0.30s); this file 29 passed (was 3.72s > 0.30s).
  backend/scripts/typecheck.sh -> 0 errors
  openapi_runner.sh export_openapi.py --surface app-client --check -> up to date
  generate_dart_models.py --all --check -> up to date
  generate_swift_openapi_types.py --check -> up to date
  check_app_client_openapi_compatibility.py --base-ref origin/main -> passed

Still not done: the full 1029-file backend suite (the shared tree carries four
workstreams' in-flight edits) and a live HTTP call against a running server
(no credentials in this worktree).
`dart format` wraps the `..remove('evidence')..remove('content_blocks')` cascade
in app/lib/backend/schema/message.dart across three lines, so the single-line
substring assertion in test_app_client_dart_generator.py could no longer match
once the mobile change added the second remove. The guard now asserts each
operation separately; the expected behaviour (strip both keys before the
generated DTO) is unchanged and is the documented reason for the second remove
(FCM delivers content_blocks as a JSON string, decoded by the adapter).

Co-Authored-By: Claude Fable 5.1 <[email protected]>
…t be corrected

`knowledge_nuggets` is LLM prose about the day with no memory behind it, so the
summary could only *tell* the owner what Omi thinks it learned. There was
nothing to be wrong about: no id to vote on, no row to correct, and nothing a
verdict could travel back to. The backend contract on this branch fixed the
data half (`memories_learned`, plus a `memoryReviewCard` block); this is the
desktop half.

`DailySummaryRecord` now decodes `memories_learned` (optional, defaulting to
empty, tolerant of a field of the wrong shape and of entries with no id or no
content, because one malformed row must not cost the reader the whole summary).
`ChatDailySummaryCard` renders up to three of them as "Things I learned today",
each with a paraphrase, a category label, and three controls — Right, Wrong,
Fix. It never falls back to `knowledge_nuggets`: a nugget cannot be mutated, so
a vote on one would teach extraction nothing. A day that learned nothing renders
no section at all.

Actions go through existing endpoints only. Right is
`POST /v3/memories/{id}/review?value=true`; Wrong is the same route with false,
which already feeds bounded negative feedback into extraction, so "Dropped. I'll
avoid facts like this" is a promise the backend keeps. Fix opens a single-line
inline editor prefilled with the content — Enter saves through
`PATCH /v3/memories/{id}`, Esc cancels. An edit re-enters short-term as a user
assertion for the consolidation job to weigh rather than a promotion, so its
copy is "Updated." and not "Confirmed."

Single mutation owner: the memory API owns the verdict. Nothing is written to
the chat row or to defaults. A row derives its state from the memory's own
`user_review` (and, since the desktop's `ServerMemory` has no `edited`, from the
stored content no longer matching what the summary captured), so a vote on the
phone shows on the Mac. `MemoryReviewReducer` is a pure transition table:
clicking applies an optimistic override, success promotes it to the row's state
and triggers a re-read, failure clears it and says "Couldn't save, try again"
inline. Effects are returned as values rather than invoked as callbacks, so a
nested event can only arrive as another `reduce` call, never against a
half-published transition. A rejected row fades where it stands instead of being
removed, so the click does not reflow every row beneath it. Rows are focusable:
Enter accepts, Backspace/Delete rejects, E opens the editor.

The `memoryReviewCard` block round-trips through `ChatContentBlockCodec` and the
Chat-first validation wire and renders through `MemoryReviewCardView` with the
same row view, so the two arrival paths cannot drift into disagreeing about what
a verdict means. Desktop has no `day_summary` chat row today, so the summary
record is the live path; the block is the shared contract. Passive surfaces
(floating bar, notch, agent pill, voice playback, copied text) treat it the way
they treat the follow-up chip: a control, not narration and not prose.

Telemetry is `memory_review_action` {source, action, outcome, memory_category}
and `memory_review_card_shown` {source, item_count}. Bounded dimensions only:
no memory text, no ids, and an unrecognised category becomes `other` rather than
widening into a free-form field.

Interject is deliberately not wired here. `MemoryReviewRowView` carries a
one-line comment marking where a future "hold ⌥ to correct" hook attaches — it
would drive `.beginEdit` + `.saveEdit`, the same path the inline editor uses.

Verification:
  xcrun swift build -c debug --package-path Desktop -> succeeded
  xcrun swift test --package-path Desktop --filter MemoryReviewCardTests
    -> Executed 25 tests, 0 failures
  ... --filter "ChatDailySummaryTests|HomeDailySummaryTests|MemoryReviewCardTests|ChatContentBlock"
    -> Executed 47 tests, 0 failures
    (both runs required W3's in-flight, currently non-compiling
     HomeKnowsImpressionLedgerTests.swift to be moved aside and restored; it is
     unrelated to this change and is untouched here)
  python3 scripts/check_desktop_test_quality.py -> OK, at or below baseline
  ./scripts/swift-format-wrapper.sh lint <changed files> -> clean

The first run of the reducer suite caught a real defect: `requestSucceeded` was
promoting the optimistic override into `live` without clearing it, so a row
stayed permanently overridden. Fixed, and the empty-read guard now protects a
settled verdict as well as an in-flight one.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Found by the focused suite on the rotation fix. The freshness comparator
tie-broke on the ledger key, which for a question row is a SHA-256 prefix of
its text. Two never-shown candidates therefore sorted by hash, silently
reordering the suggested questions the caller had already ranked: the hub's
prefilled ask became "What did I spend my time on this week?" instead of the
top-ranked "What should I do today?".

`freshnessRank` now returns only the three real freshness terms (never-shown,
fewest shows, most recent update) and the pool sorts with the candidate's
source index as the explicit final tie-break — `sorted(by:)` is not stable, so
the caller's order has to be stated rather than hoped for.

Also fixes the ledger tests' own clock: the 90-day retention prune is now
driven by the injected `now` instead of the wall clock, so a fixture dated in
March does not read as expired debris, and the store/defaults suites build
their main-actor fixtures inside each test rather than in the nonisolated
`XCTestCase.setUp` override.

Verification:
- xcrun swift build -c debug --package-path Desktop: green.
- xcrun swift test --package-path Desktop --filter HomeKnows: 43 tests,
  0 failures (HomeKnowsComposerTests 19, HomeKnowsRotationPolicyTests 13,
  HomeKnowsImpressionStoreTests 7, HomeKnowsImpressionDefaultsTests 4).
  The two ordering assertions above failed before this change and pass after.
- swift-format lint on the four changed files: clean.
- swiftlint-wrapper.sh lint: 0 violations in 1535 files.
- check_desktop_test_quality.py: OK, debt at or below baseline.

Failure-Class: FC-durable-state-scoped-to-view-lifetime
daily_summary_budget.py took the package to 13 source files, past the
architecture guardrail's 12-file threshold, which requires a package-root map.
The map names each module's concern and states that new concerns move out
rather than adding rows.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
…view card, and knows-list rotation

Co-Authored-By: Claude Fable 5.1 <[email protected]>
…MemoryRef

The Windows, web app, admin, and personas clients pin the same app-client
OpenAPI surface; the memories_learned field on DailySummaryResponse regenerates
their omiApi.generated.ts.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
…unction

The guard sliced the first 400 characters after the signature of
_send_bulk_summary_notification and looked for postprocess_executor and
_BATCH_SIZE there. The #12530 fix gave the function keyword-only parameters and
a docstring, which pushed both references past that window without changing
what the function does (it still batches on _BATCH_SIZE and runs each send on
postprocess_executor via run_blocking). The guard now scans the function body
up to the next top-level def, so the contract no longer depends on signature
length. Expected values are unchanged.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
HomePage calls streamDeviceRecording with a null device as a check-only
path. That was minting a recording ID and emitting capture_unavailable on
every entry without a pendant, which made start failures outnumber starts.

Only prepare and failStart when a device was passed or a recording device
is already set.

Failure-Class: none

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Co-authored-by: Cursor <[email protected]>
… cycle

AVAudioPlayerNode.play() raises an uncaught NSException when the engine
has not completed an IO cycle. Guard scheduleBuffer/play with the existing
ObjCExceptionCatcher, skip play when the engine is not running, and
silence the bed after a caught exception so onboarding continues.

Failure-Class: none

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Co-authored-by: Cursor <[email protected]>
…b app

Notes v2 stores conversation.structured.overview as markdown. The share
email escaped each line as plain text and the signed-in web app put the
raw string in a <p>, so two of three surfaces showed literal ## and -. Email
now uses a closed markdown-it-py subset; the web app reuses react-markdown.

Co-Authored-By: cursor grok-4.6 <[email protected]>
Co-authored-by: Cursor <[email protected]>
test_direct_provider_usage_stays_inside_approved_boundaries fails on main,
and not on violations: on stale_allowlist. The allowlist says chat_file.py
makes direct openai.chat.completions calls and the scanner no longer finds
them. The calls are still there; they moved behind _get_async_openai() and
_get_sync_openai(). _dotted_name returns a bare attribute when the receiver
does not resolve, so the chain read as the unowned chat.completions.create
and matched no provider prefix.

The entry was stale to the scanner and true in the code, which is the worst
state for an inventory: deleting it for a green check would have made the
record less honest than the failure.

Resolve a module-level accessor to its provider root by return annotation,
by a returned provider module, or by a returned name bound to a constructor
call, and re-read a call chain that way only after the plain walk matched
nothing. Measured across every scanned file: one newly visible site, already
allowlisted, none lost.

Also record the second direct path in the inventory. It said direct OpenAI
happens only when OMI_LLM_GATEWAY_FEATURE_MODE is off; it also happens on the
is_gateway_model_not_found degrade with feature mode on, and that request
reaches no llm_gateway_attempts row.

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

GET /v3/memories 503s were rendered as "you have no memories". Distinguish
failed fetches from empty accounts and keep knowledge-graph errors off the
raw response body.

Co-Authored-By: cursor grok-4.6 <[email protected]>
Co-authored-by: Cursor <[email protected]>
…rse verdict, and gains a kill switch

An empty or timed-out adjudicator return was treated as a rejection, so
"hey omi" explicit commands fell through to direct_request. Only an
explicit adverse verdict now demotes; WAKE_WORD_ADJUDICATION_ENABLED can
skip the call; explicit_command is evaluated before public_broadcast.

Co-Authored-By: cursor grok-4.6 <[email protected]>
Co-authored-by: Cursor <[email protected]>
Git-on-my-level and others added 5 commits September 3, 2026 01:16
…md past its lean budget

Co-Authored-By: cursor grok-4.6 <[email protected]>
Co-authored-by: Cursor <[email protected]>
The reveal-policy enum had been inserted between ModifierOnlyPTTActivationGate's
documentation and the struct itself, so the gate's docs read as the policy's.
Each type now carries its own comment.

Failure-Class: none
…12657)

Follow-up to #12646/#12653. The reveal-policy enum had been inserted
between `ModifierOnlyPTTActivationGate`'s documentation and the struct
itself, so the gate's docs read as the policy's. Each type now carries
its own comment.

No behaviour change. `swift test --filter
PushToTalkShortcutActivationTests` — 11 tests, 0 failures.

Failure-Class: none
markdown-it-py is in the runtime lock but not the OpenAPI inventory venv, so
importing it from share_email broke route-policy inventory. A closed subset
parser keeps the email HTML safe without that import.

Co-Authored-By: cursor grok-4.6 <[email protected]>
Co-authored-by: Cursor <[email protected]>
Git-on-my-level and others added 26 commits September 3, 2026 03:35
Passing None into the deletion fence made Typesense upserts fail open and
broke isolation stubs that load users/conversations after the plane pin.

Co-Authored-By: cursor grok-4.6 <[email protected]>
Co-authored-by: Cursor <[email protected]>
…sktop-backend workflow (#12660)

## What changed and why

`AGENTS.md` documented `gh workflow run gcp_backend.yml -f
environment=prod -f branch=main`. There is no `branch` input (the API
returns 422). Following that text on 2026-08-18 caused an unintended
production deploy of the wrong service.

The real `gcp_backend.yml` `workflow_dispatch` inputs are `environment`,
`release_sha`, `release_version`, `mode`, `deploy_targets`, and related
hatches. A prod deploy needs a `release_sha` whose Release Eligibility
push run succeeded on the first attempt. That workflow deploys only the
main backend stack. desktop-backend has its own
`desktop_backend_prod.yml`, which requires `release_sha`, typed
confirmation `deploy-desktop-backend-prod`, and a reason.

## Product invariants affected

none

## How it was verified

Read `.github/workflows/gcp_backend.yml` `workflow_dispatch` inputs and
`.github/workflows/desktop_backend_prod.yml` (`release_sha`, `confirm`,
`reason`, `--require-first-attempt`). Confirmed there is no `branch`
input. `python3 .github/scripts/check_agents_md_lean.py` → `ok: 10
AGENTS.md files within budget` (root file 152 lines / 18000 bytes).

Did not dispatch either workflow.

## Tests

No test change: this is a docs correction of the operator command in
`AGENTS.md`. The workflows already enforce the contract.

## Failure class (fixes)

Failure-Class: none


<!-- This is an auto-generated description by cubic. -->
<a
href="https://cubic.dev/pr/BasedHardware/omi/pull/12660?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. -->
…sor (#12662)

## The direct-provider inventory stopped seeing a direct provider call


`backend/tests/unit/test_llm_gateway_coverage_guardrails.py::test_direct_provider_usage_stays_inside_approved_boundaries`
fails on `main` today. Not on `violations` — on `stale_allowlist`. The
allowlist says `utils/other/chat_file.py` makes direct
`openai.chat.completions` calls; the scanner no longer detects them.

The calls are still there. They moved behind accessors:

```python
_async_openai: AsyncOpenAI | None = None

def _get_async_openai() -> AsyncOpenAI: ...
def _get_sync_openai() -> Any: return openai

await _get_async_openai().chat.completions.create(...)   # ~338, ~346
_get_sync_openai().chat.completions.create(...)          # ~390, ~397
```

`_dotted_name` walks an attribute chain and returns `node.attr` when the
receiver does not resolve, so
`_get_async_openai().chat.completions.create` reads as the unowned
`chat.completions.create` and matches no provider prefix. The entry
became stale to the scanner while staying true in the code — which is
the worst state for an inventory to be in, and why deleting the entry to
get a green check would have been the wrong fix.

### What changed

- **`_provider_accessors`** resolves a module-level function to a
provider root by any of three signals, all of which appear in
`chat_file.py`: the return annotation (`-> AsyncOpenAI`), returning an
imported provider module (`return openai`), or returning a name bound to
a direct constructor call (the `global _async_openai` lazy singleton).
`DIRECT_PROVIDER_ROOTS` is derived from `DIRECT_CONSTRUCTOR_NAMES` so
the two cannot drift.
- **`_dotted_name_through_accessors`** re-reads a call chain with the
accessor substituted for its root, and returns `None` rather than a bare
attribute when the receiver is unresolvable — so it never invents a
name.
- **`_direct_provider_uses`** tries the plain walk first and only falls
back to the accessor re-read when nothing matched. Existing detections
are untouched.
- **The inventory** now records the second direct path.
`docs/llm/model_endpoint_inventory.yaml` said direct OpenAI happens
"only when `OMI_LLM_GATEWAY_FEATURE_MODE` is off". It also happens on
the `is_gateway_model_not_found` degrade with feature mode **on**, and
that request is not recorded in `llm_gateway_attempts` and carries no
lane accounting. Both file-chat surfaces now say so.

### Scope of the widening, measured

Scanned every file the guardrail scans, with and without the accessor
re-read:

```
NEWLY VISIBLE:  utils/other/chat_file.py  openai.chat.completions
lost:           (none)
newly visible NOT in allowlist: (none)
```

One site, already allowlisted. No detection lost, no new violation
introduced anywhere in `backend/`.

### Automatic-or-dead check

`test_direct_provider_scan_sees_through_a_provider_accessor` runs the
scanner over a synthetic module exercising all three resolution signals,
so it stays meaningful if `chat_file.py` changes.
`test_direct_provider_scan_reports_the_file_chat_direct_fallback` pins
the live site, because an inventory that silently stops detecting a real
direct provider call is worse than one that never had the entry.

Red-proofs applied and seen red, then reverted:

| Mutation | Result |
| --- | --- |
| drop the accessor re-read in `_direct_provider_uses` | all three tests
red |
| `_provider_accessors` returns an empty map | all three tests red |

11 passed in that file; 27 passed across it plus
`test_chat_file_gateway_surface.py` and `test_chat_file_completions.py`.

### Cut list

- Ledgering the model-not-found degrade, or gating it. It is recorded
here, not changed: file chat is an allowlisted basic-plan feature, so
this is an attribution gap rather than an authorization one, and the fix
belongs to whoever owns the degrade's cost story.
- Teaching the scanner to follow accessors across module boundaries.
Every case found in `backend/` today is module-local.

### Line-count ratchet

No product source grew. The only non-test change is a documentation line
in `docs/llm/model_endpoint_inventory.yaml`.

### Product invariants

- `INV-DATA-1` — no deployment authority, credential or routing change.
The scanner is a test; the inventory is documentation.
- `INV-MEM-4` — no memory promotion, admission or Long-term authority
path is touched.
- `INV-TASK-2` — no task-capture authority path is touched.

### What this was

A static inventory lost sight of the call its own allowlist describes,
because the matcher was a literal attribute chain and ordinary
refactoring moved the call behind an accessor. The allowlist entry that
stayed behind is what turned a silent coverage loss into a visible
failure — the check was right to be red.

🤖 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/12662?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. -->
…d the web app (#12659)

## What changed and why

Notes v2 stores `conversation.structured.overview` as markdown
(headings, bullets, bold), but two of the three surfaces that show it
still treated the field as plain text. The share email escaped each line
and joined with `<br>`, so every external recipient of a notes-v2
summary saw literal `##` and `-`. The signed-in web app put `{overview}`
in a `<p>`. The `h.omi.me` shared page already rendered it with
`markdown-to-jsx`; that is the reference behaviour.

The web app now renders overview through `react-markdown`, which it
already ships (same approach as `AppSummaryCard`). Share email renders a
closed markdown subset in `overview_markdown.py` (stdlib only: headings,
paragraphs, lists, bold, italic, and `http(s)` links). Every text node
is escaped first, so injected HTML from the model never reaches the
email. Quota, idempotency, sender, and subject logic are unchanged.

## Product invariants affected

none

## How it was verified

Red-proof against the unfixed renderers:

- Replacing `_md.render(overview).strip()` with the old
`'<br>'.join(overview.splitlines())` made
`test_build_summary_email_renders_notes_v2_markdown` fail: `assert
'<h2>' in html`.
- Replacing `<ReactMarkdown>{overview}</ReactMarkdown>` with
`{overview}` made both vitest cases fail: `Unable to find an accessible
element with the role "heading" and name "Key points"`; the DOM showed
literal `## Key points`.

After the fix:

- `cd backend && BACKEND_PYTEST_FILE_ISOLATION=1 .venv/bin/python -m
pytest
tests/unit/test_share_email.py::test_build_summary_email_renders_notes_v2_markdown
tests/unit/test_share_email.py::test_build_summary_email_escapes_injected_html
tests/unit/test_share_email.py::test_build_summary_email_plain_text_keeps_line_breaks
tests/unit/test_share_email.py::test_build_summary_email_allows_https_links_only
tests/unit/test_share_email.py::test_build_summary_email_escapes_and_links
-q` → 5 passed.
- `cd backend && BACKEND_PYTEST_FILE_ISOLATION=1 bash
scripts/run-unit-ci.sh --changed-files /tmp/omi-notes-changed.txt` →
exit 0.
- `cd web/app && bunx vitest run --config vitest.config.mts
src/components/conversations/__tests__/ConversationDetailPanel.overview.test.tsx`
→ 2 passed.
- `cd backend && .venv/bin/python -m pyright --pythonpath
.venv/bin/python utils/conversations/overview_markdown.py
utils/conversations/share_email.py` → 0 errors.

Mutation: replacing `_md.render(overview).strip()` with `return
overview` made `test_build_summary_email_renders_notes_v2_markdown` fail
again (`assert '<h2>' in html`). Restored.

Could not exercise a live Resend send or a logged-in browser session
against production data in this worktree; the unit tests drive the same
`build_summary_email` and `SummaryTab` paths those surfaces use.

## Tests

- `backend/tests/unit/test_share_email.py`: notes-v2 sample renders
`<h2>`/`<ul>`/`<ol>`/`<strong>` rather than literal `##`/`-`; injected
`<script>` is escaped; pre-v2 plain-text overviews still keep line
breaks; `javascript:` links are not emitted as `href`.
-
`web/app/src/components/conversations/__tests__/ConversationDetailPanel.overview.test.tsx`:
heading and bullet list render as elements on both overview call sites
(full-width and beside the location map).

## Failure class (fixes)

Failure-Class: FC-serialiser-dialect-mismatch-retypes-values


<!-- This is an auto-generated description by cubic. -->
<a
href="https://cubic.dev/pr/BasedHardware/omi/pull/12659?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. -->
…ait, and an exit (#12595)

## Why

A conversation that is still being summarized renders as
**"Processing…"** with a fallback 💬, a pulsing pill that promises
"shortly" without a bound, and a client that silently stops checking
after ~230 s. Meanwhile the transcript is already in the local cache and
on the detail endpoint, the backend flips `completed` before
memories/action items run, `/reprocess` works from a `processing` row,
and free-tier desktop rows sit on `processing` forever by design
(`deferred=true`, nothing running). None of that reached the UI.
"Pending/zombie conversations" is a top user-complaint cluster, and the
2026‑08‑30 finalization outage ran six hours with every row looking like
this screenshot.

## What changes (macOS only, no backend changes)

**1. Status is never the title.** The title slot shows the first
substantive transcript line (`Let's go over the launch timeline for next
week`), or `Recording at 11:12 PM` when no transcript is loaded. The
pill carries status. No fake 💬: a waveform tile until the pipeline
produces an emoji. List refreshes keep an already-loaded transcript when
the server list omits `transcript_segments` (omitted = not loaded, not
empty).

**2. Bounded wait with an exit.** Pill reads `Summarizing` → `Taking
longer than usual` (2 min, orange) → `Stuck` (10 min, red) on a 15 s
`TimelineView` that only live-pipeline rows pay for. Stuck rows show
**Reprocess** inline on the row and in the detail banner. A new
`ProcessingConversationWatcher` follows every visible processing row to
a terminal state with 3→60 s backoff and never gives up while the row is
visible; the detail view's poll uses the same backoff instead of 15×2 s.

**3. Two waves.** When status flips to `completed` the row gets its real
title and shows `· Adding memories & tasks…` for a 45 s grace, then
refetches once so action items land without a manual refresh.

**4. Deferred ≠ processing.** Free-tier desktop rows now read **Tap to
summarize**, are not timed, and are not polled. The detail banner says
"Summarizing now…" for them, which is what opening actually does.

**5. Continuity.** When a capture stops, the Live card's slot is held by
a "Saving" card (last transcript line) until the next conversations load
lands the row; row insertion animates. The flag is set where a finished
recording enters the lifecycle and cleared in `loadConversations`, so
every stop path (user stop, automation stop, max-duration rotation)
shares one clear.

**6. Telemetry to tune the thresholds.** `Conversation Processing
Completed {elapsed_seconds, outcome}` and `Conversation Processing
Stalled {elapsed_seconds}`, emitted once per conversation by the
watcher. Nothing measures processing latency today; the 2/10 min
thresholds are a starting point to be re-set from the measured p95.

## Product invariants affected

- INV-NAV-1 — touched by path only (`ConversationRowView.swift`,
`ConversationsPage.swift`). The Conversations page keeps every control
and destination; this adds row states and a transient card above the
list, it does not introduce a reduced copy or occlude top-navigation
controls.

## Not in scope
Percentage progress (no honest denominator), streaming partial
summaries, and the `merging` state for overlapping phone + desktop
captures.

## Verification
- `xcrun swift build -c debug` green on the rebased tree.
- New behavioral tests (injected clock/sleeper, no wall-clock waits):
`ConversationProcessingProgressTests`,
`ProcessingConversationWatcherTests`,
`ConversationProcessingTelemetryTests`; extended
`ConversationDisplayStateTests`,
`ConversationReconciliationPolicyTests`. 88 tests across the touched
suites + `ShellGlassChromeTests` pass.
- swift-format and SwiftLint clean. Oversized-file ratchet satisfied by
splitting: the detail banner is its own component
(`ConversationProcessingBanner`), the two analytics methods live in
`AnalyticsManager+ConversationProcessing`, and
`AppState+Transcription.swift` is untouched.
`check_desktop_test_quality.py` reports the same pre-existing baseline
drift (55/149 vs 54/147) with this branch stashed, so it is not
introduced here.
- **Not dogfooded in a named bundle yet.** The
row/badge/banner/saving-card states are unit-tested at the model layer
and compile, but I have not watched a live capture land through the new
flow. Reviewer or I should run `OMI_APP_NAME=omi-processing-row
./run.sh`, stop a recording, and confirm: Saving card → row with
transcript-line title and `Summarizing` pill → real title → `Adding
memories & tasks…` → clears.

🤖 Generated with [Claude Code](https://claude.com/claude-code)
…n-200 (#12654)

## What changed and why

During the 2026-08-17/18 `/v3/memories` 503 outage (1,498 × 503 and zero
200s for 5.5 hours), the Flutter client returned `GetMemoriesResult([],
…)` for any non-200, so every mobile user saw an empty memories list: an
outage delivered as apparent data loss, with no error in telemetry. This
PR distinguishes a failed fetch from a genuine empty account, shows a
retryable "Couldn't load memories" state, reports the failure through
the existing `crashReporter.reportCrash` path used by other
`app/lib/backend/http/api/` callers, and stops printing knowledge-graph
`response.body` on screen.

The 400 + `thisDeviceOnly` legacy fallback is unchanged: a backend that
does not support `device_scope=current` still refetches without that
query and sets `deviceScopeSupported: false` so local device filtering
is skipped.

## Product invariants affected

INV-MEM-1 (`app/lib/pages/memories/**`). This PR does not change product
memory tiers, default access, or canonical collections. It only stops a
non-200 memories fetch from rendering as an empty successful list.

## How it was verified

Toolchain: `PATH` put `~/fvm/versions/3.44.5/bin` first (Flutter 3.44.5
/ Dart 3.12.2).

Red-first (unfixed helper, 2026-09-03): `flutter test
test/unit/memories_http_result_test.dart
test/unit/knowledge_graph_error_message_test.dart` — 1 passed, 5 failed.
A 503 produced `ok == true`; the knowledge-graph message contained
`SECRET_INTERNAL_TRACE`.

After the fix: the same tests plus provider and widget coverage passed
(45 tests including existing memories deletion/ledger suites).

Mutation: omitting `failureReason` on non-200 and interpolating `$body`
into the knowledge-graph message made those tests fail again (`ok ==
true` on 503; message contained the body). Restored.

`dart analyze` on the touched Dart files: no errors; 4 pre-existing
infos (`avoid_print`, deprecated Share) not introduced here. Analyzer
ratchet was not baselined.

`flutter gen-l10n` still warns 2 untranslated messages per locale
(`memoryHistoryPartial`, `tapPlusToStartRecording`). Those keys are
missing on `origin/main` as well; this PR's two new keys are present in
all 49 ARBs.

`bash test.sh` in `app/`: `06:24 +1687 ~5: All tests passed!`

## Tests

- `app/test/unit/memories_http_result_test.dart` — 503 / null /
decode-failure are failed results, not empty success; a 200 `[]` remains
a genuine empty account.
- `app/test/providers/memories_provider_load_failure_test.dart` — failed
fetch sets `showLoadError`; a failed refresh keeps previously loaded
memories; a later 200 clears the error.
- `app/test/widgets/memories_load_error_test.dart` — failed state
renders the retry affordance, not "No memories yet".
- `app/test/unit/knowledge_graph_error_message_test.dart` — user-facing
knowledge-graph copy does not contain the response body.

## Failure class (fixes)

Failure-Class: FC-denial-rendered-as-empty-success

Existing class. Its five prior declarations are backend/MCP and
Bluetooth/Gmail permission surfaces; this is the generic Dart "any
non-200 → empty list" instance that produced the 2026-08-17 user-visible
shape. No registry edit in this PR.

## Sweep: `return []` / `return const X([])` on non-200 in
`app/lib/backend/http/api/`

Fixed here:

- `memories.dart` `getMemoriesResult` — the incident path. Null, non-200
(except the 400 `thisDeviceOnly` fallback), and 200-decode failure now
carry `failureReason` + status. Telemetry: `Logger.error` +
`PlatformManager.instance.crashReporter.reportCrash` (same mechanism as
`conversations.dart` / `apps.dart`).
- `knowledge_graph_api.dart` — opposite polarity: non-200 no longer
interpolates `response.body` into the thrown message; body is
`Logger.debug` only. `memory_graph_page.dart` renders
`couldNotLoadKnowledgeGraph`, not `e.toString()`.

Left (not the identical two-line change; each needs its own result type
/ UI):

- `memories.dart:195,205` `getLedgerHistory` — non-200 is "history
projection unsupported" by contract, not "account has no history";
current list stays usable.
- `memories.dart` `getMemories()` wrapper — still returns `.memories`
only; `score_widget.dart` is the remaining caller and is outside this
surface.
- `conversations.dart:104-115` `getConversationsResult` — already
returns `ok: false` on non-200 (the pattern this PR copies).
- `conversations.dart:220,231` `listGoogleCalendarEvents` — picker
helper; empty on error is "no events to pick".
- `conversations.dart:243,256` (calendar overlap helper) — same
picker-style empty.
- `conversations.dart:824,831` `getActionItems` — empty
`ActionItemsResponse` on non-200, same class, separate list UI.
- `conversations.dart:843,851` `getConversationSuggestedApps` — catalog
empty on error.
- `users.dart:219,232` `getAllPeople` — people list empty on non-200.
- `users.dart:559,566` `getDailySummaries` — summaries empty on non-200.
- `speech_profile.dart:67,79` `getExpandedProfileSamples` — samples
empty on non-200 (`72,76` are decode/shape guards on 200).
- `phone_calls.dart:90,95` `getVerifiedPhoneNumbers` — numbers empty on
non-200.
- `messages.dart:67,87` `getMessagesServer` — chat empty on non-200
(`74` is empty 200 body).
- `imports.dart:145,149` `getImportJobs` — jobs empty on non-200.
- `goals.dart:231,248` `getAllGoals` — goals empty on non-200.
- `folders.dart:11,23` `getFolders` — folders empty on non-200.
- `apps.dart:56,76,203,208,456,466,473,483,554,564,625,634,690,699` —
catalog/enabled/review list helpers empty on non-200 or caught decode;
several already `reportCrash` on the catch path.
- `announcements.dart:33,73` — changelog/pending lists empty on non-200.

## New guards (only when adding a check or ratchet)

None.


<!-- This is an auto-generated description by cubic. -->
<a
href="https://cubic.dev/pr/BasedHardware/omi/pull/12654?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. -->
… fix, knows-list rotation (#12635)

## Summary

Four engagement fixes from the 2026-09-02 "Ask, Teach, Prove"
evaluation, shipped together because they share one contract (the daily
summary's `memories_learned` review card) and one measurement
(`question_asked` origin attribution).

1. **Follow-up after every grounded typed answer.** On the owner's
account the realtime voice lane already ends 65% of answers with a
grounded question and those sessions run ~4 turns; the typed lanes end
with a question 4–9% of the time and recall answers 0%, while 57% of
asker-days are exactly one question. The agentic chat lane and the
desktop typed lanes now append exactly one specific, answerable question
after a `<<<FOLLOWUP>>>` tail; the backend strips the tail and delivers
it as a `followUp` content block, a streaming filter keeps it out of the
prose, and both shells render it as one tappable chip. Suppressed in
code (not just prompted) on failed, errored, cut-short, empty, or
clarifying turns; the floating bar's failure copy drops its "try again"
invitation, which the data showed nobody took.
2. **"Things I learned today" review card** in the daily summary on both
shells. The summary's `knowledge_nuggets` were LLM prose with no memory
identity, so there was nothing to accept or reject. The summary now
carries `memories_learned` (up to three memories the day's conversations
actually produced, selected deterministically through `MemoryService`,
zero new LLM calls) and the `day_summary` message carries a
`memoryReviewCard` content block. Rows offer ✓ / ✗ / Fix through the
existing review and edit endpoints, and the memory service stays the
single mutation owner. State is read from the local memory rather than
re-fetched: a vote made on this device is mirrored immediately, and a
vote made on the phone appears once the memory sync has run. There is no
single-memory GET to make that read authoritative, so "instantly
cross-device" is not claimed. ✗ already feeds bounded rejection feedback
into extraction, so the "I'll avoid facts like this" copy is true.
3. **#12530: daily summaries silently stopped for tail-of-batch users**
(on the owner's account, since 2026-08-23). Per-user isolation, a
per-user budget, a job budget under the 600s task limit with a Redis
checkpoint that rotates the next run to the unserved tail, a bounded
generator input, and loud per-user failure lines plus a job-end summary.
Fixes #12530.
4. **Home knows-list repetition.** The list repeated the same four stale
commitments 8–12 times each over two weeks because its dismiss state
died with the view. An owner-scoped impression ledger now rotates rows
out after three unopened shows, never resurrects a dismissed row until
its content changes, excludes stale or completed tasks, and leaves a
slot empty rather than repeating.

Also: `question_asked` gains an `origin` property (`followup | chip |
card | unprompted`) so each surface's funnel is readable, and
`daily_summary` fallback telemetry is registered.

Evidence: omi-knowledge-base `projects/engagement-feedback-loop`,
`macos-churn-analysis/evidence/2026-09-02-first-48h-activation-and-pr-12608.md`,
and the follow-up-vs-pills evaluation (session scratchpad, 143 turns /
48 sessions).

## Review round: what the bot found, and what was true

`cubic-dev-ai` raised 40 findings. Each was verified against the code
path before
anything changed; several were wrong about the mechanism while right
about the
symptom, and a few were simply wrong. Fixed, with the load-bearing ones
first:

- **The review card never shipped.** The scheduled job called the
summary
generator without `memories_learned`, so the field was always empty and
the
`memoryReviewCard` block was never attached on the only path users
receive.
The feature was a no-op in production. Both senders now select through
one
  helper.
- **The failure copy was read aloud.** This PR changed the
empty-response text
while `shouldSpeak` still suppressed one hardcoded string, so a failed
voice
query started speaking its own failure. Copy and guard now share one
source.
- **The server rejected the card the Mac sends.** The desktop adapter
converts a
`memoryReviewCard` for the chat-first journal, but the block was not in
the
server union, so it was rejected as `invalid_request`. Added to the
*request*
union only: the server never emits this block, and adding it to the
response
  union is a breaking change to a released app-client contract.
- **The streamed follow-up tail leaked.** `ChatStreamingBuffer` wrote
the
normalized projection back into the message and appended the next delta
to it,
so a projection that withholds the tail lost the evidence it needed and
streamed the chip's question into the prose a token at a time. A replay
of
every flush boundary leaks at every boundary from the delimiter onward,
not
only at a split marker. Display-only, since the terminal answer
overwrites it.
- **The checkpoint could not resume.** The cursor key carried the UTC
hour, so
the run that wrote the tail and the run that should have resumed it
never
shared a key, which defeated the point of the #12530 fix. Also: a failed
  timezone chunk let the run call itself complete and clear the cursor.
- **The FCM payload was unbounded.** An oversized card would have cost
the whole
daily-summary push, not just the card. Now bounded, block dropped first.
- Plus: multi-question chips, chips on guard-stopped turns,
generic-prefix rules
that diverged between client and server, a permanent optimistic override
on
mobile, a duplicated question when a follow-up block had no prose,
per-item
decoding so one bad row cannot drop the array, owner-scoped knows-list
visits,
  and greeting counts that disagreed with the rows they described.

Three findings were **rejected with evidence** rather than fixed: the
claim that
the stream filter persists its withheld suffix (the persisted answer is
built by
the producer, and flushing would have pushed the fragment *into* the
stream);
the prescription to reclassify a safety-guard stop as a provider failure
(an
explicit, tested contract says a guard stop is a deliberate reply); and
a pytest
marker that would have removed a file from CI entirely. Mobile
localization stays
deferred, matching every neighbouring widget.

## End-to-end coverage: made real, not declared

An earlier commit on this branch satisfied `desktop-e2e-flow-coverage`
by adding
`covers:` entries to two flows that never exercise the code. The gate is
a text
match over the `covers:` list and never inspects steps, so the claim
cost
nothing to write and would have given false confidence. Those entries
were
removed, and the coverage was then built for real. Three new or extended
flows:

- **Chat follow-up.** The hermetic stub can now emit a follow-up tail,
the chat
automation snapshot exposes the chip question, and a bridge action taps
the
chip and reports the origin the analytics emit actually carried. The
flow
asserts the visible answer by exact equality, which is what catches a
tail
  left in the prose.
- **Memory review card** (`memory-review.yaml`). A local-only
dev-harness route
  seeds a summary; the flow creates the memories through the production
endpoint, renders the card, accepts one row and rejects another through
the
same store the buttons call, then re-reads to prove both verdicts
survive the
  post-mutation refresh.
- **Knows-list rotation** (`home-knows-rotation.yaml`). Seeds tasks,
clears the
ledger through the same persistence the mutations use, and pins the
first
visit's rows, the within-visit de-duplication, and a later visit's view
of a
  dismissed row and a merely-shown row.

`ChatStreamingBuffer` was initially judged uncoverable, because the
defect is
mid-stream and the terminal answer overwrites the streamed text before
any
assertion runs. That is true of assertions on the final text only. A
non-prod
probe now keeps its own raw stream, compares every emitted projection
against
the shipped tail-stripping rule, and the flow asserts zero leaks
alongside two
liveness assertions so the zero cannot be vacuous. A negative-control
unit test
feeds the probe the exact projection the pre-fix buffer emitted and
asserts it
is counted.

Three things are deliberately **not** claimed, and say so next to their
`covers:`
entry: the empty-slot telemetry (forcing it would require owning the
account's
whole candidate pool), the three-show cap (it needs three calendar days
or an
injected clock, and is unit-tested instead), and the 14-day stale-task
rule,
which is unreachable from the hub because the dashboard query already
cuts off
at seven days. That last one is a real finding and wants a follow-up.

## Invariants

Path-matched by `scripts/pr-preflight --suggest`:

- INV-AUTH-1: no change to auth; touched routers only add response
fields and a content block.
- INV-CHAT-1: chat continuity preserved; the follow-up block rides the
persisted message and the terminal frame, never a second message.
- INV-NAV-1: no navigation changes; the follow-up chip sends in the same
lane.
- INV-VOICE-1: realtime hub prompt untouched; the floating bar's failure
copy changed only to remove a retry invitation.
- INV-MEM-4: no new promotion path. An edit re-enters short-term as
user-asserted and consolidation decides; a ✓ is a review, not a
promotion.
- INV-MEM-1: memory reads go through `MemoryService`; the summary stores
memory ids, never a second copy of review state.

## Failure class

Failure-Class: FC-batch-fault-domain-head-of-line-poison

That is the PR-level declaration (the #12530 fix). The protocol allows
one per PR body; the other two fix commits carry their own trailers and
are recorded here for the reader:

<!--
Failure-Class: FC-durable-state-scoped-to-view-lifetime (b8fd1ef,
47d5d96: knows-list dismiss state died with the view)
Failure-Class: FC-model-import-reaches-persistence-client (a7aba22:
the first contract commit read memories inside the LLM summary
generator, pulling the Firestore client into every caller and hermetic
test of it; the read now lives at the endpoint and learned_today is an
import-pure leaf)
Failure-Class: FC-projection-fed-its-own-output (c164760b6b:
ChatStreamingBuffer wrote the normalized projection back into the
message and appended the next delta to it, so a projection that
withholds text lost the evidence it needed on the next flush)
-->

- `b8fd1ef8e8` / `47d5d96fb9`: FC-durable-state-scoped-to-view-lifetime.
The knows-list dismiss state was a view `@State` and died with the view.
- `a7aba22030`: FC-model-import-reaches-persistence-client. The first
contract commit read memories inside the LLM summary generator, which
pulled the Firestore client into every caller and every hermetic test of
that generator; the read now lives at the endpoint and `learned_today`
is an import-pure leaf.

## Line-count exceptions

Line-Count-Exception: backend/routers/chat.py | 2097 -> 2107 | follow-up
block attached where the assistant message is persisted; splitting the
router is out of scope
Line-Count-Exception: backend/routers/users.py | 2247 -> 2295 |
memories_learned wired at both summary call sites next to the uid/window
they own
Line-Count-Exception: backend/utils/retrieval/agentic.py | 1690 -> 1736
| prompt section appended beside the existing url-fetching block; the
live prompt is LangSmith-fetched so this is the only place it takes
effect
Line-Count-Exception:
desktop/macos/Desktop/Sources/FloatingControlBar/FloatingControlBarView.swift
| 3090 -> 3112 | exhaustive switch cases for the two new block types
Line-Count-Exception:
desktop/macos/Desktop/Sources/FloatingControlBar/FloatingControlBarWindow.swift
| 5735 -> 5752 | exhaustive switch cases for the two new block types
Line-Count-Exception:
desktop/macos/Desktop/Sources/MainWindow/Components/ChatBubble.swift |
2032 -> 2082 | follow-up chip and review card render cases in the
authoritative bubble renderer
Line-Count-Exception:
desktop/macos/Desktop/Sources/MainWindow/Pages/DashboardPage.swift |
4186 -> 4328 | knows-list impression handoff; the ledger and policy live
in new files
Line-Count-Exception:
desktop/macos/Desktop/Sources/Providers/ChatProvider.swift | 7156 ->
7200 | streaming tail filter and block cases; the parser lives in
Chat/ChatFollowUpTail.swift

## Verification

- `make preflight`: all manifest checks pass except the line-count
ratchet, cleared by the exceptions above.
- Backend: `bash test.sh` over the changed and neighbouring test files
(follow-up block, daily-summary contract, job resilience, race
condition, zero-coordinate locations, stream error fallback, Dart/Swift
generator guards) green under the duration guard; `typecheck.sh` 0
errors; OpenAPI app-client export written, public and integration
surfaces `--check` clean, compatibility passed against merge-base
`f50229752b`; Dart and Swift generators `--check` clean.
- Desktop: `swift build -c debug` green; `swift test` for
`ChatFollowUpChipTests`, `MemoryReviewCardTests`, `HomeKnows*`,
`ChatDailySummaryTests`, `HomeDailySummaryTests`, `ChatContentBlock*`
(see the last CI-equivalent run in the PR checks); swift-format and
SwiftLint clean; `check_desktop_test_quality.py` at baseline.
- Mobile: `bash app/test.sh` all passed (+1695); `analyze_ratchet.sh`
passed; `dart format` clean.

## Not done here

- No dogfood on a signed-in bundle: the review card needs a deployed
backend that emits `memories_learned`. Dogfood owed before beta
promotion. The desktop mirror write on a review vote has no hermetic
test (it talks to the real storage singleton), so that is the first
thing to check by hand.
- **None of the three new or extended e2e flows has been executed.**
Tier 2 needs Docker, and `docker info` fails on the authoring machine.
Both sides of every string they assert are pinned by unit tests so drift
fails in seconds rather than only at flow time, and the streaming probe
has a falsifiable negative control. But someone with Docker must run
`chat-hermetic`, `memory-review`, and `home-knows-rotation` before these
are trusted. Two knows-list step expectations in particular rest on a
reading of the composer's slot ordering that only a real run can
confirm.
- An unserved user is still not re-queried an hour later:
`get_users_for_daily_summary` matches `local_hour == preference`, so
eligibility lasts exactly one local hour and the checkpoint only
recovers the tail if the job runs more than once per hour. The repo
disagrees with itself about the cadence and the real Cloud Scheduler
setting is not in the tree; worth confirming.
- Interject "hold ⌥ to correct" is not wired to the review rows
(one-line hook comment marks the spot).
- Mobile strings are hardcoded English, matching the adjacent chat
chrome; l10n follow-up owed.
-
`tests/unit/test_daily_memory_sweep.py::test_folder_backstop_never_overwrites_and_requires_obligation`
hangs on an idle machine and is in CI's selector; pre-existing, tracked
separately.
- From the #12530 watchdog thread, two items need a maintainer and are
not in this PR: the scheduler runs `*/1 * * * *` instead of hourly, and
`day_summary_webhook` is fire-and-forget on `postprocess_executor` and
dropped at job exit.
- The summary generator receives a bounded conversation set; a truncated
day reports the truncated count and emits
`daily_summary_input_truncated`, but the prompt carries no in-text
marker.

🤖 Generated with [Claude Code](https://claude.com/claude-code)
…t badge on the download page

The download landing page ended in a grey text block titled "Installation
steps:" with a 1./2./3. list. Replaced it with three illustrated cards below
the demo video, built from the real Omi and Applications icons rather than
clip art: open omi.dmg from Downloads, drag Omi into Applications, open Omi
from Applications. Windows gets the same three-card shape with the
SmartScreen step it actually needs.

Also adds the Product Hunt badge above the fold for the Omi Desktop launch.
It gates itself on a launch-window constant and renders nothing once the
window closes, so nobody has to remember to take it down. Product Hunt bakes
the vote count into the SVG, so the badge URL's cache-buster is bucketed by
the hour instead of the embed snippet's fixed timestamp, which would have
frozen the count at whatever a visitor loaded first.

Verification: hit GET /v2/desktop/download/latest through the ASGI app with
the release fetch stubbed, then rendered the exact response body in headless
Chrome at 1100px and 500px. Badge, three cards and the responsive stack all
render; an overflow probe reports scrollWidth == clientWidth with no element
past the viewport edge. backend/tests/unit/test_desktop_updates.py: 135
passed. Note: the badge currently shows "???" for the count because Product
Hunt has not made post 1240025 live yet — other post ids return real numbers
through the same widget, and it fills in on its own at launch.
…/updates.py

The landing page grew past the product file line-count ratchet on updates.py.
The appcast/update-routing logic and the marketing-facing download page change
for unrelated reasons, so they get separate modules rather than a line-count
exception. Names become public at the module boundary and every in-tree caller
moves in this commit; no aliases stay behind in updates.py.

backend/routers/updates.py: 1539 -> 1290 lines.
…er extraction

updates.py no longer references datetime or timezone; the badge window lives in
desktop_download_page.py now.
…is written on (#12667)

## What changed and why

The account-deletion auth fence read `account_deletions/{uid}` through
`get_firestore_client()` (compute plane). The deletion executor writes
that marker on the customer data plane. On Omi Beta (desktop-backend)
the planes differ, so the lookup missed cleanly, returned `None`, and a
user whose deletion was in progress kept reading and writing production
data. HTTP 503 only fired on an exception, never on a clean miss.

Writers and readers now share one accessor,
`account_deletion_firestore_client()` in
`backend/database/account_deletion_marker.py`, which pins
`get_data_plane_firestore_client()`. If that client cannot be resolved,
the fence fails closed (503). Sibling per-user markers that had the same
reader/writer split are pinned the same way.

## Product invariants affected

- INV-MEM-1
- INV-MEM-3
- INV-MEM-4
- INV-CUTOVER-1

## How it was verified

- Guard test:
`backend/tests/unit/test_account_deletion_auth_fence.py::test_auth_fence_refuses_when_the_deletion_marker_is_only_on_the_data_plane`
runs the production fence (`enforce_account_deletion_http_access` →
`get_user_deletion_wipe_status`) with two fake Firestore clients
(compute empty, data plane holding `wipe_status=running`) and asserts
HTTP 403.
- Fail-closed:
`test_auth_fence_fails_closed_when_the_data_plane_client_cannot_be_resolved`
asserts HTTP 503 when the data-plane client cannot be resolved.
- Red-proof: mutating `account_deletion_firestore_client` to `return
get_firestore_client()`:

```
FAILED test_auth_fence_refuses_when_the_deletion_marker_is_only_on_the_data_plane
FAILED test_auth_fence_fails_closed_when_the_data_plane_client_cannot_be_resolved
Failed: DID NOT RAISE <class 'fastapi.exceptions.HTTPException'>
2 failed in 0.59s
```

Restoring the data-plane accessor: `15 passed in 0.69s`. Reintroducing
the same fallback: `Failed: DID NOT RAISE HTTPException` again (`1
failed in 0.65s`).
- Isolation stubs that `load_module_fresh` `database.users` /
`database.conversations` now export `get_data_plane_firestore_client` so
the new import does not die at collection time. Typesense upserts
default to `data_plane_db` (matching Pinecone) instead of passing `None`
into the fence.
- CI-shaped backend unit run: `cd backend &&
BACKEND_PYTEST_FILE_ISOLATION=1 bash scripts/run-unit-ci.sh
--changed-files <changed-files>`.
`test_mentor_notifications.py::test_process_mentor_proactive_notification_sends`
hangs past 90s on this branch **and** on `origin/main` `e37febd0b3`
(unmocked `current_date_for_uid` → live `db.collection('users')` with
ADC); it is not this fence change.
- Pyright on the changed backend files: 0 errors.

Could not exercise a live Beta request against production Firestore (no
production access). The two-plane unit test is the behavioral stand-in
for that path.

## Tests

Regression that would have caught the bug:
`test_auth_fence_refuses_when_the_deletion_marker_is_only_on_the_data_plane`.
Existing fence, cutover, and BYOK tests keep their importer-binding
patches.

## Failure class (fixes)

Failure-Class: FC-plane-seam-adopted-by-reader-not-writer

Line-Count-Exception: backend/utils/subscription.py | 1680 -> 1682 |
screen-vector entitlement pins customer Firestore with provision=False

## Rollback hazards

- Desktop-backend without `OMI_FIRESTORE_DATA_PLANE_PROJECT` fails
closed (HTTP 503) on every authenticated request instead of serving.
That env var is already required on desktop-backend; this makes the
deletion fence honor it.
- A data-plane service-account / `OMI_FIRESTORE_DATA_PLANE_PROJECT`
mismatch still raises (existing `_build_data_plane_firestore_client`
behavior) and now maps to 503 on the fence.
- Screen-vector entitlement uses `provision=False` plus the customer
Firestore client. A miss now defaults to basic (no cloud screen vectors)
instead of JIT-creating a subscription doc. Lookup exceptions still fail
open and write vectors (existing fail-open).
- Legal-hold acquire/finish on the wipe executor no longer injects
compute `database_client.db`. On a split plane the gate and the marker
stay on the data plane together; rolling back re-splits them.
- Memory write fences that used to pass a compute-default client now
omit it so the shared accessor resolves the data plane. Typesense
upserts default to `data_plane_db` (same as Pinecone) and pass that
client into the fence. If the data plane cannot be resolved, those
writes fail closed instead of proceeding.
- Rolling this PR back reopens the Beta deletion-fence miss: a deleting
account keeps access.
- Goals, memory ledger, MCP OAuth, first-open obligations, and
knowledge-ledger **read** tools now default to the data plane. On GKE
with `SERVICE_ACCOUNT_JSON` that coincides with the old client.

## Named sibling seams

| Seam | Verdict |
|---|---|
| BYOK key lookup (`utils/byok.py` → `users.get_byok_state`) |
**Fixed.** `get_byok_state` / `set_byok_active` / `clear_byok_active`
use `get_data_plane_firestore_client()` (`users.py:285`, `:331`,
`:337`). |
| Screen-vector entitlement with `provision=True` | **Fixed.**
`grants_cloud_screen_vectors` now calls
`get_user_valid_subscription(...,
firestore_client=get_customer_firestore_client(), provision=False)`
(`subscription.py:144-146`). Entitlements stay on the customer client,
not the data-plane user-doc client. |
| Web-search opt-out | **Fixed.** `get_assistant_settings` /
`_get_raw_assistant_settings` / `update_assistant_settings` read and
write `users/{uid}` through `get_data_plane_firestore_client()`
(`users.py:2204`, `:2217`, `:2249`). |
| Pinecone wipe fence | **Fixed.** `vector_db.py` defaults to
`data_plane_db` and `external_write_fence` uses that client
(`vector_db.py:15`, `:50`). `memories.py:46` / `:54` omit an injected
client so the shared accessor resolves the data plane.
`atom_keyword_index.py` imports `data_plane_db as default_db_client` and
passes that resolved client into the fence (`atom_keyword_index.py:16`,
`:297`), matching Pinecone. |

Also pinned in this sweep (same reader/writer class):

- Deletion marker R/W: `account_deletion_firestore_client()` imported by
`users.py`, `legal_holds.py`.
- Wipe executor legal-hold acquire/finish: dropped
`firestore_client=database_client.db` so the accessor owns the plane
(`account_deletion.py` `background_wipe_user_data`).
- Canonical derived purge and maintenance-registry delete:
`get_data_plane_firestore_client()`.
- Account cutover control docs: `get_data_plane_firestore_client()`
(`account_cutover.py:25`, `:180`).
- First-open obligations: `get_data_plane_firestore_client()`
(`first_open_obligations.py:13`, `:94`).
- Goals: `_get_db` prefers `get_data_plane_firestore_client`
(`goals.py:60`).
- Memory ledger: `data_plane_db` (`memory_ledger.py:22`).
- MCP OAuth: `data_plane_db` (`mcp_oauth.py:15`).
- Knowledge-ledger **read** tools: `get_data_plane_firestore_client()`
(`knowledge_ledger_tools.py:325+`). Write tools already threaded a
data-plane client.

## Remaining `get_firestore_client()` readers of deletion / JIT /
cutover collections

Verified against a backend-wide grep of `get_firestore_client()` after
the sweep.

| Site | Why it is already correct, or remaining |
|---|---|
| `account_deletion_transitions.py:21`
`read_agent_vm_migration_journals` | **Verified-safe.**
`users/{uid}/agentVmMigrations` is compute-local (GCE / `agentVm`). Must
keep `get_firestore_client()`. |
| `users.py:2110` `get_agent_vm` | **Verified-safe.** Reads
compute-local `agentVm` on `db`. |
| `users.py:1751`, `:1796` location-context consent | **Verified-safe
for this class.** Reader and writer share `get_firestore_client()`;
there is no reader/writer split. On GKE, `SERVICE_ACCOUNT_JSON` makes
this the data plane. |
| `users.py:1678` `get_user_subscription` | **Verified-safe for the
named seam.** Defaults to `db`; screen-vector now injects
`get_customer_firestore_client()`. Quota/paywall callers that need
production entitlements already pass the customer client. |
| `users.py:1304` `delete_user_data` | **Verified-safe.** Wipe runs on
GKE, where `SERVICE_ACCOUNT_JSON` makes `db` the data plane. Not the
Beta serving-plane split. |
| `account_deletion_projection_fence.py:22` | **Verified-safe.**
Requires an injected `db_client`. Callers (`memory_system.py:52`,
`canonical_memory_adapter.py:3545`, `daily_memory_sweep.py:2853`,
`jit_proactivity_store` via `data_plane_db`) pass the data-plane client.
|
| `jit_proactivity_store.py:83` | **Verified-safe.** Defaults to
`data_plane_db`; reads `account_deletions/{uid}` on that client. |
| `knowledge_ledger_writer_transition.py:399` `_client_or_default` |
**Verified-safe.** Default is `get_firestore_client()`, but production
`knowledge_ledger_migration.py:344` always threads `db_client`. |
| `canonical_graph.py:89`, `routers/knowledge_graph.py:73`, `:258` |
**Remaining default, GKE-coinciding.** Graph routes run on the GKE
backend, where `SERVICE_ACCOUNT_JSON` makes `get_firestore_client()` the
data plane. Not served on desktop-backend. |
| `memories.py:125` `_get_db` | **Remaining default for memory
**writes**.** The deletion **fence** no longer uses this client. Memory
document CRUD still defaults to `get_firestore_client()`; GKE coincides.
|
| `mcp_api_key.py:41`, `dev_api_key.py:34` | **Verified-safe.**
Credential wipe runs on GKE; `SERVICE_ACCOUNT_JSON` is the data plane. |
| `conversations.py`, `action_items.py`, `recording_sessions.py`, and
other `get_firestore_client()` user-subtree modules | **Remaining
GKE-coinciding defaults.** The deletion executor wipes `users/{uid}`
through `delete_user_data` on GKE (`db` == data plane). These are not
the Beta auth-fence path. Migrating every user-doc default is a
follow-up, not this fence fix. |

## New guards

The two-plane auth-fence unit test is the recurrence guard for this
class on the deletion marker. It is not a repo-wide plane-seam checker
because the plane is a runtime client identity, not a static import
graph; a shared primitive that grepped `get_firestore_client()` would
false-positive every compute-local `agentVm` path. The real merged
instance this would have caught is the 2026-08-30 adversarial finding
(same class as PR #12402).


<!-- This is an auto-generated description by cubic. -->
<a
href="https://cubic.dev/pr/BasedHardware/omi/pull/12667?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. -->
Auto-generated: consolidates unreleased changelog fragments into
v0.12.273 and regenerates CHANGELOG.json.
…dge on the download page (#12670)

## What

Two changes to the desktop download landing page
(`/v2/desktop/download/latest`).

**1. Install steps are illustrated cards now, not a text block.** The
page ended in a grey box titled "Installation steps:" holding a
`1./2./3.` list joined by `<br>`. It now renders three cards below the
demo video, drawn with the real Omi app icon and the macOS Applications
folder icon: open `omi.dmg` from Downloads, drag Omi into Applications,
open Omi from Applications. Windows keeps the same three-card shape with
the SmartScreen step it actually needs.

**2. Product Hunt badge for the launch, above the fold.** It is gated on
a launch-window constant and renders nothing once the window closes, so
it takes itself down instead of needing a follow-up PR.

Two details worth calling out:

- The badge URL's cache-buster is bucketed by the hour rather than using
the embed snippet's fixed `t=1788421572228`. Product Hunt bakes the vote
count into the SVG itself, so a fixed value pins every visitor to
whatever count was rendered when they first loaded the page.
- The count currently renders as `???` because Product Hunt has not made
post `1240025` live yet. Other post ids return real numbers through the
same widget, so this is the post's state and not a broken embed; it
fills in on its own at launch.

The second commit moves the landing-page HTML into
`backend/desktop_download_page.py`. `routers/updates.py` crossed the
product file line-count ratchet, and the appcast routing and the
marketing page change for unrelated reasons, so they get separate
modules rather than a line-count exception. Every in-tree caller moved
in the same commit and no aliases stay behind. `routers/updates.py`:
1539 → 1290 lines.

## Product invariants

- **INV-BETA-1** — matched by path glob on `backend/routers/updates.py`.
Behavior unchanged: this PR only touches the HTML the download landing
page returns. Beta app identity, the packaged beta artifacts, and the
identity-aware appcast feed are untouched, and the 135 tests in
`test_desktop_updates.py` (which cover the identity-aware feed) still
pass.

## Verification

Exercised the real endpoint rather than the template: called `GET
/v2/desktop/download/latest?platform=macos&channel=stable` through the
ASGI app with the GitHub release fetch stubbed, then rendered the exact
response body in headless Chrome. Re-ran this after the module split,
not just before it.

- 1100px: badge renders, three cards render, old list gone
(`"Installation steps:" not in response`)
- 500px: cards stack to one column; an in-page overflow probe reports
`scrollWidth == clientWidth` with zero elements past the viewport edge
- Both landing assets return HTTP 200 from the same public bucket the
page already uses for its demo video
- `backend/tests/unit/test_desktop_updates.py`: **135 passed**
- `make preflight`: all manifest checks pass

New tests cover what can silently rot: the three macOS steps, the
Windows SmartScreen step, steps rendering after the video, badge present
inside the window, badge empty at and after the window boundary, and the
cache-buster advancing with the hour.


<!-- This is an auto-generated description by cubic. -->
<a
href="https://cubic.dev/pr/BasedHardware/omi/pull/12670?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. -->
…rse verdict, and gains a kill switch (#12671)

## What changed and why

An empty wake-word adjudication (provider timeout, exception, or no
overlapping invocation) was treated as a rejection: `not
relevant_verdicts or` demoted extractor `explicit_command` to
`direct_request`, so "hey omi, remind me to X" landed in the review
queue or was dropped. Only an explicit adverse verdict now demotes.
`WAKE_WORD_ADJUDICATION_ENABLED` (default on) skips the LLM call
entirely and keeps the deterministic marker. `explicit_command` is
evaluated before `public_broadcast`, so the first producer of that
unused signal cannot drop a spoken command.

INV-TASK-2 deleted `create_direct`; an admitted explicit command is
`pending_candidate`, which is what the ordering test asserts.

## Product invariants affected

- INV-TASK-2
- INV-MEM-4 (path glob on `backend/deploy/runtime_env.yaml` only; this
PR does not change promotion authority)

## How it was verified

Red-proof (regression tests written first; mutation after the fix):

- Restoring `not relevant_verdicts or` fails:
`test_empty_adjudication_leaves_extractor_explicit_command_intact`
(`assert False is True`)
`test_adjudicator_exception_leaves_extractor_explicit_command_intact`
(`assert False is True`)
- Putting `public_broadcast` above `explicit_command` fails:
`test_explicit_command_wins_over_public_broadcast` (`assert 'ignore' ==
'pending_candidate'`)
- After restore: 15 passed in
`tests/unit/test_wake_word_adjudication_failsafe.py`

CI-shaped backend unit run (file isolation) over the mapped subset (new
failsafe tests, capture/wake-word tests, composed `runtime_env.yaml`
workflow-contract tests): 25 files, 0 failed, including 99 passed in
`test_backend_runtime_env_validator.py`. Pyright on the production
capture modules and the new test file: 0 errors.

Not verified: a live conversation through production listen/reprocess.
No production access. The selector's unmapped-path fallback would select
the full backend unit suite for `backend/deploy/runtime_env/_base.yaml`
and `backend/utils/task_intelligence/` (pre-existing; mapping those in
the selector or `workflow_contracts.json` itself forces a full-suite
path). A prior full-suite attempt saturated the host (load 400+); CI
will run that fallback.

## Tests

`backend/tests/unit/test_wake_word_adjudication_failsafe.py`:
- empty adjudication / adjudicator exception → `explicit_command` intact
- explicit adverse verdicts still demote
- kill switch off: adjudicator not called; on (`None`/`true`/`on`/`1`):
called
- `public_broadcast=True` + explicit command that meets the capture
floor → `pending_candidate`
- flag declared on both `gke/backend-listen` and `cloud_run/backend`

Cloud Run validator fixtures inject
`WAKE_WORD_ADJUDICATION_ENABLED=true` the same way as the notes-v2
flags, so a deploy that omits it on the reprocess host fails validation.

## Failure class (fixes)

The violated contract is "an absent signal treated as a negative
verdict": a completed-empty adjudication (or a caught timeout that
returns `WakeWordAdjudication()`) was folded into the same branch as
`question` / `quoted_or_meta`. No existing class names that exact gate.
`FC-proven-empty-rendered-as-denial` is the nearest: a proven-empty
result was rendered as a denial rather than as "no opinion".
`FC-recoverable-provider-failure-terminal` covers only the timeout path,
not a successful empty return. Did not add a registry entry.

Failure-Class: FC-proven-empty-rendered-as-denial

## Follow-up (maintainer)

The LLM adjudicator is unchanged (model, `reasoning_effort='high'`,
prompt). It changed 0 outcomes in 15 measured calls at ~35× the marker's
cost. Desktop PR #11801 solves the same false-positive problem
deterministically. `EVIDENCE_BACKED_WAKE_WORD_VARIANTS` was not touched.


<!-- This is an auto-generated description by cubic. -->
<a
href="https://cubic.dev/pr/BasedHardware/omi/pull/12671?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. -->
A Firestore .get() error after the data-plane client has already resolved
must be HTTP 503, not a clean miss. Pin grants_cloud_screen_vectors at
provision=False so a missing customer subscription doc cannot JIT-write.

Co-Authored-By: cursor grok-4.6 <[email protected]>
Co-authored-by: Cursor <[email protected]>
…eams

first_open_obligations, goals, and knowledge_ledger_tools are not reachable
from desktop-backend; their sibling readers/writers still default to compute.
Restoring origin/main avoids landing those dormant plane splits.

Co-Authored-By: cursor grok-4.6 <[email protected]>
Co-authored-by: Cursor <[email protected]>
## What exists today (measured, not assumed)

`GET /v1/action-items` was **65.6% of all backend requests** and
**48.8% of every billable Firestore document read** (~$328/day) until
#12258 made the
`action_items:list` policy immune to `RATE_LIMIT_BOOST`, so its 12/min
per-uid cap
finally started firing. That fix worked, and it is not undone here.

I re-measured the route this afternoon before writing any code.

**Prometheus, 24h means (2026-09-02):**

| | before #12258 | now |
| --- | ---: | ---: |
| `action_items_list` docs/sec | 6,600 | **692** |
| `action_items_list` ops/sec | 121 | **3.11** |
| **docs per operation** | 54.5 | **~223** |
| `action_items_list` share of `stackdriver_..._document_read_count` |
48.8% | **~13%** |

**Cloud Run, untruncated fixed window 2026-09-02T17:46–17:49Z (545
requests, read-only capture):**

- **3.03 req/s** (was 128–132), **97 distinct remote IPs** — the drop
came from each
  client polling less, not from clients disappearing.
- **480 × 200, 64 × 429 (11.7%), 1 × 401.** 63 of the 64 429s are
`omi-windows`.
- Client mix: **490 `omi-windows`, 31 `Dart`, 23 macOS `CFNetwork`, 1
`Bun`.**
- Query mix: `limit=500&offset=0&completed=false` 223,
`...&completed=true` 194,
  `limit=50` 37, `limit=100` 31, `offset=500` 28.

Two things follow, and they are the whole design rationale:

1. **The remaining problem is fan-out, not frequency.**
Documents-per-operation went
*up*, 54.5 → ~223, because the cheap requests are exactly the ones the
cap removed.
What survives is large-backlog accounts re-reading an unchanged backlog
on every
   allowed poll — 12 full backlog reads per minute per uid, forever.
2. **The stale fleet is still the traffic.** 90% of surviving requests
are the pre-fix
`omi-windows/1.0.0` build asking for `limit=500`, two weeks after its
client-side fix
(`65249902cb`, `SYNC_THROTTLE_MS = 5 min`, `PAGE_LIMIT = 100`) merged.
Its rollout is
   still unobservable, so the backstop has to be server-side.

**Honest scoping, stated up front:** at 692 docs/sec this route is now
~**$32/day**
(marginal $0.05395/100k) out of a `App Engine | Cloud Firestore Read
Ops` line running
**$376.71/day** (mean of the six complete post-ship days 08-27…09-01).
*This route is no
longer what dominates that line.* This PR takes the rest of it and caps
the regression
path; it does not claim the other ~$340/day, which is uninstrumented
read volume and
needs its own attribution work.

## What changes

Three things, each independently disableable by one env var.

### 1. Repeat polls read zero Firestore documents
(`database/action_items_cache.py`)

A per-uid Redis response cache for the **unfiltered** listing (98.6% of
measured
traffic), plus an `ETag` / `If-None-Match` → **304** path.

- **Key** is `ail:{uid}:{version}:{param fingerprint}`. The version is a
per-uid counter
that **every action-item write bumps** — one `INCR`, no key enumeration,
no
per-mutation invalidation list to drift out of sync. Invalidation is
hooked into all
12 mutating helpers in `database/action_items.py`, plus the two writers
that touch the
collection from outside that module (`goals.transition_goal_lifecycle`'s
`detach`
  disposition and `staged_tasks.restore_legacy_conversation_items`).
- **The TTL is the safety net, not the mechanism.** If a future writer
forgets to bump,
the worst case is bounded staleness of
`ACTION_ITEMS_LIST_CACHE_TTL_SECONDS`
(default **30s**, clamped to 300), never a permanently wrong list. The
version key's
own TTL is 7 days so a version can never expire back onto a live cached
entry.
- **Truncated pages are never cached** — caching a budget-exhaustion
artifact would pin
  a partial page for the whole TTL and make a client's retry free.
- Date- and conversation-scoped reads bypass the cache entirely (rare,
high cardinality).
- Redis is **fail-open**, matching `_enforce_rate_limit`'s first-party
contract: an
outage degrades to today's behaviour (a real read), never to a wrong
answer.

**Why zero UX impact for an up-to-date client:** any write by that user
— from any
device, including the server-side conversation pipeline — bumps the
version and the next
read is fresh. The only staleness window is a write that does not go
through the hooked
paths, bounded at 30s. macOS and Flutter already reconcile at a 5-minute
cadence.

### 2. A second, stricter ceiling for the hot-loop client class
(`utils/action_items_list_guard.py`)

`action_items:list_hot_client`, default **4/60s per uid**, env-tunable
via
`ACTION_ITEMS_LIST_HOT_CLIENT_MAX` (0 disables). Returns 429 with
`Retry-After`.

**It composes with the existing limiter rather than conflicting with
it.** Two
independent Redis buckets: every client is still governed by
`action_items:list`
(12/min), charged in the auth `Depends()` before the route body; a
client *additionally*
classified as the hot-loop build is charged this second bucket inside
the route, before
any Firestore work. Both must admit. Nothing about the existing policy's
key, window, or
value changes, and the new policy is added to
`RATE_LIMIT_BOOST_EXEMPT`'s default for
the same reason as its parent — a cap chosen to stop a hot loop is not
something an
event boost should widen 100×.

Classification is deliberately narrow: only the exact
`omi-windows/1.0.0` product token
counts as `stale_windows`. An unrecognised or absent user agent is
**not** classified,
because a misclassification here degrades a real client and the 12/min
policy already
covers the general case. (The stale build sends no
`X-App-Platform`/`X-App-Version` on
this route, so the UA token is the only available discriminator.)

Blast radius: the ~90 hot-loop clients see a refresh every ~15s instead
of every ~5s.
Their data stays correct, and that build already has 429-storm handling
(`53d5b9e54a`, `observability/backendDegraded.ts`).

### 3. Metrics that prove it (`utils/metrics.py`)

- `omi_action_items_list_cache_total{outcome}` — `hit | not_modified |
miss | bypass | unavailable`.
- `omi_action_items_list_throttled_total{client,policy}` — 429s by
client class.

These exist because the last three mitigations on this route were all
*merged and inert*
in production, and nobody could tell for a week. `hit`/`not_modified`
are, by
construction, the requests that performed **zero** Firestore reads.

### What I did not build: the minimum-client-version gate

**The backend has no client-version gate pattern to reuse**, so per the
brief I am
proposing rather than inventing one. What exists is
`routers/firmware.py`'s `min_version`
(device firmware, not API clients) and `routers/desktop_chat.py:1592`'s
`426 Upgrade
Required` for a *chat contract* version — neither is a general client
gate, and there is
no `X-App-Version` header on this route to gate on. A proper version
gate would need
(a) the Windows client to send `X-App-Platform`/`X-App-Version` on
`apiFetch` as it
already does for JIT and listen, (b) a shared
`utils/client_version_gate.py` reading a
per-platform minimum from env, and (c) a client that renders "update
required" instead
of retrying. That is a cross-tree change with a client release in it; it
should be its
own PR, and it is strictly worse than this one as a *first* move because
it depends on
the same unobservable auto-update reach that made the server-side
backstop necessary.

### Can `completed=false` and `completed=true` be served from one read?

Not for these callers, and I would not change it here. The
`completed=None` path already
reads both buckets in one request (active-first, then completed,
product-sorted) — but
that returns one merged page, not the two bucket-scoped pages the
Windows client asks
for, and swapping them changes pagination semantics for every client.
The realistic wins,
both taken or already present: both buckets now share **one**
invalidation version, so a
single write invalidates the pair and a paired poll costs at most one
read per bucket per
TTL instead of two per cycle; and `GET /v1/action-items/ids?completed=`
already exists as
the projection-only reconciliation path (`action_items_visible_ids`, 67
docs/sec in prod)
for clients that only need the id census.

## Expected saving, and its basis

Basis:
`avg_over_time(sum(rate(omi_firestore_documents_per_operation_sum{family="action_items_list"}[1h]))[24h:10m])`
= **691.9 docs/sec** = 5.98e7 reads/day; marginal price
**$0.05395/100k** (OLS on 14
complete billing-export days, r = 1.00000,
`evidence/2026-08-26-c006-falsification.md`)
→ **$32.3/day** is the entire remaining prize for this family.

At a 30s TTL the cache bounds an idle user's polls to **2 Firestore
reads/min** instead of
12 — an 83% ceiling reduction — and the docs/op histogram says the hit
rate will be high
(25.7% of these requests read zero documents even before caching).
Discounting for
write-driven misses and the uncached filtered reads:

> **Expected: $20–27/day (~$7–10k/year)**, taking the line from a
$376.71/day six-day
> mean to roughly **$350–357/day**. Not a headline number — the headline
was already
> taken by #12258 (−$172.73/day, −31.4%, holding six days).

## Kill-check — the metric that decides this within 24h of deploy

Measured 24h after the revision is confirmed *serving* (revision env /
release SHA, never
merge status). Drop the newest two Cloud Monitoring buckets.

**Primary (mechanism, decides it):**

1.
`sum(rate(omi_action_items_list_cache_total{outcome=~"hit|not_modified"}[1h]))
/ sum(rate(omi_action_items_list_cache_total[1h]))`
≥ **0.5**. Below 0.3 → the cache is not being hit and the change did not
work; roll back.
2.
`avg_over_time(sum(rate(omi_firestore_documents_per_operation_sum{family="action_items_list"}[1h]))[24h:10m])`
   < **250 docs/sec** (from 691.9). ≥ 500 → not supported.
3.
`avg_over_time(sum(rate(omi_firestore_read_operations_total{family="action_items_list"}[1h]))[24h:10m])`
   < **1.2 ops/sec** (from 3.11).

**Void conditions (re-run, do not record a result):**

- Distinct `remoteIp` on `/v1/action-items` in a 60s window drops below
**60** (from 97) —
a drop that comes from clients disappearing is churn or an outage, not a
saving.
- `omi_action_items_list_throttled_total` rises for any `client` other
than
`stale_windows` — that is a misclassification, and the ceiling should be
zeroed.
- `/v1/action-items` non-200/429 rate above 1%.

**Money (confirmatory, 7 days):** `App Engine | Cloud Firestore Read
Ops` net $/day,
complete days only (verify `MAX(usage_end_time)`), against the
08-27…09-01 mean of
$376.71/day. Expect **$350–357/day**. This line is no longer dominated
by this route, so
it cannot decide the change on its own — that is what the mechanism
checks are for.

## Rollback

Both levers are env vars on the serving revision; neither needs a code
deploy:

- `ACTION_ITEMS_LIST_CACHE_TTL_SECONDS=0` — disables the cache and the
304 path entirely;
  every read goes straight to Firestore, exactly as today.
- `ACTION_ITEMS_LIST_HOT_CLIENT_MAX=0` — disables the second ceiling;
the 12/min
  `action_items:list` policy is untouched and keeps enforcing.
- `RATE_LIMIT_BOOST_EXEMPT` still accepts an explicit list if the new
policy needs to go
  back under the global boost.

## Tests

`backend/tests/unit/test_action_items_list_read_cost.py` — 25 tests.
They assert the
*cost* property, not just the body: a cache hit and a 304 are pinned to
**zero calls to
`action_items_db.get_action_items`**, the one function that streams
documents. A test
that only checked the response would pass on a design that reads
Firestore and throws the
result away — which is exactly the failure this change exists to
prevent. Also covered:
write-driven invalidation, truncated pages never cached, filtered reads
bypassing,
TTL clamping and typo tolerance, Redis-outage fail-open on both the
cache and the ceiling,
the ceiling refusing *before* the database call, non-hot clients never
touching the second
bucket, the `0` kill switch, UA classification (including "a UA that
merely mentions
Windows is not the hot-loop build"), and RFC 9110 `If-None-Match` weak
comparison.

## Self-test — the real HTTP path, not the function

Unit tests call the handler directly, which does not exercise FastAPI's
response
handling. I also drove the router over HTTP with `TestClient` (fake
Firestore rows, fake
Redis, `ACTION_ITEMS_LIST_CACHE_TTL_SECONDS=30`,
`ACTION_ITEMS_LIST_HOT_CLIENT_MAX=2`),
counting calls to `action_items_db.get_action_items` across the
sequence:

```
1  first        200 db_calls= 1 etag= W/"c000909dde9858350f2836fa6d929047"
2  repeat       200 db_calls= 1 same_body= True
3  If-None-Match 304 db_calls= 1 len(body)= 0
4  after write  200 db_calls= 2
5  hot 1/2/3 -> 200 200 429  retry_after= 11  db_calls= 4
6  mac after hot refusals -> 200

omi_action_items_list_cache_total{outcome="hit"} 1.0
omi_action_items_list_cache_total{outcome="not_modified"} 1.0
omi_action_items_list_cache_total{outcome="miss"} 5.0
omi_action_items_list_throttled_total{client="stale_windows",policy="action_items:list_hot_client"} 1.0
```

Line 2 and line 3 are the change: the repeat poll and the conditional
request both return
without `db_calls` moving. Line 4 shows a write invalidating. Line 5
shows the hot-loop
ceiling refusing the third request with `Retry-After` and no database
call, and line 6
shows a macOS client is unaffected by those refusals (separate bucket,
separate key).

**Gates run locally:** `make preflight` — **28/28 pass**.
`scripts/typecheck.sh` — 0
errors. `scripts/scan_async_blockers.py --dirs routers utils` — 0
blocking findings.
Backend unit suites (run per file; batching these files has a
pre-existing cross-module
import-pollution artifact on `main` as well):
`test_action_items_list_read_cost` 25
passed, `test_rate_limiting` 84 passed/1 skipped,
`test_action_items_pagination_order` 11
passed, `test_action_items_router_pagination` 4 passed,
`test_action_item_ids_endpoint` 13
passed, `test_action_items_conversation_list_malformed` 3 passed,
`test_action_item_canonical_contract` 18 passed,
`test_mcp_action_item_writes` 43 passed,
plus `test_rate_limit_cache_cap`, `test_rate_limit_json_failopen`,
`test_action_item_dedup`, `test_action_item_date_validation`,
`test_action_items_date_coercion`,
`test_action_items_due_range_index_contract`,
`test_conversation_action_items_count`, `test_action_items_timezone`,
`test_action_items_date_range_validation`,
`test_action_item_reminder_cancel_on_complete`,
`test_action_item_vector_best_effort` — all green.

Failure-Class: none

This is a cost control on a route that is behaving as designed, not a
repair of a
semantic defect. `scripts/failure-class prepare` found no definition
whose scope hints
overlap the change. (The nearest historical class,
`FC-alert-never-provably-fired`,
belongs to #12258 — a limiter that shipped and never fired — and is
already fixed; the
two new counters here exist so this change cannot repeat it.)

Line-Count-Exception: backend/database/action_items.py | 1543 -> 1562 |
one `bump_action_items_list_version(uid)` call after each of the
module's committed writes, plus the import; the module is the canonical
mutation owner for this collection, so splitting it to add cache
invalidation would move the invalidation away from the writes it must
follow

🤖 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/12618?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. -->
…12625)

* fix(desktop): read Automation status when System Events is stopped

The Permissions page reported Automation as "Not Granted" on a Mac where
System Settings showed the System Events toggle on, and no amount of
reopening the page or reactivating the app moved it.

`AEDeterminePermissionToAutomateTarget` answers -600 (procNotFound)
whenever its target is not running, and System Events is a background-only
app that exits as soon as it goes idle — which is its normal state. The
passive probe treated that as "no new information" and preserved whatever
the app already believed, and from a cold launch that belief is the `false`
default of `hasAutomationPermission`. So the row settled on Not Granted for
the whole session and every refresh re-confirmed it.

Verified on the reporting machine: with System Events stopped, the shipped
probe returns -600 and the same probe with the launch step returns 0.

The request path already knew this — `SBAutomationConsent` starts the target
before asking. Give it a non-prompting status read that does the same and
point the passive probe at it, so both paths share one mechanism.
LaunchServices sends no Apple Event and `askUserIfNeeded: false` cannot
raise a dialog, so the read stays silent.

-600 preservation stays as the fallback for a target that will not start.

Also stop the chat permission tool from re-deriving `status == noErr`
itself: on -600 it wrote a held permission away as missing, and clobbered
the flag the Permissions page was showing. It now takes the same projection,
for the reason the accessibility branch beside it already documents.

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

* fix(desktop): run the chat permission probe off the main actor

The passive automation probe learned to start System Events, which makes
it blocking: LaunchServices can take up to ~5s on a cold target. Both
remaining call sites in ChatToolExecutor (@mainactor) still invoked it
synchronously — the check-status tool froze the chat window for the
duration of that wait, and the request tool's completion handler ran it
inside Task { @mainactor … }.

Route the probe through Task.detached(priority: .userInitiated) at both
sites, the same rule AppState.refreshAutomationPermission already
follows, and add a source-contract regression test so the probe cannot
silently move back onto the main actor.

Verification: xcrun swift test --package-path desktop/macos/Desktop
--filter AppStatePermissionProbeTests (14 passed, incl. new
testChatPermissionStatusProbeNeverRunsOnTheMainActor) and
--filter SBOnboardingPermissionFlowTests (17 passed).

Failure-Class: none

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

* fix(desktop): move the source-inspection escape onto the checked line

The new main-actor regression test's escape comment sat three lines
above the `String(contentsOf:)` call it was meant to cover.
check_desktop_test_quality.py only looks at the offending line and the
one immediately before it, so the escape never registered and the
ratchet counted the site as new debt (55/148 against a 54/147
baseline), failing CI on Hygiene and both Desktop Swift jobs.

Failure-Class: none

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

* fix(desktop): match the public web search prompt's live "thoroughly" wording

HubEscalationTests.testPublicWebPromptIsSpeakableAndExcludesPrivateToolContext
still asserted the pre-bce354d767 prefix. That commit (2026-09-02, "preserve
realtime voice context boundaries") added "thoroughly" to
RealtimeHubTools.publicWebSearchPrompt's opening sentence without updating
this assertion. It went unnoticed because CI path-filters skip the Swift jobs
unless desktop/macos changes, and this is the first PR to touch that path
since the commit landed — it fails only on the PR's merge-ref combination
(this branch's test + main's current prompt text), not on either tip alone.

Verified locally against the actual refs/pull/12625/merge combination
(6/6 HubEscalationTests pass) and via full pr-preflight (22/22).

Failure-Class: none

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

* test(desktop): keep web prompt assertion wording-stable

---------

Co-authored-by: Claude Opus 5 <[email protected]>
Co-authored-by: David Zhang <[email protected]>
Auto-generated: consolidates unreleased changelog fragments into
v0.12.274 and regenerates CHANGELOG.json.
… plane splits (#12674)

## What changed and why

Follow-up to merged #12667. The deletion fence itself is on `main`. The
adversarial review of that PR found no blocking defect; this change
lands the two remaining should-fix guards and stops creating dormant
plane splits.

Writers and readers of `account_deletions/{uid}` already share
`account_deletion_firestore_client()` →
`get_data_plane_firestore_client()`. A resolved-client Firestore
**read** error (timeout, `ServiceUnavailable`) already propagated to
HTTP 503, but swallowing only `snapshot.get()` into `None` left every
fence test green. This PR drives `enforce_account_deletion_http_access`
through the real `get_user_deletion_wipe_status` with a resolved
data-plane client whose `.collection().document().get()` raises, and
asserts 503.

`grants_cloud_screen_vectors` already called
`get_user_valid_subscription(...,
firestore_client=get_customer_firestore_client(), provision=False)`.
Flipping `provision` back to `True` JIT-writes `plan: basic` onto a
missing customer subscription doc, and no test failed on that flip. This
PR adds a source pin and a behavioral test: a missing subscription doc
with the customer client must not call `user_ref.set` and must resolve
to basic. Lookup exceptions still fail open.

#12667 also pinned `first_open_obligations.py`, `goals.py`, and the
three `get_data_plane_firestore_client()` injections in
`knowledge_ledger_tools.py`. Those modules are unreachable from
desktop-backend, and their sibling readers/writers of the same
collections still default to the compute client. This PR restores their
`origin/main` (pre-#12667) behaviour exactly, including the test-stub
exports that existed only for those pins, so those three do not land as
dormant `FC-plane-seam-adopted-by-reader-not-writer` splits. Every other
pin from #12667 stays.

## Product invariants affected

none

## How it was verified

-
`test_auth_fence_fails_closed_when_the_resolved_data_plane_read_raises`
drives `enforce_account_deletion_http_access` → the real
`get_user_deletion_wipe_status` in `account_deletion_marker.py` with a
resolved data-plane client whose `.get()` raises, and asserts HTTP 503.
Baseline with the new test: `16 passed`.
- Red-proof (review §6 mutation a2: wrap only `snapshot.get()` in
`except Exception: return None`):

```
FAILED tests/unit/test_account_deletion_auth_fence.py::test_auth_fence_fails_closed_when_the_resolved_data_plane_read_raises
Failed: DID NOT RAISE <class 'fastapi.exceptions.HTTPException'>
1 failed, 15 passed in 0.29s
```

The other 15 fence tests stay green on that swallow. Restoring the
uncaught `.get()` returns `16 passed`.
-
`test_screen_vector_entitlement_does_not_write_when_customer_subscription_doc_is_missing`
drives `grants_cloud_screen_vectors` with a customer client whose
`users/{uid}` doc is missing; `user_ref.set` is not called and the
in-memory plan is `PlanType.basic` (not entitled).
`test_screen_vector_entitlement_reads_customer_firestore_without_provisioning`
source-pins `get_customer_firestore_client()` and `provision=False`.
Flipping `provision=False` back to `True`:

```
FAILED test_screen_vector_entitlement_reads_customer_firestore_without_provisioning
assert 'provision=False' in source
FAILED test_screen_vector_entitlement_does_not_write_when_customer_subscription_doc_is_missing
AssertionError: Expected 'set' to not have been called. Called 1 times.
2 failed in 1.94s
```

Lookup exceptions still fail open
(`test_the_entitlement_gate_fails_open`).
- CI-shaped backend unit run: `cd backend &&
BACKEND_PYTEST_FILE_ISOLATION=1 bash scripts/run-unit-ci.sh
--changed-files <changed-files>`. `first_open_obligations.py` selects
the full backend unit suite.
`test_mentor_notifications.py::test_process_mentor_proactive_notification_sends`
hangs past 90s on this branch **and** on current `origin/main`
`77575a8f7f` (unmocked `current_date_for_uid` → live
`db.collection('users')` with ADC); it is not this change.
- Pyright on the changed backend production files: 0 errors.
- Line-count ratchet: `OK: no unapproved line-count increase across 3
changed product source file(s).` No `Line-Count-Exception` (the #12667
`subscription.py` 1680→1682 growth is already on `main`).

Could not exercise a live Beta request against production Firestore (no
production access). The two-plane unit test remains the behavioral
stand-in for that path.

## Tests

-
`test_auth_fence_fails_closed_when_the_resolved_data_plane_read_raises`
-
`test_screen_vector_entitlement_reads_customer_firestore_without_provisioning`
-
`test_screen_vector_entitlement_does_not_write_when_customer_subscription_doc_is_missing`

Existing fence, cutover, BYOK, goals, first-open, and knowledge-ledger
tests keep their importer-binding patches. The goals / first-open /
knowledge-ledger isolation stubs no longer export
`get_data_plane_firestore_client` because those modules no longer import
it.

## Failure class (fixes)

Failure-Class: FC-plane-seam-adopted-by-reader-not-writer

## Rollback hazards

- Reverting the three unreachable pins restores pre-#12667 compute
defaults for first-open, goals, and knowledge-ledger **read** tools. On
GKE with `SERVICE_ACCOUNT_JSON` those accessors still coincide with the
data plane. On a split plane they again match their compute-default
siblings (`conversations.py` CRUD, `action_items.py` /
`task_intelligence_control.py`, `MemoryService` / canonical adapter).
- Mixed desktop-backend fleet (from #12667, still true): during a mixed
desktop-backend rollout, old revisions read BYOK and assistant settings
on the compute plane and will miss values the new revision wrote. That
is mixed-fleet degradation (BYOK looks unenrolled; web-search opt-out
looks absent/allowed), not a deleting account reopening. Old Cloud Run
`backend` sees the same data plane because its accessors coincide.
- Screen-vector entitlement stays at `provision=False` plus the customer
Firestore client. A miss defaults to basic (no cloud screen vectors)
instead of JIT-creating a subscription doc. Lookup exceptions still fail
open and write vectors.
- Rolling this follow-up back re-introduces the three dormant
reader/writer splits on first-open, goals, and knowledge-ledger tools.
It does not reopen the Beta deletion-fence miss.

## Named sibling seams

| Seam | Verdict |
|---|---|
| BYOK key lookup (`utils/byok.py` → `users.get_byok_state`) | **Fixed
in #12667.** `get_byok_state` / `set_byok_active` / `clear_byok_active`
use `get_data_plane_firestore_client()` (`users.py:285`, `:331`,
`:337`). |
| Screen-vector entitlement with `provision=True` | **Fixed in #12667;
ratcheted here.** `grants_cloud_screen_vectors` calls
`get_user_valid_subscription(...,
firestore_client=get_customer_firestore_client(), provision=False)`
(`subscription.py:144-146`). A missing customer subscription doc does
not call `user_ref.set`. Lookup exceptions still fail open. |
| Web-search opt-out | **Fixed in #12667.** `get_assistant_settings` /
`_get_raw_assistant_settings` / `update_assistant_settings` read and
write `users/{uid}` through `get_data_plane_firestore_client()`
(`users.py:2204`, `:2217`, `:2249`). |
| Pinecone / Typesense wipe fence | **Fixed in #12667.** `vector_db.py`
defaults to `data_plane_db`; `atom_keyword_index.py` imports
`data_plane_db as default_db_client`. |
| Deletion marker, legal holds, cutover, memory ledger, MCP OAuth |
**Fixed in #12667; kept.** Reachable from desktop-backend, or no
compute-default sibling on the same collection. |

## Follow-ups

Next instances of `FC-plane-seam-adopted-by-reader-not-writer`. Move
each module together with its sibling(s) in one change; do not pin the
reader (or writer) alone.

- `backend/database/first_open_obligations.py` — sibling
`backend/database/conversations.py:561` (CRUD defaults at `:795`,
`:835`, `:919`, `:1624` also `get_firestore_client()`). Same
`users/{uid}/conversations/{id}` family (`jit_first_open` lives on the
conversation). Not reachable from desktop-backend.
- `backend/database/goals.py` — siblings
`backend/database/action_items.py:53` (`firestore_client or db`) and
`backend/database/task_intelligence_control.py:20` (`from
database._client import db`). Same `users/{uid}/goals` and
`task_intelligence_control` collections. `/v1/goals` is a 410 on
desktop-backend.
- `backend/utils/retrieval/tools/knowledge_ledger_tools.py` — siblings
`backend/utils/memory/memory_service.py:19` and
`backend/utils/memory/canonical_memory_adapter.py:18` (both default
`db`). Same `users/{uid}/memory_items` / apply-control collections.
Desktop-backend JIT snapshots already inject the data plane; the read
tools are not invoked from `desktop_chat.py`.
- `backend/routers/mcp_sse.py` authorize path (`:1788-1801`) does not
call `enforce_account_deletion_http_access`. It relies on
`create_grant_and_authorization_code_if_allowed` reading
`account_deletions` through `data_plane_db` (`mcp_oauth.py:575-590`). An
unresolvable data-plane client raises out of the grant write as HTTP
500, not mapped to 503. Fail-closed, different status. MCP is not
mounted on desktop-backend. Subsequent MCP data calls do use the HTTP
fence.
- Field-disjoint `users/{uid}` telemetry writers still on compute:
`record_client_device` / `record_user_platform` (`users.py:135`, `:178`)
merge-write the compute copy while BYOK and `assistant_settings` now
live on the data plane. Field-disjoint, so it does not reopen deletion
or clobber `byok`. Pre-existing telemetry-to-empty-dev-Firestore.

The `.get()`-swallow guard named in the #12667 review is fixed in this
PR.

## New guards

The resolved-client `.get()` raise test is the recurrence guard for
swallowing a deletion-marker read error into a clean miss. The
`provision=False` behavioral test is the recurrence guard for
JIT-writing Free onto a missing customer subscription doc from
screen-vector entitlement. They are not a repo-wide plane-seam checker
because the plane is a runtime client identity, not a static import
graph.


<!-- This is an auto-generated description by cubic. -->
<a
href="https://cubic.dev/pr/BasedHardware/omi/pull/12674?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. -->
HomePage calls streamDeviceRecording with a null device as a check-only
path. That was minting a recording ID and emitting capture_unavailable on
every entry without a pendant, which made start failures outnumber starts.

Only prepare and failStart when a device was passed or a recording device
is already set.

Failure-Class: none

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Co-authored-by: Cursor <[email protected]>
… cycle

AVAudioPlayerNode.play() raises an uncaught NSException when the engine
has not completed an IO cycle. Guard scheduleBuffer/play with the existing
ObjCExceptionCatcher, skip play when the engine is not running, and
silence the bed after a caught exception so onboarding continues.

Failure-Class: none

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Co-authored-by: Cursor <[email protected]>
@mintlify

mintlify Bot commented Sep 3, 2026 •

Copy link
Copy Markdown

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

Project Status Preview Updated (UTC)
omi 🟢 Ready View Preview Sep 3, 2026, 12:12 PM

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

@Git-on-my-level
Git-on-my-level merged commit ce5e9f3 into main Sep 3, 2026
46 checks passed
@Git-on-my-level
Git-on-my-level deleted the fix/push-influx-followups branch September 3, 2026 16:44

This branch was successfully deployed

1 active deployment
staging - docs — b33d34ef Deployed Sep 3, 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.

3 participants