Repository navigation
feat: proactivity v2 — retire legacy desktop proactivity, add a budgeted proactive ledger, mentor v2 and commitment follow-ups - #20494
Merged
Conversation
…lane/pv2-producers
# Conflicts: # config/feature-flags.yaml
Git-on-my-level
marked this pull request as ready for review
October 4, 2026 01:59
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
chicoenmascarado
added a commit
to chicoenmascarado/omi
that referenced
this pull request
Oct 4, 2026
The Insight assistant was retired in BasedHardware#20494; the remaining callers are tasks, memories, goals and focus.
aryanorastar
added a commit
to aryanorastar/omi
that referenced
this pull request
Oct 5, 2026
Port the snooze and presence gates onto proactivity v2 (BasedHardware#20494): - NotificationService: keep the snooze/presence gate in sendNotification, which the v2 ProactivityNotificationAdapter now calls, and take main's removal of the retired JIT detail-card and context-director paths. - Keep main's owner guard in recordPresentation and route onPresented only through the presentation receipt so it fires once. - FloatingControlBarManager.presentNotification: keep the proactive snooze/presence recheck and notch-only speech policy; drop the retired JIT generation guard and interject grace. - Drop retired Insight delivery telemetry from the suppression paths and the two tests that only asserted its enum strings. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Wizard815
pushed a commit
to Wizard815/omi-local
that referenced
this pull request
Nov 25, 2026
scripts/failure-class fails closed when a changed definition has a scope_hint matching no tracked file. The upstream sync adds every upstream definition at once, so it trips on four hints whose files upstream itself has since removed: - desktop/windows/src/main/jit/** (BasedHardware#20494, BasedHardware#22209), in FC-client-rederives-authority-verdict and FC-sync-gated-on-consumer-trigger; - backend/utils/free_tier_cohort.py (BasedHardware#22238) and free_tier_memory_policy.py (BasedHardware#22209), in FC-cohort-gate-consulted-without-its-subject; - backend/utils/task_intelligence/rollout.py (BasedHardware#18722), in FC-gate-principal-outside-consolidated-entitlement. Each definition keeps its remaining, live hints. Verification: scripts/pr-preflight --suggest reported exactly these four scope_hint_matches_nothing errors before; git cat-file confirms none of the paths exist on upstream/main. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_0148HLrpWR8Mimn43rkNvGKg
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.
Retire the legacy desktop proactivity producers and ship one server-owned v2 system across mobile, macOS and Windows. Eligible paid users can receive conversation-mentor advice and commitment follow-ups; each item carries a canonical conversation/task target, durable exposure and outcome identity, and a hard per-user daily model budget. The rollout remains off until explicitly enabled.
Deletions and preserved behavior
Delete macOS/Windows Insight, context buckets/director/extraction/visit coordinator, JIT proactivity triggers/watchlists/triage/reservations/delivery, parked Interject, and their settings, flag reads, telemetry, gateway lanes/quotas and
proactivity_dailycatalog rows. Forward GRDB/SQLite migrations remove only retired tables; canonical mirrors and task subject bindings survive.Released-client compatibility stays cheap: desktop completions return static 429 with
Retry-After: 3600/feature_retired; JIT reservation/feedback routes return static 410 and trigger snapshot returns its disabled empty shape. These retirement handlers perform no inference. Old Insight/Focus calls through the shared Gemini proxy remain an accepted residual.Preserve Focus/SuggestionPacing (only JIT suppression/feedback dependency removed), canonical JIT rollout authority and mirrors, Jev-gated screen TASK extraction, MemoryAssistant, live notes, goals, home suggestions, dictation, embeddings/Rewind, daily recap and interesting-memory review. Shared Gemini accounting and #20184 lane attribution remain intact. Legacy mentor remains behind its explicit flip, including its existing push behavior.
V2 architecture and integration
/chat/mentorroute. Identity-only listen wakeups refresh the authenticated desktop feed; they never inject push copy into chat or count transport acceptance as exposure. Legacy mentor messages are not intercepted. The mobile For You header now aligns with Daily Recaps.f0ae51ca391e, and producers505612e36372. The sole producer-merge conflict kept People-cache invalidation before source-linked feed cleanup in conversation deletion.Flags and enablement prerequisites
All v2 rollout gates default off: absent/false PostHog
proactivity_v2,MENTOR_PIPELINE=legacy, and empty commitment queue bindings. Registry rows are gated registrations, not live rollout. Once v2 is explicitly enabled, the usefulness judge defaults to shadow (not enforce), its historical prefilter stays disabled, and follow-up push stays unearned.The authoritative checklist is Enablement prerequisites: five customer-data Firestore serving/cohort/history indexes must be READY; enable
expires_atTTL onproactivity_itemsandproactivity_budget_days; provision the one-shot Cloud Tasks queue, exact callback URL/audience, OIDC invoker and enqueue/act-as permissions; bind project/location/queue/URL/invoker on all task hosts. Backend/listen/pusher and gateway need consistent customer-data, Redis and PostHog routing; gateway additionally needs accounting enabled. UseMENTOR_PIPELINE=cohortconsistently on mentor execution hosts and the gateway for per-user rollout; only flagged users select v2, and everyone else selects legacy. Create PostHogproactivity_v2disabled/zero-percent before cohort rollout. This PR performs no flag creation, provisioning, deployment or production-data access.Coordinator gates remain: #20184's attribution baseline, quality/safety ratification and native client acceptance before enablement. Hermetic tests do not establish notification usefulness.
Rollback
Disable
proactivity_v2to stop new v2 generation/push and suppress in-flight v2 publication; outstanding attempts retain holds and settle normally. Existing outcomes remain accepted. In cohort mode the next evaluation selects legacy for a false/unknown flag; selection never falls back after a v2 attempt. SetMENTOR_PIPELINE=legacyconsistently on every execution host and gateway to restore legacy for everyone. Preserve ledgers, attempt IDs and budgets through retention, with no refunds or history rewrite. Forward local table deletions are not reversed by a flag: the retired desktop features cannot be re-enabled without a separate compatible release.Product invariants
Affected
product/invariants/: INV-CUTOVER-1, INV-AGENT-*, INV-AUTH-1, INV-CHAT-1, INV-DATA-1, INV-VOICE-1, INV-MEM-4, INV-MEM-1, INV-MEM-5, INV-UI-1, INV-UI-2, INV-UI-3. Budget and owner boundaries fail closed; feed items are derived advice, not alternate memory/task mutation authority. Existing capture, canonical task/memory, chat and voice behavior remain intact.Failure-Class: none
This is the integrated feature replacement; integration fixes complete its producer/consumer contracts, not a new incident-class exception.
Final review fixes
MENTOR_PIPELINE=cohortuses the server admission flag resolver/client/cache per user. True selects v2; false/unknown/error selects unchanged legacy. Selection is exclusive and identical on mentor hosts and gateway admission. Default remains legacy. Contract enablement prerequisites, producers, registry and runtime validator include cohort; flagged/unflagged/unknown/error users are tested on both sides.Fix-round validation: after merging main at
6eb534630f,backend/test.shpassed 939 tests across 22 affected/overlapping files, including all 520 original fix-round regressions, the real HTTP callback with the strict ledger and budget executor, and Gemini attribution. Windows node/renderer typecheck and 64 tests across 10 files passed.xcrun swift build --build-tests --jobs 2compiled all test targets and 44 focused Swift tests passed. Heavy commands started with one-minute load <=30; a transient earlier duration-guard failure was rerun at low load without threshold changes.make preflightpassed 81 checks on the merged head (522.18s). The normal pre-push hook passed at published headb017771c88fdb8f0a8004b09af30a503c2c974fd: all 81 checks (628.47s), backend typecheck (zero errors), 39 selected backend files, OpenAPI, Flutter generation/localization, Swift and desktop tools. Backend test concurrency was reduced to two workers after a load-sensitive duration guard; no checks, thresholds or allowlists were skipped or relaxed.git ls-remoteand the PR head confirm the exact published SHA; the PR remains open and draft. No PR merge or deployment is performed.Earlier integration verification
backend/test.sh: all 1,543 selected files exercised. The retired-JIT fixture dependency was corrected and its four tests passed; 63 files hit duration guards during host-load spikes. Serial and individually gated reruns cleared all failures. Two persistent test-setup costs were corrected: stub the summary fixture's adjacent-conversation lookup and collect the memory wrapper import before the timed call; those unchanged behavioral assertions passed all 17 tests. No duration threshold or allowlist was changed. Focused cross-branch contracts/listen: 93 passed.xcrun swift build --build-tests --jobs 2: passed after restoring missing worktree-local XCFramework artifacts. Focused consumer, adapter, owner, notification, pacing and KEEP suites: 89 passed.app/test.sh: protected spine 138 passed; full general suite 4,311 passed, 5 skipped, with one merged capture-fixture compile error. Corrected the fake's typed People response and reran throughapp/test.sh: spine 138 plus capture 2 passed. Producer/push parity and header geometry passed. Synthetic production-Home visual capture passed and was inspected: aligned headers and both producer cards, with no clipping.make preflight: 81 checks passed (619.92s). The normal pre-push hook passed all 81 contracts again at published head2d456e53b45f(471.57s), backend typecheck (zero errors), 38 selected backend files, OpenAPI, Flutter build_runner/localization generation, Swift and desktop tool gates. Line-count ratchet passed with the declarations below.Every heavy command started with 1-minute load <=30. Full backend/app runs started at 6.77/10.08; Windows full/typecheck at 28.68/29.04; Swift build/focused at 24.28/13.90; final preflight at 4.42. Later load spikes reached ~190. Timing failures were rerun at lower load, with a stricter <=15 gate for the last individual files. Test-only fixture corrections cover People responses, manual-speaker lookup, summary adjacency isolation and memory module setup; production behavior is unchanged. The frozen historical JIT prompt checksum remains pinned after removal of its live Swift-source dependency.
The earlier integration validation above was recorded at
2d456e53b45f. This fix round merges main through6eb534630f, regenerates the five conflicted Swift/TypeScript clients from the combined schema, and preserves #20184 Gemini attribution on all surviving producers while keeping Insight retired. Full evidence and the synthetic capture are in the coordinator's run directory (integration-verification.md,integration-home-render/). No hosted CI, installed-device/native Windows delivery or deployment is claimed by local checks.Line-Count-Exception: backend/database/action_items.py | 1600 -> 1633 | Shared canonical task mutations observe v2 completion and source deletion adjacent to the persisted mutation
Line-Count-Exception: backend/database/chat.py | 1507 -> 1524 | Existing mentor chat writes retain internal item mapping and server-observed reply outcomes
Line-Count-Exception: backend/database/conversations.py | 3487 -> 3490 | Source deletion clears derived feed content after invalidating People stats
Line-Count-Exception: backend/database/firestore_index_registry.py | 2121 -> 2160 | Register five spine and producer serving queries in the existing authoritative index registry
Line-Count-Exception: desktop/macos/Desktop/Sources/Rewind/Core/RewindDatabase.swift | 3585 -> 3586 | Register one forward retirement migration implemented in its dedicated module
Line-Count-Exception: app/lib/utils/analytics/analytics_manager.dart | 2850 -> 2855 | Existing analytics authority emits bounded outcome action, channel and surface
🤖 Generated with Claude Code