Skip to content

feat(desktop): add context bucket proactivity engine - #11431

Closed
Git-on-my-level wants to merge 3 commits into
mainfrom
codex/context-buckets-proactivity
Closed

Git-on-my-level wants to merge 3 commits into
mainfrom
codex/context-buckets-proactivity

Conversation

@Git-on-my-level

@Git-on-my-level Git-on-my-level commented Aug 11, 2026 •

Copy link
Copy Markdown
Member

Summary

  • implement the ratified context-bucket visit, storage, rollup, privacy, provenance, delivery-ledger, and single-shot director flow behind context_buckets
  • add a Firebase-authenticated desktop-backend facade with server-pinned Nano extraction and Luna reasoning lanes, fail-closed Redis quotas, strict JSON-schema requests, and cache-accounting envelopes
  • preserve flag-off behavior, keep canonical memory and MemoryAssistant untouched, and confine task graduation to the canonical candidate API through CandidateSink

Plan: context buckets + unified proactivity engine rev 4

Gateway spike

The required live dev-gateway spike ran before facade implementation:

  • both new lanes accepted a valid 64x64 PNG plus strict json_schema
  • omi:auto:desktop-proactive-extraction resolved to Nano; omi:auto:desktop-proactive-reasoning resolved to Luna
  • Luna explicit-cache round trip reported cache_write_tokens=3289, then cached_tokens=3289 on the immediate repeat
  • generated prompt_cache_retention=24h and explicit 30-minute cache options both survived without facade stripping
  • measured payloads were 785 bytes for the image request and 25,965 bytes for the cache request; observed latency was 0.94-1.44 seconds

The scratch spike was not shipped.

Grounding drift

The plan was grounded at 454b153ab7. The implementation was repeatedly rebased as main advanced and is now based exactly on b626e60b5e477f6fb2b03be2cf99638c26e4a9df; final head is 9a7ce2b91a1a3d544f8c01e533e33fd7cc8e8c55. The last upstream change added desktop Gemini quotas and strengthened the direct-gateway exception guard. The branch retained upstream's policy-aware guard and added the two proactive structured-output lanes to its inventory. The final tree reran the complete PR preflight, Swift build, and deterministic focused suites.

Review hardening

Three independent adversarial review lanes and Cubic findings were applied together:

  • privacy purge invalidates visit fences, removes excluded on-disk JPEG/HEVC artifacts including shared chunks and every referencing row, deletes frozen bucket-version bytes, rebuilds only from surviving rows, and retries durably after failure
  • exact owner/session snapshots and local mutation commit leases fence candidate graduation, subject binding, typed queries, queued notifications, rollups, Rewind capture/encoding/inserts, OCR embedding work, searches, timeline publication, and cleanup across account transitions
  • Rewind capture uses exclusion generations so already-admitted frames cannot reinsert after purge; owner changes also clear persisted and decoded Rewind UI state
  • queued cards remain policy_approved until actual presentation; dropped cards terminalize without graduating candidates, and abandoned attempts are reconciled deterministically
  • the backend facade validates the complete strict-schema envelope and returned content, adds the explicit-cache breakpoint, and preserves bounded cache accounting
  • visit transitions are serialized and coalesce the latest destination, numeric document identities no longer collapse, and Insight SQL privacy handles quoted/commented/schema-qualified screenshot references
  • a flag-on dev-beta dogfood recipe covers the real lifecycle without synthetic eligibility, model fixtures, benchmarks, evals, shadow periods, or release gates

Intentional small deviations

  • ambient compaction is deterministic and byte-bounded; the optional best-effort LLM recompaction queue was omitted under D8
  • startup/daily GC is one bounded local transaction instead of a separate idle scheduler
  • facade fallback class remains unknown until gateway executor metadata is exposed, as allowed by the plan

Verification

  • focused Swift suite: 62 passed, 0 failed
  • isolated backend suites: 127 unit checks passed; structured-output integration contract: 1 passed
  • strict desktop e2e coverage: 39/39 changed Swift sources covered
  • desktop flow metadata lint: 70 flows, 155 registered actions
  • line-count ratchet: 42 changed product sources passed
  • full bounded pre-push: all 32 selected PR-preflight checks, backend typecheck, selected backend tests, OpenAPI generation, full debug Swift build, flow lint, Black, SwiftLint, and swift-format passed against b626e60b5e
  • SwiftLint full scope: 0 violations
  • gateway spike and named dev-beta dogfood evidence are recorded in the linked project

Product invariants

  • INV-AUTH-1: the facade uses the existing Firebase dependency and desktop paywall boundary; exact account-generation checks fence asynchronous work
  • INV-CHAT-1: durable notification provenance is appended only inside the existing untrusted floating-bar context block; chat lifecycle and mutation ownership are unchanged
  • INV-UI-1: no visual redesign; the existing floating-bar presentation path is reused

Review in cubic

Failure-Class: none

@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.

All reported issues were addressed across 52 files

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

Re-trigger cubic

Comment thread backend/routers/desktop_proactivity.py Resolved
@Git-on-my-level
Git-on-my-level force-pushed the codex/context-buckets-proactivity branch 3 times, most recently from d5f1c8a to d91b9c0 Compare August 11, 2026 23:38
@Git-on-my-level
Git-on-my-level force-pushed the codex/context-buckets-proactivity branch from d91b9c0 to ff30801 Compare August 12, 2026 00:09
@Git-on-my-level

Copy link
Copy Markdown
Member Author

Superseded by combined PR #11447.

@github-actions

Copy link
Copy Markdown
Contributor

Hey @Git-on-my-level 👋

Thank you so much for taking the time to contribute to Omi! We truly appreciate you putting in the effort to submit this pull request.

After careful review, we've decided not to merge this particular PR. Please don't take this personally — we genuinely try to merge as many contributions as possible, but sometimes we have to make tough calls based on:

  • Project standards — Ensuring consistency across the codebase
  • User needs — Making sure changes align with what our users need
  • Code best practices — Maintaining code quality and maintainability
  • Project direction — Keeping aligned with our product principles and locked invariants

Before your next PR, please skim:

  • PRODUCT.md — product north star
  • Product invariants — locked rules (shared chat, memory tiers, agent control plane, integrations, brand)

If this was declined for direction or taste, maintainers should cite an invariant ID or open a proposed one — ask if that citation is missing.

Your contribution is still valuable to us, and we'd love to see you contribute again in the future! If you'd like feedback on how to improve this PR or want to discuss alternative approaches, please don't hesitate to reach out.

Thank you for being part of the Omi community!

Git-on-my-level added a commit that referenced this pull request Aug 13, 2026
## Summary

- supersede #11431 and #11433 with one integrated branch on current
`main`
- ship universal memory/task convergence together with context-bucket
proactivity
- add configurable 24-hour notification active periods, persistent
frequency budgets, quiet-period cost short-circuiting, typed
notification presentation, and deterministic QA controls
- repair notification permission lifecycle, message-action hit testing,
and repeated screen-derived Suggested Task reconciliation

## Validation

- 4,730 Desktop tests passed, 1 skipped, 0 failed before main
integration
- 91 focused merged-tree Swift tests passed
- 19 merged-tree backend proactivity/quota tests passed
- SwiftLint and swift-format clean
- product file line-count ratchet and mutation fixtures pass
- final bounded pre-push gate passed after current-main integration;
backend pyright: 0 errors
- 27 focused notification/suggestion Swift tests, 56 memory/export
tests, and 34 privacy tests pass
- signed `/Applications/omi-qa-main.app` rebuilt from the final branch;
03:00–06:00 active period and Maximum frequency persist across relaunch

## Product invariants affected

- INV-AGENT-*
- INV-AUTH-1
- INV-CHAT-1
- INV-MEM-1
- INV-MEM-2
- INV-MEM-3
- INV-MEM-4
- INV-MEM-5
- INV-TASK-1
- INV-CUTOVER-1
- INV-DATA-1
- INV-INT-1
- INV-UI-1

Failure-Class: FC-split-mutation-authority


<!-- This is an auto-generated description by cubic. -->
<a
href="https://cubic.dev/pr/BasedHardware/omi/pull/11447?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. -->
pull Bot pushed a commit to codingwatching/omi that referenced this pull request Aug 13, 2026
@undivisible
undivisible deleted the codex/context-buckets-proactivity branch August 20, 2026 13:18
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