Repository navigation
feat(desktop): fail-closed basic plan gate on proactivity, proxy embeds, and eager extraction - #14165
Merged
Merged
Conversation
…ds, and eager extraction S14 proactivity half, flag-off track: PlanType.basic can no longer reach paid providers on the three remaining omi-funded desktop surfaces. - desktop_proactivity: route-level authorize_managed_compute gate (desktop_proactive_extraction / desktop_proactive_reasoning lanes); 402 plan_gated, 503 on authorization outage, BYOK contract unchanged. - desktop_proxy: embedContent / batchEmbedContents join _PLAN_GATED_PROXY_ACTIONS (TBD-4 resolved closed); same 402 mapping. - process_conversation: flag-off identified-basic eager deny for first-open (force_process) and manual reprocess on desktop sources via resolve_free_tier_processing_plan — deterministic minimum, no second pipeline; identification failure fails open. - inventory yaml: fallback_on_deny http_402 for proactive lanes; embed gate note. - new test_pusher_conversation_ledger_instrument.py pins the pusher ledger instrument halves (gateway attribution headers + flag-gated ledger write).
Git-on-my-level
added a commit
that referenced
this pull request
Sep 17, 2026
…lt-off switches (#14316) #14165 merged a 402 on desktop proactivity completions, a 402 on Gemini proxy embeds, and a deterministic-minimum landing for flag-off desktop first-open and reprocess, all unconditional, while its description said production would stay ungated. The next routine production deploy would have switched all three on before any on-device replacement had shipped. Each gate now reads its own call-time env switch (default off, explicit true in dev, explicit false in prod, declared on every host of its code path, including backend-sync-backfill). Off performs no authorize call and writes no marker. Deploy admission accepts only exact true/false for the co-hosted switch. The S14 generate/stream proxy gate that is already live in production is unchanged. Failure-Class: new Co-Authored-By: Claude Fable 5.1 <[email protected]>
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
Track B (SCA-482): fail-closed basic gate on the three remaining omi-funded desktop spend surfaces — no
FREE_TIER_*flag flip, noBASIC_TIER_*overlay change.desktop_proactivitycompletions — route-levelauthorize_managed_computegate onproactive_completionvia the per-operation model-config lane (desktop_proactive_extraction/desktop_proactive_reasoning). Basic + omi-funded →402 plan_gatedbefore any quota or provider work; authorization outage →503; a validated BYOK key for the lane's provider funds the call unchanged (existing JIT contract, no second pipeline).desktop_proxyGemini embeds (TBD-4 closed) —embedContent/batchEmbedContentsjoin_PLAN_GATED_PROXY_ACTIONS, sharingscreen_frame_judge's Gemini provider binding so the BYOK exemption stays provider-exact. Same 402 mapping as generate/stream.process_conversation, flag-off) — first-open (force_process) and manual reprocess of desktop conversations now consultresolve_free_tier_processing_planthrough the same_managed_compute_decision_forclosure the flag-on branch uses. An identified basic deny lands at the deterministic minimum (terminal store,terminal_no_derived_effects); identification failure and authorization outages fail open, matchingshould_defer_desktop_processing's documented contract. Non-desktop sources untouched — the summary flip stays held.test_pusher_conversation_ledger_instrument.pypins both ledger halves hermetically: gateway attribution headers (X-Omi-LLM-Feature) on theconv_structurelane client, and the caller-sidemanaged_spend_ledgerwrite gated onLLM_GATEWAY_ACCOUNTING_ENABLED. The flag is already checked-in true on both pusher charts (backend/charts/pusher/{dev,prod}_omi_pusher_values.yaml, PR chore(pusher): reach LLM_GATEWAY_ACCOUNTING_ENABLED to both pusher charts #13330) — no chart change needed in this PR.FREE_TIER_LOCAL_PROCESSING/FREE_TIER_MEMORY_SUPPRESSIONremain OFF on every identity.BASIC_TIER_*overlays untouched. No prod env mutation in this PR.Failure-Class: FC-shared-spend-gate-missing-on-sibling-producers
Product invariants affected
Line-Count-Exception: backend/routers/desktop_proxy.py | 1689 -> 1692 | embedContent/batchEmbedContents join _PLAN_GATED_PROXY_ACTIONS (TBD-4 closed); no logic added
Line-Count-Exception: backend/utils/conversations/process_conversation.py | 3101 -> 3167 | flag-off identified-basic eager-deny gate: one helper + one branch reusing the existing S6 policy and deterministic-minimum store, no second pipeline
Evidence
Fail-closed sabotage proof (gate removed → red, restored → green)
await _enforce_proactive_plan_gate(...)from the routetest_proactive_completion_rejects_basic_before_quota_or_provider_PLAN_GATED_PROXY_ACTIONStest_gemini_proxy_rejects_basic_embed_contenteliftest_flag_off_first_open_basic_is_deterministic_minimum_get_structuredcalled)Tests run (Python 3.11 venv, worktree base
origin/main@d36cdaff41)Matrix harness note: expectations are derived from a three-way
_outcomehelper (process/legacy_defer/terminal) — flag-on desktop basic is always the policy minimum;_legacy_defersonly applies flag-off. Eager-gate-consulting legacy tests patch the authorize seam so no test waits out a real Firestore fail-open (was 265–284s each, now sub-second).Ledger / serving-env evidence (read-only inspect, env names only)
dev-omi-gke/ nsdev-omi-backend: deploymentdev-omi-pusherlive env includesLLM_GATEWAY_ACCOUNTING_ENABLEDandOMI_LLM_GATEWAY_URL(63 env names total) — matches the checked-in dev chart.prod-omi-gke/ nsprod-omi-backend: deploymentprod-omi-pusher(15 replicas) live env omitsLLM_GATEWAY_ACCOUNTING_ENABLED(OMI_LLM_GATEWAY_URLpresent; 68 names total) — the live prod workload lags the checked-in chart from chore(pusher): reach LLM_GATEWAY_ACCOUNTING_ENABLED to both pusher charts #13330. Residual operator item: next prod pusher rollout picks the flag up; no prod write performed here.desktop_chat_realtime: 0 prod ledger rows all-time (reported fact from the S14 ledger review; unchanged by this PR — realtime is not on this fail-closed path).Product scope
Named change (transcripts + search free; insights paid): DEV/beta
402 plan_gatedon proactivity + proxy embeds + eager extraction is the intended beta product. Prod stays ungated until a separate ask. No iOS/macOS floor bumps. BYOK-basic keeps the user-key path exactly as the JIT contract defines it.