Skip to content

fix: bind JIT admission on GCP dev before Beta 100% rollout - #12452

Merged
Git-on-my-level merged 15 commits into
mainfrom
fix/jit-beta-rollout-gcp-dev
Aug 31, 2026
Merged

Git-on-my-level merged 15 commits into
mainfrom
fix/jit-beta-rollout-gcp-dev

Conversation

@Git-on-my-level

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

Copy link
Copy Markdown
Member

What changed and why

Bind JIT admission on every GCP dev evaluator (GKE listen, Cloud Run listen, maintenance), then make first-open, ledger writes, empty-watchlist suppress, drain, and public-docs hygiene correct before flipping jit-processing-v1 to 100% of Omi Beta / TestFlight. Empty-extraction 500s already landed in #12410. Production api.omi.me PostHog is unchanged.

Product invariants affected

  • INV-AGENT-*
  • INV-DATA-1
  • INV-MEM-1
  • INV-MEM-4
  • INV-TASK-2

How it was verified

  • backend/.venv/bin/python -m pytest backend/tests/unit/test_backend_runtime_env_validator.py backend/tests/unit/test_conversation_jit_processing.py backend/tests/unit/test_first_open_effect_resume.py — 131 passed after rebase onto origin/main.
  • python3 .github/scripts/check_agent_doc_references.py and check_agents_md_lean.py — OK.
  • python3 backend/deploy/compose_runtime_env.py — generated runtime_env.yaml matches overlays (dev TZ recon on, prod off).
  • Did not deploy to GCP dev or flip PostHog in this PR. After merge: probe a non-allowlist Beta UID, then operators flip jit-processing-v1 to 100% on the dev PostHog project only. Keep the two-UID allowlist until soak.

Tests

  • Runtime-env compose requires PostHog + OMI_FIRESTORE_DATA_PLANE_PROJECT on listen/maintenance.
  • force_process=True still defers folders/apps when rollout admits; bypass_jit_first_open is the explicit reprocess hatch.
  • Empty folders initialize then assign; first-open never complete('folder_assignment') on a skip.
  • Ledger writes use the data-plane client; unknown preference slots stay unslotted.
  • macOS/Windows: complete empty watchlist suppresses; incomplete snapshot consumes the visit; Insight stays gated.
  • Cron skips writer_mode=ledger dreaming; sweep continues after one unknown slot.

Failure class (fixes)

Failure-Class: FC-rollout-flag-absent-from-a-cohost-of-its-code-path

Enabling jit-processing-v1 while GKE/Cloud Run listen and maintenance lacked POSTHOG_PROJECT_API_KEY (and GKE listen lacked the data-plane overlay) would have produced two behaviours for the same UID: Cloud Run chat/sync admitted, listen finalized as configuration_missing.

Test plan

After merge, deploy this PR to GCP dev. Probe a non-allowlist Beta UID:

  1. GET /v1/jit/rollout-decision on desktop-backend and Cloud Run backend → same effective=enabled once the flag is on for that UID (PostHog override before 100% is fine).
  2. Live-finalize via GKE listen: logs are not configuration_missing; first-open attaches.
  3. Kill-switch drill on dev PostHog, including allowlist, then off.
  4. Chat create_standing_trigger appears on Mac and Windows snapshots.
  5. Empty ledger: no ambient nano/full; Windows does not run Insight.
  6. Empty extraction conversation is 200.

Then flip jit-processing-v1 to 100% on the dev PostHog project. Watch writer_mode drain; do not claim extraction is off until ledger is the majority. Keep the two-UID allowlist until soak.

Windows TestFlight floor is builds that include #12381 / #12391 / #12397; older apps keep the legacy loop and cannot be remotely disabled.

Line-count exceptions

Oversized files grew by the JIT admission/sweep patches; splitting them is out of scope for this Beta-readiness PR.

Line-Count-Exception: backend/routers/conversations.py | 1955 -> 1956 | pass bypass_jit_first_open through create/finalize without splitting the router
Line-Count-Exception: backend/utils/conversations/process_conversation.py | 2561 -> 2572 | add bypass_jit_first_open so force_process stays a lazy-desktop hatch, not a JIT bypass
Line-Count-Exception: backend/utils/memory/canonical_memory_adapter.py | 3491 -> 3496 | keep empty replace_conversation_source a no-op after #12410 rebase
Line-Count-Exception: backend/utils/memory/daily_memory_sweep.py | 4994 -> 5008 | unknown-slot ValueError skips that candidate instead of aborting the day
Line-Count-Exception: backend/utils/sync/pipeline.py | 2527 -> 2528 | reprocess path sets bypass_jit_first_open

Review in cubic

Git-on-my-level and others added 13 commits August 30, 2026 21:50
JIT admission was invisible on GKE listen and memory-maintenance-job, so a
flag-on Beta cohort would still skip first-open and never drain to ledger.

Co-authored-by: Cursor <[email protected]>
Operators need bounded Prometheus signals for admission, writer-mode
transitions, and first-open claim/complete/fail without labeling UID.

Co-authored-by: Cursor <[email protected]>
Flutter create and macOS finalize set force_process to skip lazy-desktop
transcript deferral, which also skipped folder and app first-open. Split
that bypass so capture still defers expensive work when rollout admits.

Co-authored-by: Cursor <[email protected]>
An empty folder list was completing folder_assignment as a no-op, so
conversations never got a folder. Initialize system folders then assign,
and leave the effect pending when assignment still cannot run.

Co-authored-by: Cursor <[email protected]>
desktop-backend compute is a different GCP project from user data, so
create_standing_trigger and save_fact were landing where the snapshot
does not read. Fail closed when that overlay is unset on desktop-backend.

Co-authored-by: Cursor <[email protected]>
…over

POST /v3/memories was classified as a compatibility writer and 503'd in
ledger mode. Admit those creates as user writes, and persist a registry
slot from save_user_preference without failing the turn on unknown names.

Co-authored-by: Cursor <[email protected]>
…lback

Ambient is the cheap miss path after standing triggers exist; a ledger with none must not buy nano spend or start MemoryAssistant.

Co-authored-by: Cursor <[email protected]>
…lete snapshots

Insight must not run behind a toast-only gate while JIT rollout is on. A complete empty watchlist suppresses instead of ambient, and a ledger-mirror failure stays fail-closed for the mirror without reopening the legacy pipeline.

Co-authored-by: Cursor <[email protected]>
…m failing the sweep

Raise the per-run UID page so ledger cutover can catch Beta, skip short-term dreaming once writer_mode is ledger, and treat an unknown slot as a skipped candidate rather than aborting the day. Timezone reconciliation is on for GCP dev.

Co-authored-by: Cursor <[email protected]>
Unlisted Mintlify MDX is still a public URL. Move runbooks, flags, invariants, and agent rules next to owning code, add docs/AGENTS.md as the site allow-list, and correct the live kill-switch contract after the JIT authority page leaves the site.

Co-authored-by: Cursor <[email protected]>
The listen ExternalSecret and helm env bindings are new; without a secret-kind entry the deployment ratchet treats them as unclassified even though Cloud Run already used the same name.

Co-authored-by: Cursor <[email protected]>
Those tests opened the old Mintlify paths as files. After the pages left docs/, the pre-push unit selector failed on the missing oracle-review artifact.

Co-authored-by: Cursor <[email protected]>
The docs move updated the INV-UI-1 comment; dart format --line-length 120 rejected the typedef wrapping that rewrite left behind.

Co-authored-by: Cursor <[email protected]>
@mintlify

mintlify Bot commented Aug 31, 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 31, 2026, 2:09 AM

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

@Git-on-my-level
Git-on-my-level merged commit f83bdad into main Aug 31, 2026
47 checks passed
@Git-on-my-level
Git-on-my-level deleted the fix/jit-beta-rollout-gcp-dev branch August 31, 2026 04:01
Git-on-my-level added a commit that referenced this pull request Sep 1, 2026
…t lane with derived intent and a paced budget (#12549)

* feat(macos): route all proactive notifications through the JIT ambient lane with derived intent and a paced budget

A JIT-admitted account with no standing trigger produced zero Insight/Task
notifications since #12452 made an empty watchlist suppress, while the
legacy director was bypassed on every context visit. The ambient lane's
eight nano triages per day were also consumed within about a minute of the
first activity after local midnight, leaving the lane dead for the rest of
the day (owner account, 2026-08-30/31).

- Empty complete watchlist falls through to the ambient lane.
- Derived, expiring standing intent (open tasks, active goals, calendar
  presence) is compiled locally, matched deterministically, prioritised by
  the pacing policy, and grounds the full turn. Never a ledger row, never
  sent to the server.
- JITAmbientPacingPolicy spreads the daily nano budget (burst of two, then
  active-day/budget spacing, two reserved for intent matches) at the same
  server-authoritative totals.
- The legacy focus-nudge assistant yields while the JIT lane is active;
  the ambient full turn may answer focus_nudge under the Focus badge.
- Every admission and delivery-phase outcome is named in telemetry
  (empty_watchlist, ambient_paced, delivery_* reasons were 'other'/silent).

Co-Authored-By: Claude Fable 5.1 <[email protected]>

* feat(macos): address independent review of the JIT ambient lane

- Back off 30 minutes per local budget day after the server denies a nano
  reservation instead of re-reserving on every qualifying visit.
- Scope the legacy/JIT focus handoff to the admitted owner and publish it
  at startup snapshot sync, so the two producers never overlap and a later
  owner never inherits it.
- Emit one undeduped, content-free jit_proactivity_delivery event per
  terminal outcome with a bounded decision kind.
- Require two discriminating keywords per derived entry and treat generic
  workflow words as stopwords.
- Register the Windows empty-watchlist divergence in the parity register.

Co-Authored-By: Claude Fable 5.1 <[email protected]>

---------

Co-authored-by: Claude Fable 5.1 <[email protected]>
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