Skip to content

feat(backend): conversation tasks are tasks on clients with no Suggested surface - #12424

Merged
mdmohsin7 merged 9 commits into
mainfrom
fix/conversation-tasks-are-tasks
Aug 30, 2026
Merged

mdmohsin7 merged 9 commits into
mainfrom
fix/conversation-tasks-are-tasks

Conversation

@mdmohsin7

@mdmohsin7 mdmohsin7 commented Aug 30, 2026 •

Copy link
Copy Markdown
Member

Summary

Since #11974 (Aug 23), action items extracted from a conversation stop existing for anyone on a phone. Two changes landed together in that PR and compound:

  1. The write disappeared. _save_action_items proposes a Candidate per item and writes no action_item.
  2. The prompt got looser. task_intelligence_capture = capture_enabled(uid) is bool(uid) — true for everyone — and that flag switches the extraction prompt from "Only extract action items that are truly important and need tracking. When in doubt, DON'T extract" to "Always extract concrete explicit commands, direct requests, and clear commitments; Candidate policy decides whether they become tasks or quiet suggestions."

Filtering moved from the extractor into a review queue. Desktop has that queue (SuggestedTasksStore). Mobile has none — the Flutter app never calls /v1/candidates, and its generated wire models for candidates are imported by no file. So on a phone every proposal is invisible and expires after SUGGESTION_TTL = 2 days. Even "Hey Omi, remind me to call the dentist" only earns a suggestion: the policy comment says so directly — "A command heard in ambient audio is still a model's reading of speech, not a user gesture against a surface. It proposes; it does not create."

What changed

Capture is now scoped by conversation origin, using the seam process_conversation.py already uses twice for per-client policy (trial paywall, deferred processing):

  • Desktop conversations keep proposing Candidates into the Suggested surface. Unchanged.
  • Every other client — omi, friend, phone, phone_call, apple_watch, sdcard, and any source added later — writes its extracted items as tasks. The same predicate picks the prompt, so those conversations get the conservative filter back: explicit commands and the few concrete commitments, or nothing at all. Restoring the writer also restores what it drove — due-date notifications and task-integration sync.
  • Reprocessing replaces that conversation's items, as it did before Make AI task capture suggestion-only, expire suggestions in 2 days, and remove task execution #11974.

Screen capture is untouched. It posts to /v1/candidates from TaskAssistant.swift, never enters this path, and stays suggestion-only — the guard rules that hold it there are unchanged.

No app release needed. The items land in /v1/action-items, which the Tasks page already reads.

Product invariants

INV-TASK-2 — rescoped, not deleted. It was written against a measured flood: ~100 Candidates/day on a dogfood account, four code paths auto-writing tasks. That volume is a property of screen capture, which samples continuously; conversation extraction is bounded by the conversation and gated by a prompt that returns nothing when nothing qualifies. The invariant now reads: capture proposes only where a Suggested surface exists to review the proposal on. Its own MUST NOT — "Admit a proposal the Suggested surface will not show. A stored, invisible Candidate is a dropped one" — is what mobile has been violating for a week; this enforces it one level up, by not proposing there at all.

INV-MEM-4 (canonical promotion is the sole Long-term authority) is matched by path: this diff touches process_conversation.py, which also hosts memory postprocessing. It changes no memory intake, consolidation, or promotion path — only how a conversation's action items are persisted.

The guard changes shape with it. The static rule banning a writer inside _save_action_items cannot express which conversations propose, and a source-string check would be a tripwire rather than coverage, so it is replaced by behavioural tests that run both paths through the real function. The three facts the guard can prove — no creating outcome in the policy, no accept inside capture, no accept on the delivery client — plus the manifest rule that a shared-policy source declares no create anchor, all stay. The writer is registered as its own source (mobile_conversation_extraction, direct_command), so it is visible to that manifest rule rather than hidden from it.

Verification

Every command below was run locally in this worktree.

Suite Result
tests/unit/test_backend_candidate_capture.py both paths — desktop proposes and never writes; omi/phone/phone_call/apple_watch/sdcard write and never propose; reprocess replaces
testing/e2e/test_conversation_processing.py 5 passed — hermetic lifecycle drives process_conversation for an omi conversation and reads the written item back out of action_items
tests/unit/test_process_conversation_usage_context.py 51 passed
tests/unit/test_task_intelligence_contract_freeze.py 29 passed
tests/unit/test_conversation_suggestion_visibility.py 6 passed
tests/unit/test_surface_parity_capture.py, test_listen_parity_capture.py 14 passed
tests/unit/test_upstream_boundary.py 5 passed
.github/scripts/test_check_task_capture_authority.py 8 passed; guard exits 0 on this checkout

Environment note for anyone reproducing: the checked-in backend venv is missing langchain-anthropic, which requirements.txt pins at 1.1.0. Every task-intelligence test file fails collection without it, on main too. I ran with it supplied on PYTHONPATH rather than mutating the venv.

Not verified: no device run. The behaviour is backend-side and covered by the hermetic lifecycle test, but seeing tasks appear on a phone after a real conversation is worth doing before this reaches users.

Follow-up, deliberately not here

Desktop conversations still propose, so their tasks are reviewable only on desktop. Surfacing those suggestions on mobile is the next piece; when it lands, the split this PR introduces can close in whichever direction the data supports.

Line-Count-Exception: backend/utils/conversations/process_conversation.py | 2476 -> 2561 | restores the action-item writer #11974 deleted from this file; extracting it to a new module would still grow the file and would spread one conversation-postprocess decision across two places

Review in cubic

… surface

Desktop keeps proposing Candidates; phone, pendant, watch, phone call and
sdcard conversations write their extracted items as tasks. The same source
predicate picks the extraction prompt, so those conversations get the
conservative filter again — explicit commands and the few real commitments,
or nothing — instead of the loose one that assumed a review queue.
mobile_conversation_extraction owns the writer anchors in
process_conversation.py under direct_command, leaving
backend_conversation_extraction on the shared capture policy for the desktop
branch it still governs.
The existing candidate assertions now run against a desktop-sourced
conversation, the surface that still proposes. New cases prove the other
clients write their tasks, never propose, and replace the conversation's
previous items on reprocess.
The static writer ban covered one function name and could not express which
conversations propose. That split is behaviour, so it belongs in the capture
tests; the guard keeps the three facts it can actually prove — no creating
outcome, no accept in capture, no accept on the delivery client — plus the
manifest rule that a shared-policy source declares no create anchor.
8 tests, all passing: the outcome, accept and client-protocol facts the guard
still enforces.
The queue holds where a user can see it. On a client with no Suggested
surface a proposal is a dropped task, so the extractor's own filter decides
there and what it admits is written.
51 passed. A desktop conversation whose capture path reports itself
unavailable still reaches no writer.
The hermetic lifecycle test drives process_conversation end to end for an
omi-sourced conversation; its extracted item is now read back out of the
action_items collection. 5 passed.
@mintlify

mintlify Bot commented Aug 30, 2026 •

Copy link
Copy Markdown

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

Project Status Preview Updated (UTC)
omi 🟢 Ready View Preview Aug 30, 2026, 12:43 PM

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

@mdmohsin7
mdmohsin7 merged commit afb30ac into main Aug 30, 2026
42 checks passed
@mdmohsin7
mdmohsin7 deleted the fix/conversation-tasks-are-tasks branch August 30, 2026 13:15
aryanorastar added a commit that referenced this pull request Oct 21, 2026
Conversations can contain desktop-extracted action items while mobile
Tasks has no way to review them. Task Integrations is also hidden behind
an export glyph. Mobile now shows the existing server Suggested
projection in Tasks, lets readers explicitly add or dismiss suggestions,
recovers older desktop summary rows through the existing
generation-fenced summary promoter, and exposes a named Task
Integrations entry in Settings/search and the Tasks menu.

The backend now accepts historical text summary rows, converting only
the selected row when acceptance saves its durable task link. Candidate
preparation and acceptance use the existing bounded Firestore contention
retry helper, including read-time aborts and exhausted SDK retries;
unknown/ambiguous failures are not retried by that helper.

Acceptance reads and upserts the exact canonical task ID. A successful
receipt survives a failed read without repeating acceptance; older
Tasks, Home and pagination responses cannot erase the saved task or
resurrect a resolved suggestion. New incomplete tasks exit an
automatically selected Completed view while manual view choices remain
respected. Overlapping reads are query/session-owned; point reads, Undo
and optimistic creates cannot skip server pages. A save that invalidates
initial loading schedules a replacement read, and summary retries renew
keys only for confirmed terminal proposals while retaining ambiguous
retries. Summary recovery preserves original storage coordinates through
malformed-row filtering and conversation caching, so the selected row
stays the selected row. Phone extraction retains its existing direct
writer; this does not introduce a second manual-create path for phone
summaries.

Refs #20595 and #12368. #12424 already restored the mobile-origin
backend writer. #20725 remains separate and open; this PR completes the
mobile access/recovery path through canonical acceptance rather than
depending on that broader notes UI change.

Validation:
- 195 focused schema, cache, task-provider, widget, Settings and
production-wiring tests passed, including overlapping reads, first-load
recovery, terminal suggestion retries, fresh/cached summaries with
invalid leading rows and canonical approval. The latest backend run
passed 386 Candidate lifecycle/router, summary promotion and
capture/extraction/identity tests. Another 26 real Firestore emulator
checks passed, covering concurrent preparation/acceptance, definite
read/commit aborts, generation fences, expiry, text rows, canonical task
reads/refresh/pagination and integration reads. The 23 selected hermetic
mobile journey assertions also passed. The recovery/expiry suites are
now registered in the existing backend emulator CI runner and its path
triggers; the complete runner passed locally, including the 26 task
checks.
- Analyzer checks, all 51 local preflight checks, backend type checking
(zero errors), API compatibility/code-generation checks and the normal
pre-push gate passed. Native iPhone simulator build and agent-flutter
checks passed; the cached-summary fixture rejects any prepare/accept
request that does not use the original stored coordinate.
- Mobile GitHub CI passed on 94798e1
(6,793 Dart tests); fresh CI for the final backend/CI head
7375693 is queued and is not yet
confirmed green. Workflow-selected native platform/journey CI jobs were
skipped; local iPhone simulator and selected hermetic journey evidence
are recorded above. No store release or production account recovery is
claimed.
- Live read-only verification on 2026-10-20: production
https://api.omi.me/openapi.json returned 200 and publishes all nine
required route boundaries. Production Cloud Logging shows successful
control and summary-preparation requests; this proves existing route
availability, not deployment of this PR. A local curl → uvicorn →
production FastAPI router → Firestore emulator smoke passed 10 requests
with one-task receipt replay (synthetic identity/auth boundary, no
customer records or external notifications).
- Architecture and implementation checklist: app/docs/task-delivery.md.

Release and customer verification:
- Needs merge, deployment of the backend serving the mobile task APIs,
an authenticated synthetic production smoke, then an iOS/Android mobile
release. Deploy backend first: legacy text-row support and contention
retries are new server code. Existing universal APIs require no UID
allowlist, bulk migration or new index. Relevant backend APIs: Candidate
control/list/read/prepare/accept/reject, canonical task point/list reads
and task-integration reads. Existing route/schema availability is
verified; this PR’s new server behavior is not deployed.
- Does not claim an account-specific historical backfill or recovery.
Verify one affected phone/pendant conversation delivers tasks, and an
older desktop summary can add a task that remains after refresh/reopen.
Verify Task Integrations opens from Settings and the Tasks header/menu
on a physical phone.
- Keep #20595 open until the affected customers' records and released
app behavior are verified.

## Product invariants affected

INV-TASK-2: desktop capture remains suggestion-only; only explicit
approval invokes canonical acceptance. Phone capture policy is
unchanged.
INV-UI-3: uses shared Omi controls/sheets, existing localized copy and
localized Settings search.
INV-PERF-1: uses the bounded server Suggested projection and the
existing shared task owner; no history polling or additional capture
pipeline.

Failure-Class: new

## UI evidence

![Task
suggestions](https://raw.githubusercontent.com/BasedHardware/omi/d70a1bb9ec1dfb666a87864970b812f0519f62de/.agent-artifacts/ui-evidence/fix-20595-task-delivery/001-mobile-ios-task-suggestions.png)

![Named Task Integrations
menu](https://raw.githubusercontent.com/BasedHardware/omi/d70a1bb9ec1dfb666a87864970b812f0519f62de/.agent-artifacts/ui-evidence/fix-20595-task-delivery/003-mobile-ios-task-integrations-menu.png)

Additional saved-task, integration destination and summary-recovery
captures are recorded in the sibling evidence.json manifest.

This branch was successfully deployed

1 active deployment
staging - docs — b0965117 Deployed Aug 30, 2026 by mintlify[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant