Skip to content

fix(subscription): report true plans and enforced BYOK transcription budgets - #21315

Merged
Git-on-my-level merged 10 commits into
mainfrom
lane/sub-w1-capability
Oct 12, 2026
Merged

Git-on-my-level merged 10 commits into
mainfrom
lane/sub-w1-capability

Conversation

@Git-on-my-level

@Git-on-my-level Git-on-my-level commented Oct 12, 2026 •

Copy link
Copy Markdown
Member

What changed and why

Capable clients receive catalog plan IDs through the existing X-Omi-Plan-Identity: 1 declaration or platform release floor. Subscription / UserSubscriptionResponse now accept the catalog's PlanType, including Plus and Unlimited v2, so the response model no longer rejects an admitted true-plan response. Payment subscription responses already use strings and accept these IDs; no payment behavior changed. Legacy callers still receive the server's existing unlimited remap.

The app-client OpenAPI default response preserves the catalog-derived legacy plan projection. The separate PlanIdentitySubscription / PlanIdentityUserSubscriptionResponse schemas describe the capability-qualified response through x-omi-plan-identity-response; the optional header is published as a request parameter. The unchanged compatibility checker still validates the complete default response. A regression deliberately widens that default enum and proves the checker rejects it. This is a negotiated schema, not an unconditional widening of the released decoder contract.

Earlier review nits remain fixed: closed/transient allowance projection retains a known finite catalog or snapshot budget rather than emitting the unlimited zero sentinel; mode/remaining remain closed. Windows uses its own independent floor/override and never inherits the macOS override. No plan allocation, feature grant, entitlement, lock, price, production setting or deployment changes.

Product invariants affected

none

Generated-client impact

Regenerated app-client OpenAPI and every Dart/TypeScript/Swift artifact through the repository generators. Dart schemas are byte-for-byte unchanged. Four TypeScript outputs add two interfaces and optional capability-header forwarding; response parsing and existing interfaces are unchanged. Swift adds an optional nil-defaulted header argument/forwarding only; its OmiAnyCodable response decoder and all DTOs are unchanged. No generated runtime decoder changed; installed binaries are untouched. This PR has existing handwritten transport changes, so it is not a generated-only Swift lane.

How it was verified

  • Safe backend unit layer: BACKEND_UNIT_TEST_FILE_LIST=/private/tmp/w0-21315-contract-tests.txt bash backend/test.sh — 245 passed (93 users-router, 12 subscription-wire, 62 plan, 64 allowance, 14 OpenAPI tests). Log /private/tmp/w0-21315-contract-tests-merged.log; rerun after merging origin/main at 7cc32e00f1b.
  • 24 real HTTP endpoint cases exercise both catalog IDs with the actual response model, wire predicate and resolver. Only storage/dependency boundaries are faked. Old iOS/Android, macOS 0.12.196, Windows 1.0.35, malformed capabilities and unidentified platforms retain unlimited; recognized header-1 callers and macOS 0.12.197/web floors serialize raw IDs. Finite Plus totals/remaining and genuine unlimited enforcement stay unchanged.
  • Flutter unit layer: TZ=UTC flutter test test/models/subscription_plan_type_test.dart test/unit/backend/http/shared_test.dart — 18 passed, covering lossless plan decoding and capability transport. These are source-fixture tests, not installed-release replay.
  • Closed-result resolver tests still cover subscription_inactive, usage_invalid, allowance_unavailable; fresh-module environment tests cover independent Windows defaults/override.
  • Hermetic OpenAPI export; unchanged compatibility checker passes against origin/main. All Dart/TypeScript/Swift generator freshness checks pass. Preflight, normal push gate and exact-head CI are reported in the handoff.
  • Not run: installed-client acceptance, physical devices, live authenticated app, production queries or deployment. Full backend CI shards are observed separately; the selected local run is not a full shard.

Required deployment order

#21315 backend must be deployed and verified before any mobile release containing #21314. Merge order alone is insufficient. Finite Plus-BYOK retains the old 300-minute snapshot until the backend projection is deployed. #21313's plan-name changes are already on main.

UI evidence

UI-Evidence: none -- Response contract and projection validated with hermetic HTTP tests; no installed UI acceptance.

Failure class

Failure-Class: none

Risks for reviewers

  • Confirm the capability/floor gate is the only selector for true plan labels; absent/malformed/unrecognized callers must retain legacy remapping. Floors/overrides must correspond to safe released decoders.
  • Review the two OpenAPI projections together: the default legacy response remains compatibility-checked, and the capability-qualified schema uses the same catalog enum as runtime. Generic clients must explicitly opt in; generators do not send the header by default.
  • Generated Swift/TypeScript changes must remain optional header forwarding and type-only additions; Dart/generated decoder behavior must remain unchanged.
  • Known finite totals and unknown-total snapshot fallback must preserve closed enforcement, genuine unlimited semantics and Plus exhaustion. BYOK synthetic Neo feature/phone access stays unchanged.
  • Deployment ordering remains a mobile-release gate; source/unit tests are not deployed or installed-client evidence. Windows purchase-card naming is fixed separately in draft fix(windows): use Pro on purchase cards and Select buttons #21345.

@Git-on-my-level Git-on-my-level changed the title fix(billing): send true plan IDs to capability-aware clients fix(subscription): report true plans and enforced BYOK transcription budgets Oct 12, 2026
@mintlify

mintlify Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated
omi 🟢 Ready View Preview Oct 12, 2026, 8:46 PM

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

@Git-on-my-level
Git-on-my-level marked this pull request as ready for review October 12, 2026 21:31
@Git-on-my-level
Git-on-my-level merged commit 10b7838 into main Oct 12, 2026
66 checks passed
@Git-on-my-level
Git-on-my-level deleted the lane/sub-w1-capability branch October 12, 2026 21:31
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-12T21:35:48.396355Z 7030610 Draft marked ready
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

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