Repository navigation
feat(backend): conversation tasks are tasks on clients with no Suggested surface - #12424
Merged
Merged
Conversation
… 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.
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Workflows to automatically generate PRs for you. |
2 of 5 tasks
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   Additional saved-task, integration destination and summary-recovery captures are recorded in the sibling evidence.json manifest.
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
_save_action_itemsproposes a Candidate per item and writes noaction_item.task_intelligence_capture = capture_enabled(uid)isbool(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 afterSUGGESTION_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.pyalready uses twice for per-client policy (trial paywall, deferred processing):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.Screen capture is untouched. It posts to
/v1/candidatesfromTaskAssistant.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_itemscannot 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.
tests/unit/test_backend_candidate_capture.pyomi/phone/phone_call/apple_watch/sdcardwrite and never propose; reprocess replacestesting/e2e/test_conversation_processing.pyprocess_conversationfor anomiconversation and reads the written item back out ofaction_itemstests/unit/test_process_conversation_usage_context.pytests/unit/test_task_intelligence_contract_freeze.pytests/unit/test_conversation_suggestion_visibility.pytests/unit/test_surface_parity_capture.py,test_listen_parity_capture.pytests/unit/test_upstream_boundary.py.github/scripts/test_check_task_capture_authority.pyEnvironment note for anyone reproducing: the checked-in backend venv is missing
langchain-anthropic, whichrequirements.txtpins at 1.1.0. Every task-intelligence test file fails collection without it, onmaintoo. I ran with it supplied onPYTHONPATHrather 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