Repository navigation
feat: ladder v1 plans and funded processing cap (default off) - #21488
Conversation
When live hours run out (or by choice), Omi keeps recording and can transcribe on the phone. This adds the mobile UI for that, behind the default-off PostHog flag mobile-on-device-overflow: - at-cap choice sheet (transcribe on this phone / upgrade), offered from the existing freemium prompt only when the flag is on and live hours are used up - model setup (step 1) and schedule picker (step 2: while charging, every few hours, as you talk) - conversations-list banner for audio waiting on the phone, waiting chips on recording rows, finish-setup and unsupported-phone variants - provenance chips on conversation rows and a provenance section on the summary (why, Redo with Omi Cloud, keep everything on this phone) - On-Device Transcription settings page and its entry row - settings model persisted via SharedPreferencesUtil, a pure scheduling policy, an OnDeviceModel abstraction (Android Whisper, iOS unavailable until Parakeet lands), and placeholder benchmark numbers in one file With the flag off every new surface renders nothing. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Settings > Plan renders GET /v2/payments/plans behind web-plan-storefront (default off): backend header, current line, legacy note, usage meter, interval toggle, tier cards, blocked lines and CTAs, verbatim. Purchases use the payload's price ids through the existing checkout-session and upgrade-subscription rails, gated by the same checkout decision as mobile. web-contextual-upsells adds the budget meter, the 80% nudge and the exhausted-budget entry (trigger=usage_budget, Architect for Pro at 100%). Unknown fields are ignored; unknown actions, intervals, usage kinds and plan ids render inert. The registry scanner now sees TypeScript PostHog flag constants, and the four web/desktop flags are registered. Co-Authored-By: Claude Opus 5.5 <[email protected]>
At 100% the payload has no nudge_line, so the banner drew a bare button. Co-Authored-By: Claude Opus 5.5 <[email protected]>
… payload Settings > Plan & Usage renders GET /v2/payments/plans behind desktop-plan-storefront (default off) in place of the local plan card and grid: backend header, current line, legacy note, usage meter, interval chips, tier cards, blocked lines and CTAs, verbatim. Purchases use the payload's price ids through the existing startCheckout rail (upgrade for paid subscribers, checkout session for Free and resubscribe), gated by the same checkout decision as mobile and web. desktop-contextual-upsells adds the 80% nudge and the exhausted-budget sheet (trigger=usage_budget). Tests run every backend golden through the decoder and checkout boundary, and render the review states offscreen with ImageRenderer. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Add gated native engines, phone-only WAL custody, charging schedulers, and hash-bound summary provenance. Co-Authored-By: Codex <[email protected]>
Preserve both main localization updates and flagged on-device copy through the l10n tool. Co-Authored-By: Codex <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Regenerate the complete merged locale set and record all 22 audited UI states with SF Pro fonts. Co-Authored-By: Codex <[email protected]>
Use SafeDefaults for the background charging policy and guard the dynamically loaded native bridge. Co-Authored-By: Codex <[email protected]>
Co-Authored-By: Codex <[email protected]>
Co-Authored-By: Codex <[email protected]>
Co-Authored-By: Codex <[email protected]>
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Automations to automatically generate PRs for you. |
…ne/sub-ladder-cutover
…lane/sub-ladder-cutover # Conflicts: # backend/docs/listen_pusher_pipeline.mdx # config/feature-flags.yaml
# Conflicts: # backend/docs/listen_pusher_pipeline.mdx # config/feature-flags.yaml # scripts/test_check_feature_flag_registry.py
REST admission already skipped that gate; tools/call was still checking it. Co-authored-by: Cursor <[email protected]>
The read-limit field bumped the catalog, and the fixture already carries that revision. Co-authored-by: Cursor <[email protected]>
Co-authored-by: Cursor <[email protected]>
A reached cap stays a tool result. A Redis outage keeps Retry-After, matching REST. Co-authored-by: Cursor <[email protected]>
Pyright rejects isinstance on List[str], and that error blocks the push after merging main. Co-authored-by: Cursor <[email protected]>
…lds. Merging main added one unbraced if, and this branch already carried another. Co-authored-by: Cursor <[email protected]>
Co-authored-by: Cursor <[email protected]> # Conflicts: # backend/database/announcements.py
Co-authored-by: Cursor <[email protected]> # Conflicts: # backend/tests/fast_unit_duration_allowlist.txt
# Conflicts: # backend/tests/support/firestore_query_driver_registry.py
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: bad5808883
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if snapshot is not None and snapshot.state == 'capped': | ||
| raise HTTPException(status_code=402, detail={'error': 'usage_budget_exhausted', 'trigger': 'usage_budget'}) |
There was a problem hiding this comment.
Distinguish allowance outages from exhausted budgets
When the subscription or usage lookup transiently fails, funded_processing.allowance() returns allowance_unavailable, and processing_backlog.snapshot() deliberately sets budget_exhausted to false while retaining the capped state. This branch ignores that distinction and returns a permanent 402, causing clients to present an upgrade/exhaustion flow during an outage instead of retrying. Check budget_exhausted and return a retryable unavailable response for this case.
Useful? React with 👍 / 👎.
|
|
||
| /// Reads the gate once; when on, loads settings and checks the model. Safe to call from every | ||
| /// surface's initState. | ||
| Future<void> ensureLoaded() => _loading ??= _load(); |
There was a problem hiding this comment.
Re-evaluate the overflow gate when the account changes
When user A signs out and user B signs in without restarting the app, this process-wide singleton retains the completed _loading future, so B never gets a PostHog gate read under their own identity. B consequently inherits A's rollout decision and potentially the enabled custody behavior, or remains excluded despite being assigned to the rollout, until the process restarts. Invalidate or reload this controller on logout or analytics identity changes.
Useful? React with 👍 / 👎.
| if call.method == "backgroundComplete" { | ||
| backgroundTask?.setTaskCompleted(success: true); backgroundTask = nil; rescheduleBackground(); reply(nil); return |
There was a problem hiding this comment.
Forward the background run result to iOS
When an iOS background transcription or storage run fails, both Dart execution paths call backgroundComplete with success: false, but this branch discards that argument and always reports success to BGTaskScheduler. Failed work is therefore indistinguishable from a successful run to iOS and bypasses the scheduler's failure handling while the audio remains queued; read the supplied success value when completing the task.
Useful? React with 👍 / 👎.
| final deleteFuture = conversationId.startsWith('ondevice-') | ||
| ? (OnDeviceTranscriptionController.instance.deleteLocalConversation?.call(conversationId) ?? | ||
| Future.value(false)) | ||
| : conversationDeleteFetcherOverride?.call(conversationId) ?? deleteConversationServer(conversationId); |
There was a problem hiding this comment.
Remove retained WALs after deleting cloud-backed rows
When on-device transcription sends a transcript to the cloud, the resulting normal server ID is stored in the original onDeviceOnly WAL, but this branch removes the WAL only for IDs beginning with ondevice-. Deleting a cloud-backed on-device conversation therefore leaves its audio and serialized conversation on the phone, and a new runner generation republishes that deleted row from wal.onDeviceConversation. After the server deletion succeeds, also remove the matching retained WAL so the conversation cannot reappear and its audio is actually deleted.
Useful? React with 👍 / 👎.
| } | ||
|
|
||
| bool get shouldKeepAudioLocal => _active && _settings.enabled && (_atCap || (_paid && _settings.saveLiveHours)); | ||
| ServerConversation displayConversation(ServerConversation row) => applyOnDeviceProjection(row, enabled: _active); |
There was a problem hiding this comment.
Register provenance for conversations fetched after startup
The controller populates _provenance only from the cache present during _load() or from conversations completed by the local runner. Conversations fetched from the server later are passed through this method, but it only applies the projection and never records the provenance derivable from their on_device:* transcript segments. Newly synced or folder-filtered on-device conversations can consequently render without their provenance chip, explanation, and related actions until an incidental cache reload or restart; register OnDeviceProvenance.fromConversation(row) here or at the fetch integration point.
Useful? React with 👍 / 👎.
| installed = await SpeechAnalyzerTranscription.isInstalled(locale) | ||
| } else if selected == "parakeet_v2" { | ||
| installed = FileManager.default.fileExists(atPath: marker.path) | ||
| } else { installed = legacyRecognizer(language: language) != nil; supported = installed } |
There was a problem hiding this comment.
Treat denied speech authorization as unavailable
On devices and locales that select the SFSpeech fallback, a previously denied Speech Recognition permission still produces a recognizer, so this status path reports the engine as installed. Setup then enables on-device custody without requesting or explaining the missing permission, while every transcription fails at the later authorization guard and leaves audio queued indefinitely. Include the authorization state in readiness or obtain permission during setup so a denied engine is not advertised as installed.
Useful? React with 👍 / 👎.
| // and the same audio_*.bin naming. The backend ignores this segment; keep it | ||
| // in sync with Dart's `batchRecordingDevice`. | ||
| val name = "audio_omibatch_${config.codec}_${config.sampleRate}_1_fs${frameSize}_${startSec}.bin$PART_SUFFIX" | ||
| val marker = if (boolPref("onDeviceOverflowActive", false)) "omibatchoverflow" else "omibatch" |
There was a problem hiding this comment.
Rotate the batch file when overflow custody changes
When on-device custody becomes active while Transcribe Later already has a batch file open, this marker is evaluated only when opening the file, and changing onDeviceOverflowActive does not close the current one. Up to the remainder of the 15-minute file can therefore be written under the ordinary omibatch name, which the recordings provider permits through its cloud upload path instead of handing to the on-device runner; the inverse transition can also misclassify later audio as overflow. Cut the open file on every custody-mode transition before accepting the next frame on both native writers.
Useful? React with 👍 / 👎.
…App Store Connect accepts the build Since #21488 every TestFlight upload fails with ITMS-90057: OnDeviceParakeet.framework's generated Info.plist has no CFBundleShortVersionString because the framework target set no MARKETING_VERSION. Co-Authored-By: Claude Fable 5.1 <[email protected]> (cherry picked from commit a8426b6)
…TestFlight uploads succeed again (#22239) ## Summary Since #21488 (merged today 19:53Z) every Codemagic `ios-internal-auto` upload fails at Publishing with ITMS-90057: `OnDeviceParakeet.framework` is missing `CFBundleShortVersionString`. The new framework target has `GENERATE_INFOPLIST_FILE = YES` and `CURRENT_PROJECT_VERSION = 1` but no `MARKETING_VERSION`, so the generated Info.plist has no short version. This sets `MARKETING_VERSION = 1.0` on the framework's configurations (the same value the watch targets use). Evidence: Codemagic builds 6ad5403b (branch) and the main build at 21:15Z (6d4ddac) both fail with that error; 1b94a9c at 15:17Z (before #21488) published fine. ## Testing `plutil -lint` on the project file passes; the real test is the next `ios-internal-auto` upload on main. Failure-Class: none UI-Evidence: none -- build configuration only, no UI change 🤖 Generated with [Claude Code](https://claude.com/claude-code)
…App Store Connect accepts the build Since BasedHardware#21488 every TestFlight upload fails with ITMS-90057: OnDeviceParakeet.framework's generated Info.plist has no CFBundleShortVersionString because the framework target set no MARKETING_VERSION. Co-Authored-By: Claude Fable 5.1 <[email protected]>
#21488 put utils/storefront_copy.py (babel) in the pusher import closure through utils/subscription and utils/ladder_v1. The post-merge image contract check fails every pusher build since f6a3589 with 'missing installed dependency modules: babel'. Add babel==2.18.0 (same pin as backend/requirements.txt) and relock pusher/pylock.toml; the relock adds only babel. Co-authored-by: Claude Opus 5.5 <[email protected]>
Five unit files fail on current main. Each one passed on its own PR's base and broke when main moved underneath it; none is a product regression. - test_request_context.py (#19738): tested the JIT budget surface that #22209 removed from llm_gateway/gateway/request_context.py. Keep the request-id tests; drop the tests for removed code. - test_users_joan_followup_tombstone_guard.py (#19867): called delete_person_endpoint, but the joan followup route is delete_followup_question_endpoint. - test_developer_from_segments_idempotency.py (#21265): process fakes rejected the trigger=CLIENT_FINALIZE kwarg the router passes since #19788. - test_external_tools_sanitization.py (#19406): the stubbed utils package lacked utils.generated_compute (#21488) and utils.model_text. Stub the default-off gate as disabled and load the stdlib-only model_text for real. - test_batch_upload_storage.py: the database.vector_db stub lacked delete_action_item_vectors_batch, which merge_conversations imports since #15953. Failure-Class: none Co-Authored-By: Claude Opus 5.5 <[email protected]>
) * fix(backend): restore pyright-clean main after #22207 and #22326 Main's backend unit shards fail the enforced pyright lane: - database/desktop_previews.py (#22207): 16 reportUnnecessaryIsInstance errors. The runtime guards stay; they move into validators that take `object` (_payload, _string, _expected_generation, _datetime), so the checks are meaningful to pyright. Public signatures, error messages and check order are unchanged. - utils/sync/pipeline.py:process_segment (#22326 on top of #22452): "code is too complex to analyze". Behaviour-neutral split: the two identical cap-hold defer blocks become one hold_for_cap closure, and the final-pass / speaker-identification block moves to _assign_segment_speakers with the same exception handling. Failure-Class: none Co-Authored-By: Claude Opus 5.5 <[email protected]> * test(backend): repair unit tests that drifted from main across merges Five unit files fail on current main. Each one passed on its own PR's base and broke when main moved underneath it; none is a product regression. - test_request_context.py (#19738): tested the JIT budget surface that #22209 removed from llm_gateway/gateway/request_context.py. Keep the request-id tests; drop the tests for removed code. - test_users_joan_followup_tombstone_guard.py (#19867): called delete_person_endpoint, but the joan followup route is delete_followup_question_endpoint. - test_developer_from_segments_idempotency.py (#21265): process fakes rejected the trigger=CLIENT_FINALIZE kwarg the router passes since #19788. - test_external_tools_sanitization.py (#19406): the stubbed utils package lacked utils.generated_compute (#21488) and utils.model_text. Stub the default-off gate as disabled and load the stdlib-only model_text for real. - test_batch_upload_storage.py: the database.vector_db stub lacked delete_action_item_vectors_batch, which merge_conversations imports since #15953. Failure-Class: none Co-Authored-By: Claude Opus 5.5 <[email protected]> --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
Adds the dark ladder v1 storefront, shared usage admission, on-device overflow, and encrypted custody for capped audio. At the funded cap, every conversation source and generated/background feature pauses Omi-paid processing while stored transcripts remain visible.
Validation: 617 targeted backend tests pass through backend/test.sh, including actual FastAPI pre-stream chat 402 and subscription serialization, current-ledger cap crossing, month rollover, pagination, completed deferral versus in-flight reservation, and queued upgrade failures. The real loopback Java Firestore emulator passes the transaction/receipt/lease cases. All 36 on-device overflow widget tests pass; prior Flutter state tests, 49-locale checks and 115 v5 renders passed. Both full local preflight and draft-body validation passed all 91 checks. Grok returned APPROVE for production candidate 8f52870 after all findings were closed (read-only execution exec-rose-easy-essay-piano-federal-donkey). Final head 6517c4d adds one explicit chat-fixture method and changes no production source. Full backend typecheck refreshed on the final candidate reports zero errors. All backend shards and native CI passed on 197253f; its stale title assertion is fixed and passes locally. Final-head CI is terminal: 51 passed, 11 skipped, and CodeQL alone failed (https://github.com/BasedHardware/omi/runs/117550953191). All six backend shards, full Flutter analyzer/tests, Android emulator acceptance and JVM/APK checks, iOS compile, desktop Swift tests and release compile passed. The final-head CodeQL path/title/message annotation signatures exactly match the 12 recorded baseline alerts; overall CI remains blocked. CodeQL's same 12 alerts were independently verified open on main b325c77; none were suppressed or dismissed. Keep DRAFT. Fixtures do not prove physical-device or production-provider acceptance.
CI follow-up: real disabled-path helper imports are dependency-free; heavy worker imports occur only for active work. Backlog API/domain parsing consumes generated DTOs. Inactive A/B/C surfaces allow absence of a subscription provider. Storage-only projection references and the server-authored deferred flag are explicitly classified, with a sentinel test proving canonical structure stays projection-free and an existing row is never overwritten.
The normal pre-push timing guard caught a cold-cache import on known legacy bypasses. The bypass now returns before session import/allocation; 61 focused policy/cache tests pass with the unchanged CPU threshold.
The funded gate is the shared prevention primitive. The inventory backstop covers the e708396 trace in this PR: on-device conversation processing and generated endpoints could spend after the displayed cap. Selector coverage ensures future endpoint/inventory changes run that guard without replacing unmapped-source full-suite fallback.
INV-MEM-1: upstream citation-rendering integration preserves the three existing memory tiers and existing default Archive visibility.
INV-MEM-3: Capped AI profile generation stops before provider work while canonical memory reads and privacy tombstones retain their existing authority.
INV-TASK-2: Deferred capture returns before task extraction; explicit backlog processing reuses the existing Candidate versus conservative-writer policy.
INV-MEM-4: runtime-environment integration preserves existing canonical consolidation, receipt, and graph authority; no memory promotion or migration policy changes.
INV-DATA-1: canonical account/data-plane authority is preserved; the headless engine reuses existing Firebase/profile initialization. Local debug fixtures are not shipped routing changes.
INV-CAP-1: suppressed live PCM enters the encrypted server hold store; synced client WAL behavior is restored. Published holds recover through fenced piece receipts; in-flight hard-kill limits are documented.
INV-UI-2: composer pause and contextual plans use existing Omi controls and shared confirmation; modal dismissal consumes Escape.
INV-CHAT-1: composer presentation uses the existing shared quota/provider; no new timeline, journal writer or continuity handler.
INV-UI-3: on-device provenance never invents speaker separation or named/count labels.
Failure-Class: FC-stt-allowance-not-enforced-at-dispatch
Line-Count-Exception: app/lib/pages/settings/transcription_settings_page.dart | 1572 -> 1574 | Narrow entry to the isolated flagged on-device settings
Line-Count-Exception: app/lib/providers/conversation_provider.dart | 2127 -> 2139 | Narrow local conversation provenance and account-owned WAL integration
Line-Count-Exception: app/lib/services/capture/capture_controller.dart | 4493 -> 4527 | Render connection-scoped server custody receipts on the existing capture listener
Line-Count-Exception: app/lib/services/wals/local_wal_sync.dart | 2728 -> 2752 | Existing lane WAL integration; all held-live rewind and retention changes removed
Line-Count-Exception: backend/database/conversations.py | 4226 -> 4276 | Narrow funded-admission and deferred-state integration; drop the request summary memo only after that transaction commits
Line-Count-Exception: backend/database/firestore_index_registry.py | 2200 -> 2208 | Register the newest-first held-audio list index beside the existing requirements
Line-Count-Exception: backend/routers/apps.py | 2632 -> 2657 | Narrow funded-admission and deferred-state integration at existing caller; policy and backlog implementation stay in dedicated modules
Line-Count-Exception: backend/routers/conversations.py | 2399 -> 2404 | Narrow funded-admission and deferred-state integration at existing caller; policy and backlog implementation stay in dedicated modules
Line-Count-Exception: backend/routers/developer.py | 2747 -> 2759 | Optional on-device STT provenance reaches the existing transcript ingest seam
Line-Count-Exception: backend/routers/listen/receiver.py | 2635 -> 2755 | Wire bounded server custody and serialized funded resume; storage and replay-span logic live in a dedicated module
Line-Count-Exception: backend/routers/payment.py | 1753 -> 1784 | Narrow flagged ladder price checkout binding
Line-Count-Exception: backend/routers/sync.py | 2903 -> 2911 | Shared flagged budget admission before file consumption
Line-Count-Exception: backend/routers/users.py | 2598 -> 2670 | Additive flagged chat pause and held-audio totals on the existing subscription response; copy and admission live in dedicated modules
Line-Count-Exception: backend/utils/apps.py | 1711 -> 1718 | Narrow funded-admission and deferred-state integration at existing caller; policy and backlog implementation stay in dedicated modules
Line-Count-Exception: backend/utils/conversations/process_conversation.py | 3630 -> 3726 | Narrow funded-admission and deferred-state integration at existing caller; policy and backlog implementation stay in dedicated modules
Line-Count-Exception: backend/utils/subscription.py | 1978 -> 2064 | Shared flagged ladder policy at existing admission/reporting boundaries
Line-Count-Exception: backend/utils/sync/pipeline.py | 3415 -> 3439 | Preserve owned scratch cleanup and live recovery capture partition; shared VAD keeps short speech only for server-origin holds
V5 UI evidence (synthetic widget fixtures, commit
f6021fa49b4cd7a237a814c4cf856c99ff1be6a6):