Skip to content

feat(desktop): remind me next time I open this — context-bound reminders - #12651

Merged
Git-on-my-level merged 9 commits into
mainfrom
feat/context-bound-reminders
Sep 4, 2026
Merged

Git-on-my-level merged 9 commits into
mainfrom
feat/context-bound-reminders

Conversation

@Git-on-my-level

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

Copy link
Copy Markdown
Member

Summary

Hands-free, a user can say “remind me to ping Priya next time I’m here” while a document is frontmost. Omi binds that reminder to that place, not a time. The next visit, a notch card offers Done / Remind me tomorrow.

This re-implements the reusable core from abandoned PR #12603 (ContextReminderStore) outside FirstRun/. Persistence lives at Application Support/Omi/users/<ownerID>/ContextReminders/context-reminders.json. Nothing ever shipped under the abandoned FirstRun/ segment, so there is no file to migrate.

Creation is an explicit tool (create_context_reminder) on desktop_chat and realtime_voice. The place is captured from the live frontmost window; the model only passes { text }. Timed reminders stay on create_action_item. Context switches are observed from the existing AssistantCoordinator.fireContextSwitchOnAllAssistants path. Cards go through NotificationService (respectFrequency: false, isPersistent: true), assistant id context_reminder, kind .task. Linking a backend action item is best-effort: the local reminder is the source of truth.

Windows is out of this PR (macOS frontmost-window feature; Windows already has other macOS-only voice tools).

Failure class

Failure-Class: none

Product invariants affected

  • INV-CHAT-1 — Chat/, ChatToolExecutor.swift, FloatingControlBar/**, agent/src/runtime/**. Preserved: no second transcript or session store; the reminder JSON is owner-scoped place state, not conversation history. Notifications still go through NotificationService. The new tool is a physical swiftTool on the existing chat/voice surfaces.
  • INV-AGENT-* — desktop/macos/agent/src/runtime/**. Preserved: Identity / Authority / Lifecycle unchanged. This only adds a physical tool to the canonical manifest (piAndStdio(), desktop.tasks.readwrite) and regenerates surfaces.
  • INV-AUTH-1 — OmiApp.swift is on the glob. Preserved: the only addition is ContextReminderCoordinator.shared.start(). No session-invalidation, 401, or auth-recovery change. Owner scoping is the existing RuntimeOwnerIdentity fence plus runtimeOwnerDidChange.
  • INV-UI-1 — the new card uses white/neutral chrome only (no purple). Named because this PR adds a user-visible card; brand is unchanged.

Verification

  • cd desktop/macos && xcrun swift build -c debug --package-path Desktop — Build complete (175.90s). Local Xcode 26.6 / 17F113.

  • cd desktop/macos && xcrun swift test --package-path Desktop --filter ContextReminderCoordinatorTests --filter ContextReminderStoreTests --filter CreateContextReminderToolTests — 10 passed, 0 failed.

  • cd desktop/macos && xcrun swift test --package-path Desktop --filter ChatDiscoverabilityTests — 22/23 passed. testDesktopPromptMentionsEveryDesktopCapability passed (includes **create_context_reminder**).

  • ChatDiscoverabilityTests.testDesktopCapabilitiesExistInAgentToolDeclarations fails on this branch with Missing agent tool declaration for look_at_frame. It fails identically at origin/main 15eca77b622ee5ed84d3542a46a4027993f69896 (verified on a throwaway worktree detached at that commit, with none of this branch’s changes present). It is not caused by this branch and is not fixed here.

  • cd desktop/macos && python3 scripts/check-e2e-flow-coverage.py --strict --base $(git merge-base origin/main HEAD) — 0 uncovered (13/13 covered). Context reminder store/coordinator/card are on floating-bar-functional.yaml (notch cards; same surface as FirstRealApp). The coordinator is also on ai-chat-settings.yaml (the flow that already covers AssistantCoordinator).

  • cd desktop/macos && python3 scripts/desktop-flow-lint.py — OK (74 flows, 188 registered actions).

  • cd desktop/macos/agent && npm run build && node --experimental-strip-types scripts/generate-tool-surfaces.mjs — wrote 4 files (manifest 5464d1d592f7).

  • cd desktop/macos/agent && npx vitest run tests/omi-tool-manifest.test.ts — 30 passed.

  • cd desktop/macos/pi-mono-extension && npx --yes tsx --test index.test.ts — 111 passed, including create_context_reminder: ["text"].

  • desktop/macos/scripts/swift-format-wrapper.sh lint on every first-party Swift file this PR touches — clean.

  • desktop/macos/scripts/run-swift-ci.sh --select-toolchain — could not run. This Mac has Xcode 26.6 at /Applications/Xcode.app; CI’s /Applications/Xcode_16.4.app is not installed, so local swift build cannot see the strict-concurrency errors CI rejects.

  • scripts/pr-preflight --pr-body-file PR-BODY.md — passed (24 checks in 65.52s), including desktop-swiftlint (0 violations) and desktop-main-actor-xctest-hooks.

Not run: full scripts/run-swift-ci.sh --test (same missing 16.4 toolchain; also the full suite, not this slice). Backend / Dart / web — not in this change. Named-bundle / live PTT path — not exercised here; unit tests cover create, match, persist, owner fence, snooze, done, and tool dispatch.

Line-count exceptions

Counts are against this worktree’s starting HEAD 38d95fdca5 (the brief forbade rebasing; origin/main later moved to c9dc11b7bb, which also touches FloatingControlBarWindow.swift).

Line-Count-Exception: desktop/macos/Desktop/Sources/Providers/ChatToolExecutor.swift | 3799 -> 3806 | dispatch create_context_reminder onto the existing ChatToolExecutor switch

Line-Count-Exception: desktop/macos/Desktop/Sources/FloatingControlBar/FloatingControlBarView.swift | 3112 -> 3116 | one barNotification branch to ContextReminderCard (new file) so the freeze file does not take the card body

Line-Count-Exception: desktop/macos/Desktop/Sources/FloatingControlBar/FloatingControlBarWindow.swift | 5781 -> 5783 | fall through .contextReminder card tap to the existing open-in-chat path

Line-Count-Exception: desktop/macos/Desktop/Sources/OmiApp.swift | 1656 -> 1657 | start ContextReminderCoordinator next to FirstRealAppCardCoordinator

🤖 Generated with Claude Code

Review in cubic

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2 issues found across 27 files

Confidence score: 5/5

  • desktop/macos/e2e/flows/floating-bar-functional.yaml declares coverage for ContextReminderCard, ContextReminderCoordinator, and ContextReminderStore without exercising them, which can make coverage reporting misleading; remove the entries or add steps that validate those components.
  • desktop/macos/e2e/flows/ai-chat-settings.yaml only navigates to AI Chat settings, captures a snapshot, and checks logs, so it does not validate ContextReminderCoordinator behavior; remove the coverage claim or add context-switch and reminder creation/matching actions.
Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="desktop/macos/e2e/flows/floating-bar-functional.yaml">

<violation number="1" location="desktop/macos/e2e/flows/floating-bar-functional.yaml:11">
P2: The three new `covers:` entries claim this flow covers ContextReminderCard, ContextReminderCoordinator, and ContextReminderStore, but the flow never exercises them. Steps S1–S8 only assert floating-bar visibility, open Ask Omi, send a stubbed query, assert the stub marker echo, and close Ask Omi. None create a context reminder (create_context_reminder), observe a context switch via fireContextSwitchOnAllAssistants, deliver the card through NotificationService, interact with the Done / Remind me tomorrow buttons, or verify ContextReminderStore persistence. List a source in `covers:` only when the flow actually exercises and verifies its behavior, so either add steps that drive and assert the reminder flow or drop these three entries from this Ask-Omi-only manifest.</violation>
</file>

<file name="desktop/macos/e2e/flows/ai-chat-settings.yaml">

<violation number="1" location="desktop/macos/e2e/flows/ai-chat-settings.yaml:11">
P3: This flow only navigates to the AI Chat settings section, takes a settings snapshot (S2), and asserts clean logs. It never drives ContextReminderCoordinator behavior (context-switch observation, reminder creation/matching, NotificationService delivery, Done/Snooze resolution), and the coordinator exposes no settings UI to snapshot. Listing it in `covers:` claims coverage the flow does not exercise. Remove the entry unless a step is added that fires or verifies a context reminder.</violation>
</file>

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

- desktop/macos/Desktop/Sources/ProactiveAssistants/Assistants/Insight/InsightAssistantSettings.swift
- desktop/macos/Desktop/Sources/ProactiveAssistants/Assistants/TaskExtraction/TaskAssistantSettings.swift
- desktop/macos/Desktop/Sources/ProactiveAssistants/Core/AssistantCoordinator.swift
- desktop/macos/Desktop/Sources/ProactiveAssistants/ContextReminders/ContextReminderCoordinator.swift

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P3: This flow only navigates to the AI Chat settings section, takes a settings snapshot (S2), and asserts clean logs. It never drives ContextReminderCoordinator behavior (context-switch observation, reminder creation/matching, NotificationService delivery, Done/Snooze resolution), and the coordinator exposes no settings UI to snapshot. Listing it in covers: claims coverage the flow does not exercise. Remove the entry unless a step is added that fires or verifies a context reminder.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At desktop/macos/e2e/flows/ai-chat-settings.yaml, line 11:

<comment>This flow only navigates to the AI Chat settings section, takes a settings snapshot (S2), and asserts clean logs. It never drives ContextReminderCoordinator behavior (context-switch observation, reminder creation/matching, NotificationService delivery, Done/Snooze resolution), and the coordinator exposes no settings UI to snapshot. Listing it in `covers:` claims coverage the flow does not exercise. Remove the entry unless a step is added that fires or verifies a context reminder.</comment>

<file context>
@@ -8,6 +8,7 @@ covers:
   - desktop/macos/Desktop/Sources/ProactiveAssistants/Assistants/Insight/InsightAssistantSettings.swift
   - desktop/macos/Desktop/Sources/ProactiveAssistants/Assistants/TaskExtraction/TaskAssistantSettings.swift
   - desktop/macos/Desktop/Sources/ProactiveAssistants/Core/AssistantCoordinator.swift
+  - desktop/macos/Desktop/Sources/ProactiveAssistants/ContextReminders/ContextReminderCoordinator.swift
   - desktop/macos/Desktop/Sources/MainWindow/Pages/Settings/Sections/SettingsContentView+FloatingBarAndChat.swift
   - desktop/macos/Desktop/Sources/MainWindow/Pages/Settings/Sections/SettingsContentView+Advanced.swift
</file context>
Suggested change
- desktop/macos/Desktop/Sources/ProactiveAssistants/ContextReminders/ContextReminderCoordinator.swift
- - desktop/macos/Desktop/Sources/ProactiveAssistants/ContextReminders/ContextReminderCoordinator.swift

@Git-on-my-level
Git-on-my-level force-pushed the feat/context-bound-reminders branch from 1891b0a to 396b91f Compare September 3, 2026 16:17
Git-on-my-level and others added 7 commits September 3, 2026 13:43
Give context reminders their own ProactiveAssistants home and
ContextReminders/ path. Nothing shipped under FirstRun/, so there is
no file to migrate.

Co-Authored-By: Claude Opus 5 <[email protected]>
Co-authored-by: Cursor <[email protected]>
Add create_context_reminder on chat and voice, observe context switches
from AssistantCoordinator, and present Done / Remind-me-tomorrow on the
existing NotificationService notch path.

Co-Authored-By: Claude Opus 5 <[email protected]>
Co-authored-by: Cursor <[email protected]>
…ordinator flows

Map the new store, coordinator, and card onto floating-bar-functional (the
notch-card surface that already covers FirstRealApp) and the coordinator
onto ai-chat-settings (the flow that already covers AssistantCoordinator).

Co-Authored-By: Claude Opus 5 <[email protected]>
Co-authored-by: Cursor <[email protected]>
Xcode 16.4 rejects non-Sendable XCTestCase transfers from @mainactor async
lifecycle hooks, so the pinned CI toolchain fails on a super setUp/tearDown
await that Xcode 26 accepts locally.

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

SwiftLint rejects new IUOs outside the down-only baseline. The MainActor
suite can construct the fixture as a let; the nonisolated tool suite keeps
a plain optional assigned after the MainActor hop.

Co-Authored-By: Claude Opus 5 <[email protected]>
Co-authored-by: Cursor <[email protected]>
@Git-on-my-level
Git-on-my-level force-pushed the feat/context-bound-reminders branch from 396b91f to 605713a Compare September 3, 2026 17:45
Git-on-my-level and others added 2 commits September 3, 2026 20:23
# Conflicts:
#	desktop/macos/Desktop/Sources/Generated/GeneratedToolExecutors.swift
…den stale-context delivery

Addresses Cubic review threads on the context-bound reminders feature:

- dueReminders is now owner-bound with a post-read owner recheck; a read
  that straddles an owner switch discards results instead of presenting
  the old owner's reminders (thread 1)
- observedContext applies the Rewind capture-exclusion fence so a
  privacy-excluded frontmost app is never observed, normalized, or
  persisted as a reminder place (thread 3)
- createFromCurrentContext revalidates authorization after the
  best-effort action-item await before attaching the link (thread 4)
- resolve captures owner+authorization up front and aborts (resetting
  in-flight state) instead of mutating under a switched account; the
  card's Done/Snooze completion reports failure so buttons re-enable
  (threads 5, 11)
- observe rechecks lastObservedIdentity after the store await so a
  superseded context cannot present stale reminders (thread 6)
- fireContextSwitchOnAllAssistants captures the arriving frontmost
  snapshot before the assistant loop; observeFrontmostChange evaluates
  that one-shot (app, title) pair so a mid-await window change cannot
  pair the old title with the current app (threads 7, 10)
- ContextReminderCard resets didAct when the reminder identity changes,
  so a replacement persistent card starts with enabled buttons (thread 9)
- removed dead reminder(id:) read path (thread 12)
- owner-change test now asserts the in-flight delivery state is cleared
  by re-presenting the reminder after reset (thread 13)

Also restores app/ dart files (daily_summary, conversation_detail,
memory_review_card, generated conversation_wire) to origin/main content:
the merge commit dragged in formatter-version noise and a stale
generated file this desktop-only PR never touched, which fails the
pinned CI Formatting check.
@Git-on-my-level

Copy link
Copy Markdown
Member Author

Re: covers: entries in floating-bar-functional.yaml and ai-chat-settings.yaml (Cubic threads) — reviewed, no change.

In this repo, covers: is an affected-area registration, not a behavioral-assertion claim: desktop/macos/scripts/check-e2e-flow-coverage.py --strict (CI via .github/checks-manifest.yaml) requires every changed desktop Swift file to be registered in some flow so the harness can recommend the right journey — e2e/SKILL.md documents it as "that flow describes the user journey your change affects." The existing manifests follow that convention loosely already (this Ask-Omi flow lists ~70 files it doesn't behaviorally assert).

  • Reminder cards deliver as notch cards through NotificationService onto the floating-bar surface (ContextReminderCoordinator → assistantId: context_reminder), so the floating-bar journey is the closest affected flow; the coordinator also mounts via AssistantCoordinator, which ai-chat-settings.yaml already covered pre-PR.
  • Dropping the entries would redden the strict coverage gate (these are new files with no other registration).
  • Adding steps that drive the reminder lifecycle would require new DesktopAutomationBridge actions (none of its 170 actions touch reminders) — out of scope for this PR. Behavior is covered by the new unit suites (ContextReminderStoreTests, ContextReminderCoordinatorTests, CreateContextReminderToolTests).

If the project later wants covers: to mean verified behavior, that's a manifest/convention change across all flows, not this PR.

@Git-on-my-level
Git-on-my-level merged commit f180730 into main Sep 4, 2026
28 checks passed
@Git-on-my-level
Git-on-my-level deleted the feat/context-bound-reminders branch September 4, 2026 07:00
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