Skip to content

Cloud plan entitlements honour cmuxVmPlan and company account grants, as classic Cloud does - #26817

Merged
teamleaderleo merged 8 commits into
feat-cmux-nextfrom
p0m-cloud-plan-overrides
Oct 28, 2026
Merged

teamleaderleo merged 8 commits into
feat-cmux-nextfrom
p0m-cloud-plan-overrides

Conversation

@teamleaderleo

@teamleaderleo teamleaderleo commented Oct 28, 2026 •

Copy link
Copy Markdown
Collaborator

What

NEXT Cloud machine limits now honour the two grants classic Cloud honours. Before this, NEXT read only cmuxPlan.

  • cmuxVmPlan: the operator grant on the sign-in record. NEXT applies classic's precedence (web services/billing/teamResolution.ts billingPlanIdFromMetadata):
    • cmuxVmPlan wins over cmuxPlan;
    • a lower paid grant never hides a paid Max;
    • an explicit restriction such as "free", or a blank or malformed cmuxVmPlan, stands. It is an operator restriction, so it also applies over a paid plan;
    • a restriction, or an unknown plan id, also blocks the development/staging allowlist stub plan;
    • for machine limits the raw cmuxPlan is normalized as classic does (" Max " is Max). The model router's exact-match paid gate is unchanged.
  • Company accounts: classic grants these through services/billing/companyPlan.ts hasCompanyPlanGrant (web: company email accounts are Team with no Cloud machine cap #21276), used in services/vms/entitlements.ts resolveVmEntitlements. A verified email on cmux.com, manaflow.ai or manaflow.com gets Team, or Max when the person's own plan is Max, with no machine cap. In NEXT this applies to the account's personal team. Whether an account counts as a company account comes from UserDO's record of its verified email, checked with classic's isAdminEmail rules (plain local part, an exact domain, no subdomains or lookalikes), never from a client claim.

How it works:

  • TeamDO.cloudVmPlan (new cloud-vm-plan.ts) reads cmuxVmPlan from the same sign-in record as cmuxPlan: the owner's user record for a personal team, the Stack team's record for a shared one. It caches the value for 10 minutes, keeps the last copy if the sign-in service fails, and never lets an older answer overwrite a newer one.
  • CloudEntitlementStore combines the two grants with the paid plan.
  • cloud-plan.ts adds cloudPlanId, companyPlanKey and the company limits: Team or Max limits with max_active out of reach, which matches classic's maxActiveVms: null.

Why

Leo, 2026-10-28: "whatever's convenient for cloud, like that can be productionized, operationalized, we ought to just put out there"
Leo, 2026-10-28: "'pay money to us'"

Before paid Cloud entitlements go on in production, staff and operator-granted accounts would get cloud.plan.required in NEXT, even though classic gives them machines.

What it does not change: nobody pays differently

These grants only set Cloud machine limits. TeamDO.inferencePlan, which the model router's paid gate, included credits and usage billing read, still reads cmuxPlan only. A test checks that a cmuxVmPlan-granted account stays unpaid there. No Stripe, checkout or metering code changes.

Risk

Low to medium. The change only acts where CLOUD_PLAN_ENTITLEMENTS is on (development and staging; production is off and held in #26757).

  • Each team now also costs one sign-in service read per 10 minutes, and only when a Cloud op or cloud.plan.get refreshes its plan.
  • If the service is down and TeamDO has no copy yet, the plan is unavailable and CloudDO keeps its last known plan, the same rule as for cmuxPlan.
  • Difference from classic: classic gives the company grant to the caller in any team. NEXT gives it only on the account's personal team, because NEXT holds limits per team, not per caller.

Tested

On a Linux CI box (cmux-ci test):

  • backend typecheck and lint:size passed;
  • vitest passed 124/124 across cloud-plan-overrides.test.ts (new), cloud-plan-entitlements.test.ts, cloud-plan-production.test.ts, team-stack-webhook-review2.test.ts, cloud-routes.test.ts, cloud-do.test.ts and the test/inference suites.

The new tests cover:

  • a table of cmuxPlan/cmuxVmPlan cases with classic's exact precedence, including blank overrides and padded values;
  • the company email check against classic's isAdminEmail cases;
  • the company domain list matching web's ADMIN_EMAIL_DOMAINS (a parity test);
  • a grant read through the sign-in service, and how the reader parses each cmuxVmPlan value (absent, blank, non-string, too long);
  • a blank grant from the service restricting a paid Pro;
  • a padded cmuxPlan counting for machines while the router's gate stays unpaid;
  • a restriction over a paid Pro, and Max over a lower grant;
  • a stale copy answering during an outage, and an older answer never overwriting a newer one, in TeamDO's grant copy and in CloudDO's plan copy;
  • a restriction beating the stub plan on an allowlisted team;
  • a shared team's grant;
  • a verified company account creating 6 machines;
  • a company account that pays for Max getting Max sizes;
  • an unverified company address getting no grant;
  • cmuxVmPlan values "company", "company_max", "user_gone" and "enterprise" on a record restricting and granting nothing.

Agent session: agent session

🤖 Generated with Claude Code

… as classic Cloud does

NEXT Cloud read only cmuxPlan, so operator grants (cmuxVmPlan) and verified
company-domain accounts (classic #21276) got no machines. CloudDO now reads
cmuxVmPlan through TeamDO (cached, last copy kept on failure) and applies
classic's precedence; a verified company account's personal team is Team (Max
for a Max owner) with no machine cap. Machine limits only: the model router's
paid gate and billing keep reading cmuxPlan.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Agent-Session: https://cmux.com/deeplink/agent?id=aid-4ba8980ae4e8eecb82d6
@github-actions

github-actions Bot commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

cmux status (one comment, edited in place; each line is updated by the job that owns it)

Review f67e4bf: HQ feed card · gallery before/after runs · checks

App of this head (app.zip, kept 1 day)

gh workflow run reload-build.yml -R manaflow-ai/cmux --ref feat-cmux-next -f tag=pr26817 -f ref=p0m-cloud-plan-overrides -f platform=macos -f backend_mode=local

@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

Owned by an agent session · session

@github-actions github-actions Bot added the risk:normal Risk tier (docs/ci/risk-tiers.md) label Oct 28, 2026
@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

Bead cx-aj48xi created for this PR by the cmux coordinator.

@blacksmith-sh

This comment has been minimized.

…cts, Max exception on exact values) and classic's company email check

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Agent-Session: https://cmux.com/deeplink/agent?id=aid-4ba8980ae4e8eecb82d6
…Cloud reads the raw cmuxPlan as classic does (router gate unchanged)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Agent-Session: https://cmux.com/deeplink/agent?id=aid-4ba8980ae4e8eecb82d6
@cursor

cursor Bot commented Oct 28, 2026

Copy link
Copy Markdown

Bugbot needs on-demand usage enabled

Bugbot uses usage-based billing for this team and requires on-demand usage to be enabled.

A team admin can enable on-demand usage in the Cursor dashboard.

…er grant read never overwrites a newer one

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Agent-Session: https://cmux.com/deeplink/agent?id=aid-4ba8980ae4e8eecb82d6
…ata; a missing user is a tagged result, not a plan string

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Agent-Session: https://cmux.com/deeplink/agent?id=aid-4ba8980ae4e8eecb82d6
…plan after cmuxVmPlan, as in classic

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Agent-Session: https://cmux.com/deeplink/agent?id=aid-4ba8980ae4e8eecb82d6
…udDO's plan copy

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Agent-Session: https://cmux.com/deeplink/agent?id=aid-4ba8980ae4e8eecb82d6
@blacksmith-sh

blacksmith-sh Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

Found 5 test failures on Blacksmith runners:

Failures

Test View Logs
build_only must be a conjunctive exclusion on the helper, signing, and publication jobs
, and must not gate the unsigned app build/
build_only must be a conjunctive exclusion on the helper, signing, and publication jobs
, and must not gate the unsigned app build
View Logs
nightly.yml must derive the embedded key and sign every appcast through the helper/
nightly.yml must derive the embedded key and sign every appcast through the helper
View Logs
test_prepare_runs_on_linux_and_executes_no_mach_o (main.NightlyPooledRoutingTests.t
est_prepare_runs_on_linux_and_executes_no_mach_o)/
test_prepare_runs_on_linux_and_executes_no_mach_o (main.NightlyPooledRoutingTests.t
est_prepare_runs_on_linux_and_executes_no_mach_o)
View Logs
test_the_next_feed_keeps_its_newest_nightly_item_before_it_goes_live (main.Workflow
Tests.test_the_next_feed_keeps_its_newest_nightly_item_before_it_goes_live)/
test_the_next_feed_keeps_its_newest_nightly_item_before_it_goes_live (main.Workflow
Tests.test_the_next_feed_keeps_its_newest_nightly_item_before_it_goes_live)
View Logs
test_the_nightly_is_covered (main.NightlyStepCoverageTests.test_the_nightly_is_cove
red)/
test_the_nightly_is_covered (main.NightlyStepCoverageTests.test_the_nightly_is_cove
red)
View Logs

Fix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.

@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

Review (codex gpt-6-astra): SHIP at 764b45c

Independent review at high with fast mode, run on the full changed files and classic's matching code over seven rounds. Rounds 1 to 6 returned FIX; every finding was fixed with a test, except one answered with classic's own code (company Max follows the plan after cmuxVmPlan, web/services/vms/auth.ts:958). Round 7 returned SHIP with no findings at f67e4bf. This head is that commit plus a base merge.

@teamleaderleo
teamleaderleo merged commit 1e50841 into feat-cmux-next Oct 28, 2026
90 of 92 checks passed
@teamleaderleo
teamleaderleo deleted the p0m-cloud-plan-overrides branch October 28, 2026 11:39
@github-actions

Copy link
Copy Markdown
Contributor

The feat-cmux-next push run https://github.com/manaflow-ai/cmux/actions/runs/40682236069 at 8114288 failed: cmux-next generated files.
Those jobs last passed at ed7d5da. This pull request is one of 3 merged since: #26823, #26850, #26817.
If the failure is in your change, fix forward on feat-cmux-next. Pull requests run only the tiers their paths reach (docs/ci/cmux-next-tiers.md); label a batch PR full-ci to run them all before merging.

@github-actions

Copy link
Copy Markdown
Contributor

The feat-cmux-next push run https://github.com/manaflow-ai/cmux/actions/runs/40681979402 at d6c40eb failed: cmux-next checks (god files, concurrency, crash safety, l10n), cmux-next generated files.
Those jobs last passed at ed7d5da. This pull request is one of 3 merged since: #26823, #26850, #26817.
If the failure is in your change, fix forward on feat-cmux-next. Pull requests run only the tiers their paths reach (docs/ci/cmux-next-tiers.md); label a batch PR full-ci to run them all before merging.

@github-actions

Copy link
Copy Markdown
Contributor

The feat-cmux-next push run https://github.com/manaflow-ai/cmux/actions/runs/40683834325 at 2645001 failed: cmux-next checks (god files, concurrency, crash safety, l10n), cmux-next generated files.
Those jobs last passed at 52314b8. This pull request is one of 3 merged since: #26823, #26850, #26817.
If the failure is in your change, fix forward on feat-cmux-next. Pull requests run only the tiers their paths reach (docs/ci/cmux-next-tiers.md); label a batch PR full-ci to run them all before merging.

@github-actions

Copy link
Copy Markdown
Contributor

The feat-cmux-next push run https://github.com/manaflow-ai/cmux/actions/runs/40683016589 at 9fbc12e failed: cmux-next checks (god files, concurrency, crash safety, l10n), cmux-next generated files.
Those jobs last passed at 52314b8. This pull request is one of 3 merged since: #26823, #26850, #26817.
If the failure is in your change, fix forward on feat-cmux-next. Pull requests run only the tiers their paths reach (docs/ci/cmux-next-tiers.md); label a batch PR full-ci to run them all before merging.

@github-actions

Copy link
Copy Markdown
Contributor

The feat-cmux-next push run https://github.com/manaflow-ai/cmux/actions/runs/40686413651 at a0c8bdb failed: cmux-next checks (god files, concurrency, crash safety, l10n), cmux-next generated files.
Those jobs last passed at 7f18564. This pull request is one of 2 merged since: #26850, #26817.
If the failure is in your change, fix forward on feat-cmux-next. Pull requests run only the tiers their paths reach (docs/ci/cmux-next-tiers.md); label a batch PR full-ci to run them all before merging.

@github-actions

Copy link
Copy Markdown
Contributor

The feat-cmux-next push run https://github.com/manaflow-ai/cmux/actions/runs/40684373512 at 42bbb37 failed: cmux-next checks (god files, concurrency, crash safety, l10n), cmux-next generated files.
Those jobs last passed at 7f18564. This pull request is one of 2 merged since: #26850, #26817.
If the failure is in your change, fix forward on feat-cmux-next. Pull requests run only the tiers their paths reach (docs/ci/cmux-next-tiers.md); label a batch PR full-ci to run them all before merging.

@github-actions

Copy link
Copy Markdown
Contributor

The feat-cmux-next push run https://github.com/manaflow-ai/cmux/actions/runs/40684174353 at 442849d failed: cmux-next checks (god files, concurrency, crash safety, l10n), cmux-next generated files.
Those jobs last passed at 7f18564. This pull request is one of 2 merged since: #26850, #26817.
If the failure is in your change, fix forward on feat-cmux-next. Pull requests run only the tiers their paths reach (docs/ci/cmux-next-tiers.md); label a batch PR full-ci to run them all before merging.

@github-actions

Copy link
Copy Markdown
Contributor

The feat-cmux-next push run https://github.com/manaflow-ai/cmux/actions/runs/40684605734 at 1048c0f failed: cmux-next generated files.
Those jobs last passed at 7f18564. This pull request is one of 2 merged since: #26850, #26817.
If the failure is in your change, fix forward on feat-cmux-next. Pull requests run only the tiers their paths reach (docs/ci/cmux-next-tiers.md); label a batch PR full-ci to run them all before merging.

@github-actions

Copy link
Copy Markdown
Contributor

The feat-cmux-next push run https://github.com/manaflow-ai/cmux/actions/runs/40684922462 at 28d9a7d failed: cmux-next checks (god files, concurrency, crash safety, l10n), cmux-next generated files.
Those jobs last passed at 7f18564. This pull request is one of 2 merged since: #26850, #26817.
If the failure is in your change, fix forward on feat-cmux-next. Pull requests run only the tiers their paths reach (docs/ci/cmux-next-tiers.md); label a batch PR full-ci to run them all before merging.

@github-actions

Copy link
Copy Markdown
Contributor

The feat-cmux-next push run https://github.com/manaflow-ai/cmux/actions/runs/40686199378 at c02ae48 failed: cmux-next Release compile (fleet fast check), cmux-next generated files.
Those jobs last passed at 7f18564. This pull request is one of 2 merged since: #26850, #26817.
If the failure is in your change, fix forward on feat-cmux-next. Pull requests run only the tiers their paths reach (docs/ci/cmux-next-tiers.md); label a batch PR full-ci to run them all before merging.

@github-actions

Copy link
Copy Markdown
Contributor

The feat-cmux-next push run https://github.com/manaflow-ai/cmux/actions/runs/40688911044 at 52bbe91 failed: cmux-next checks (god files, concurrency, crash safety, l10n), cmux-next generated files.
Those jobs last passed at 7f18564. This pull request is one of 3 merged since: #26850, #26817, #26840.
If the failure is in your change, fix forward on feat-cmux-next. Pull requests run only the tiers their paths reach (docs/ci/cmux-next-tiers.md); label a batch PR full-ci to run them all before merging.

@github-actions

Copy link
Copy Markdown
Contributor

The feat-cmux-next push run https://github.com/manaflow-ai/cmux/actions/runs/40690021866 at 1e8fb3c failed: cmux-next checks (god files, concurrency, crash safety, l10n), cmux-next generated files.
Those jobs last passed at 7f18564. This pull request is one of 4 merged since: #26850, #26817, #26840, #26852.
If the failure is in your change, fix forward on feat-cmux-next. Pull requests run only the tiers their paths reach (docs/ci/cmux-next-tiers.md); label a batch PR full-ci to run them all before merging.

@github-actions

github-actions Bot commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

This branch was previously deployed

1 inactive deployment
ci-routing-agent — 764b45c4 Deployed Oct 28, 2026 by teamleaderleo via wait for same-key tree publisher #71609
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk:normal Risk tier (docs/ci/risk-tiers.md)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant