Repository navigation
[backport cloud/1.52] feat(billing): render sales-managed tiers through server capabilities - #16094
Conversation
|
Important Review skippedIgnore keyword(s) in the title. ⛔ Ignored keywords (2)
Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Comment |
🎨 Storybook: ✅ Built — View Storybook🎭 Playwright: ✅ 1985 passed, 0 failed · 2 flaky📊 Browser Reports
📦 Bundle Size
⚡ Performance Report
Absolute values
Raw data{
"timestamp": "2026-08-27T16:04:06.811Z",
"gitSha": "4498b86a232aa2a5ec1daff8fd3fc019525ed3c1",
"branch": "backport-16067-to-cloud-1.52",
"measurements": [
{
"name": "canvas-idle",
"durationMs": 2076.0909999999626,
"styleRecalcs": 9,
"styleRecalcDurationMs": 6.695000000000001,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 563.7339999999999,
"heapDeltaBytes": 15606752,
"heapUsedBytes": 77908184,
"domNodes": -281,
"jsHeapTotalBytes": 4710400,
"scriptDurationMs": 8.817,
"eventListeners": -151,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "canvas-idle",
"durationMs": 2037.6080000000911,
"styleRecalcs": 9,
"styleRecalcDurationMs": 6.900000000000001,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 527.956,
"heapDeltaBytes": 18872548,
"heapUsedBytes": 81399124,
"domNodes": -280,
"jsHeapTotalBytes": 4186112,
"scriptDurationMs": 10.651,
"eventListeners": -151,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.699999999999818
},
{
"name": "canvas-mouse-sweep",
"durationMs": 1906.3889999999901,
"styleRecalcs": 77,
"styleRecalcDurationMs": 35.594,
"layouts": 12,
"layoutDurationMs": 3.9159999999999995,
"taskDurationMs": 868.444,
"heapDeltaBytes": -5483744,
"heapUsedBytes": 57189476,
"domNodes": -281,
"jsHeapTotalBytes": 5234688,
"scriptDurationMs": 100.444,
"eventListeners": -151,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "canvas-mouse-sweep",
"durationMs": 1770.7169999999905,
"styleRecalcs": 70,
"styleRecalcDurationMs": 31.47,
"layouts": 12,
"layoutDurationMs": 3.456,
"taskDurationMs": 845.194,
"heapDeltaBytes": 17583740,
"heapUsedBytes": 80603552,
"domNodes": -282,
"jsHeapTotalBytes": 4710400,
"scriptDurationMs": 100.897,
"eventListeners": -151,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "canvas-zoom-sweep",
"durationMs": 1713.0430000000274,
"styleRecalcs": 31,
"styleRecalcDurationMs": 15.585999999999999,
"layouts": 6,
"layoutDurationMs": 0.624,
"taskDurationMs": 367.139,
"heapDeltaBytes": 3347156,
"heapUsedBytes": 65885688,
"domNodes": 77,
"jsHeapTotalBytes": 4718592,
"scriptDurationMs": 11.349000000000002,
"eventListeners": 19,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "canvas-zoom-sweep",
"durationMs": 1724.3500000000722,
"styleRecalcs": 30,
"styleRecalcDurationMs": 16.554,
"layouts": 6,
"layoutDurationMs": 0.68,
"taskDurationMs": 385.49099999999993,
"heapDeltaBytes": 2923804,
"heapUsedBytes": 66037588,
"domNodes": 76,
"jsHeapTotalBytes": 4456448,
"scriptDurationMs": 12.409000000000002,
"eventListeners": 19,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "dom-widget-clipping",
"durationMs": 634.6189999999865,
"styleRecalcs": 10,
"styleRecalcDurationMs": 7.226,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 381.256,
"heapDeltaBytes": 10380772,
"heapUsedBytes": 72870704,
"domNodes": 16,
"jsHeapTotalBytes": 4456448,
"scriptDurationMs": 55.347,
"eventListeners": 2,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "dom-widget-clipping",
"durationMs": 640.5799999999999,
"styleRecalcs": 13,
"styleRecalcDurationMs": 9.574,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 389.1620000000001,
"heapDeltaBytes": 11009076,
"heapUsedBytes": 73555140,
"domNodes": 22,
"jsHeapTotalBytes": 4980736,
"scriptDurationMs": 53.587999999999994,
"eventListeners": 2,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "large-graph-idle",
"durationMs": 2052.2020000000225,
"styleRecalcs": 10,
"styleRecalcDurationMs": 8.262000000000002,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 626.322,
"heapDeltaBytes": -4864796,
"heapUsedBytes": 72506892,
"domNodes": -276,
"jsHeapTotalBytes": -1056768,
"scriptDurationMs": 15.450999999999999,
"eventListeners": -147,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "large-graph-idle",
"durationMs": 2056.197999999995,
"styleRecalcs": 9,
"styleRecalcDurationMs": 8.686,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 656.416,
"heapDeltaBytes": -4735792,
"heapUsedBytes": 72702168,
"domNodes": -275,
"jsHeapTotalBytes": -8192,
"scriptDurationMs": 16.106999999999996,
"eventListeners": -151,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "large-graph-pan",
"durationMs": 2149.4930000000068,
"styleRecalcs": 69,
"styleRecalcDurationMs": 15.473999999999998,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 1189.711,
"heapDeltaBytes": 12340136,
"heapUsedBytes": 89557264,
"domNodes": -284,
"jsHeapTotalBytes": 4935680,
"scriptDurationMs": 311.681,
"eventListeners": -177,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "large-graph-pan",
"durationMs": 2148.853000000031,
"styleRecalcs": 69,
"styleRecalcDurationMs": 17.374000000000002,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 1233.9850000000001,
"heapDeltaBytes": -8894212,
"heapUsedBytes": 69340124,
"domNodes": -280,
"jsHeapTotalBytes": -45056,
"scriptDurationMs": 339.874,
"eventListeners": -147,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "large-graph-zoom",
"durationMs": 3167.814000000021,
"styleRecalcs": 64,
"styleRecalcDurationMs": 15.167999999999997,
"layouts": 60,
"layoutDurationMs": 8.703,
"taskDurationMs": 1322.4509999999998,
"heapDeltaBytes": -8665976,
"heapUsedBytes": 71030960,
"domNodes": 10,
"jsHeapTotalBytes": 6066176,
"scriptDurationMs": 375.57800000000003,
"eventListeners": 8,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "large-graph-zoom",
"durationMs": 3164.319999999975,
"styleRecalcs": 65,
"styleRecalcDurationMs": 17.185,
"layouts": 60,
"layoutDurationMs": 9.538,
"taskDurationMs": 1342.1879999999999,
"heapDeltaBytes": -9770576,
"heapUsedBytes": 69776288,
"domNodes": 12,
"jsHeapTotalBytes": 5804032,
"scriptDurationMs": 353.892,
"eventListeners": 8,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.699999999999818
},
{
"name": "legacy-node-drag",
"durationMs": 2160.1040000000467,
"styleRecalcs": 47,
"styleRecalcDurationMs": 9.568,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 1344.445,
"heapDeltaBytes": -13908604,
"heapUsedBytes": 71495280,
"domNodes": 14,
"jsHeapTotalBytes": 8163328,
"scriptDurationMs": 423.562,
"eventListeners": 186,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.670000000000012,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "legacy-node-drag",
"durationMs": 2303.5260000000335,
"styleRecalcs": 46,
"styleRecalcDurationMs": 11.067999999999998,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 1454.1709999999998,
"heapDeltaBytes": 10431424,
"heapUsedBytes": 90576108,
"domNodes": 12,
"jsHeapTotalBytes": 7008256,
"scriptDurationMs": 443.21900000000005,
"eventListeners": 186,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "minimap-idle",
"durationMs": 2059.572000000003,
"styleRecalcs": 7,
"styleRecalcDurationMs": 6.258999999999997,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 629.347,
"heapDeltaBytes": -12608808,
"heapUsedBytes": 65772736,
"domNodes": -283,
"jsHeapTotalBytes": 3923968,
"scriptDurationMs": 17.668000000000003,
"eventListeners": -179,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "minimap-idle",
"durationMs": 2010.6220000000121,
"styleRecalcs": 8,
"styleRecalcDurationMs": 7.188000000000003,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 634.589,
"heapDeltaBytes": -12935992,
"heapUsedBytes": 65566680,
"domNodes": -283,
"jsHeapTotalBytes": 3923968,
"scriptDurationMs": 17.577,
"eventListeners": -179,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "subgraph-dom-widget-clipping",
"durationMs": 591.575999999975,
"styleRecalcs": 46,
"styleRecalcDurationMs": 9.763,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 392.4920000000001,
"heapDeltaBytes": 11567116,
"heapUsedBytes": 74402160,
"domNodes": 18,
"jsHeapTotalBytes": 5242880,
"scriptDurationMs": 115.97800000000001,
"eventListeners": 8,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "subgraph-dom-widget-clipping",
"durationMs": 632.8399999999874,
"styleRecalcs": 43,
"styleRecalcDurationMs": 8.543000000000003,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 389.93100000000004,
"heapDeltaBytes": 12001228,
"heapUsedBytes": 74294540,
"domNodes": 12,
"jsHeapTotalBytes": 6029312,
"scriptDurationMs": 115.24599999999998,
"eventListeners": 6,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "subgraph-idle",
"durationMs": 2009.9079999999958,
"styleRecalcs": 9,
"styleRecalcDurationMs": 7.104999999999999,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 494.19599999999997,
"heapDeltaBytes": 17663528,
"heapUsedBytes": 79853296,
"domNodes": -281,
"jsHeapTotalBytes": 4972544,
"scriptDurationMs": 7.927,
"eventListeners": -153,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "subgraph-idle",
"durationMs": 2016.1430000000564,
"styleRecalcs": 10,
"styleRecalcDurationMs": 8.578,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 527.65,
"heapDeltaBytes": -6862160,
"heapUsedBytes": 55770492,
"domNodes": -282,
"jsHeapTotalBytes": 4448256,
"scriptDurationMs": 9.311,
"eventListeners": -151,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "subgraph-mouse-sweep",
"durationMs": 1783.5000000000036,
"styleRecalcs": 75,
"styleRecalcDurationMs": 37.943000000000005,
"layouts": 16,
"layoutDurationMs": 4.3340000000000005,
"taskDurationMs": 823.519,
"heapDeltaBytes": 13512764,
"heapUsedBytes": 75886028,
"domNodes": -282,
"jsHeapTotalBytes": 5496832,
"scriptDurationMs": 74.297,
"eventListeners": -153,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "subgraph-mouse-sweep",
"durationMs": 1786.9029999999384,
"styleRecalcs": 74,
"styleRecalcDurationMs": 40.176,
"layouts": 16,
"layoutDurationMs": 5.166,
"taskDurationMs": 870.3960000000001,
"heapDeltaBytes": 19393692,
"heapUsedBytes": 81821944,
"domNodes": -283,
"jsHeapTotalBytes": 5496832,
"scriptDurationMs": 86.62899999999999,
"eventListeners": -151,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "subgraph-transition-enter",
"durationMs": 1366.1550000000489,
"styleRecalcs": 20,
"styleRecalcDurationMs": 30.116000000000003,
"layouts": 15,
"layoutDurationMs": 12.25,
"taskDurationMs": 869.9649999999999,
"heapDeltaBytes": -6205996,
"heapUsedBytes": 87773020,
"domNodes": 13673,
"jsHeapTotalBytes": 13107200,
"scriptDurationMs": 17.877000000000002,
"eventListeners": 2375,
"totalBlockingTimeMs": 133,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "viewport-pan-sweep",
"durationMs": 8178.824999999961,
"styleRecalcs": 250,
"styleRecalcDurationMs": 44.268,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 4102.5689999999995,
"heapDeltaBytes": 1730820,
"heapUsedBytes": 78153844,
"domNodes": -278,
"jsHeapTotalBytes": -45056,
"scriptDurationMs": 1006.61,
"eventListeners": -161,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "viewport-pan-sweep",
"durationMs": 8179.883000000018,
"styleRecalcs": 250,
"styleRecalcDurationMs": 46.018,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 4257.688,
"heapDeltaBytes": 2807032,
"heapUsedBytes": 80210636,
"domNodes": -276,
"jsHeapTotalBytes": -307200,
"scriptDurationMs": 1035.318,
"eventListeners": -133,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.80000000000109
},
{
"name": "vue-large-graph-idle",
"durationMs": 14952.698999999995,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 14357.930999999999,
"heapDeltaBytes": -36251392,
"heapUsedBytes": 176076716,
"domNodes": -8312,
"jsHeapTotalBytes": -21319680,
"scriptDurationMs": 139.22199999999995,
"eventListeners": -16393,
"totalBlockingTimeMs": 0,
"frameDurationMs": 17.77333333333336,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "vue-large-graph-idle",
"durationMs": 15361.331999999948,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 14727.905,
"heapDeltaBytes": -66982804,
"heapUsedBytes": 163324076,
"domNodes": -8312,
"jsHeapTotalBytes": -18423808,
"scriptDurationMs": 116.77799999999999,
"eventListeners": -16392,
"totalBlockingTimeMs": 0,
"frameDurationMs": 17.776666666666642,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "vue-large-graph-pan",
"durationMs": 18372.336000000018,
"styleRecalcs": 152,
"styleRecalcDurationMs": 21.943999999999992,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 17879.256999999998,
"heapDeltaBytes": -37504632,
"heapUsedBytes": 193861708,
"domNodes": -8312,
"jsHeapTotalBytes": -22011904,
"scriptDurationMs": 456.843,
"eventListeners": -16389,
"totalBlockingTimeMs": 0,
"frameDurationMs": 17.780000000000047,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "vue-large-graph-pan",
"durationMs": 18457.525999999918,
"styleRecalcs": 162,
"styleRecalcDurationMs": 22.818000000000005,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 17977.597,
"heapDeltaBytes": -52111448,
"heapUsedBytes": 173538168,
"domNodes": -8312,
"jsHeapTotalBytes": -16556032,
"scriptDurationMs": 412.314,
"eventListeners": -16389,
"totalBlockingTimeMs": 0,
"frameDurationMs": 17.219999999999953,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "workflow-execution",
"durationMs": 478.93599999997605,
"styleRecalcs": 17,
"styleRecalcDurationMs": 20.674,
"layouts": 3,
"layoutDurationMs": 1.4659999999999997,
"taskDurationMs": 122.12800000000001,
"heapDeltaBytes": 5131852,
"heapUsedBytes": 67887604,
"domNodes": 148,
"jsHeapTotalBytes": 262144,
"scriptDurationMs": 7.153,
"eventListeners": 99,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "workflow-execution",
"durationMs": 131.78999999990992,
"styleRecalcs": 8,
"styleRecalcDurationMs": 16.874999999999996,
"layouts": 2,
"layoutDurationMs": 1.467,
"taskDurationMs": 96.273,
"heapDeltaBytes": 3050224,
"heapUsedBytes": 65032024,
"domNodes": 127,
"jsHeapTotalBytes": 262144,
"scriptDurationMs": 7.184999999999999,
"eventListeners": 25,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
}
]
} |
Codecov Report❌ Patch coverage is
@@ Coverage Diff @@
## cloud/1.52 #16094 +/- ##
=============================================
Coverage ? 82.01%
=============================================
Files ? 1910
Lines ? 109976
Branches ? 31210
=============================================
Hits ? 90195
Misses ? 19442
Partials ? 339
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
a42a540 to
faaf429
Compare
e00c963 to
0d091c1
Compare
faaf429 to
2249062
Compare
… workspace (#16041) ## Summary Adds the E2E regression test for #16032 (Run silently doing nothing on Local at 0 credits), driven through the real Run button. ## Why this was missed by E2E `workspaceSwitcherFixture` already models the exact failing state (`is_active: false`, balance 0, Local), but the existing queue test calls `window.app.queuePrompt(0)` directly — bypassing the `Comfy.QueuePrompt` command where the subscribe-to-run gate lives. The QA-reported bug (thread: 1.51 local workspace switcher QA) lived precisely in that skipped layer. ## Changes - **What**: New test in `localWorkspaceSwitcher.spec.ts` that loads the default workflow on an unsubscribed/zero-balance Local workspace, clicks the actual Run button, and asserts `POST /api/prompt` is issued. ## Verification - Passes against current main (real ComfyUI backend + dev server). - Fails against the pre-#16032 gate (`if (!canAccessSubscriptionFeatures.value)` reverted locally): Run click produces no prompt request, test times out — reproducing the QA report. - Full `localWorkspaceSwitcher.spec.ts` (3 tests) green. ## Review Focus - Coverage audit of this QA round: every other reported case already has unit + E2E coverage (race condition → `localWorkspaceSwitcher.spec.ts`; API-key billing → `apiKeyLoginBilling.spec.ts`; Add credits on Local → `localCreditsWorkspaceRail.spec.ts`; billing routes → `localCreditsNoSubscribeUi.spec.ts` / `cloud.spec.ts`; Cloud subscribe-to-run → `subscription.spec.ts` + unit gate tests in `useCoreCommands.test.ts`). This was the last gap. (cherry picked from commit 2ab204c)
## Summary On Local, clicking Run silently did nothing when the active workspace has no active subscription (e.g. 0 credits) — for any workflow, with or without API nodes, on any login method. Scope the subscribe-to-run gate in the queue commands to Cloud so Local always queues. Found during 1.51 QA of the local workspace switcher ([Slack report](https://comfy-organization.slack.com/archives/C0932CGKT5K/p1787740255008649?thread_ts=1787034725.224329&cid=C0932CGKT5K)). ## Root cause The break is an interaction of three pieces: 1. `Comfy.QueuePrompt` / `Comfy.QueuePromptFront` / `Comfy.QueueSelectedOutputNodes` return early when `canAccessSubscriptionFeatures` is false (`useCoreCommands.ts`), with no distribution check. 2. Since the local workspace switcher (#15558), Local routes billing to the workspace rail once workspace context loads (`useBillingRouting`). `useWorkspaceBilling.canAccessSubscriptionFeatures` is `statusData?.is_active ?? false` — unlike the legacy rail (`useSubscription.ts`), it has no `!isCloud → true` exemption, so an unsubscribed/zero-credit workspace reports false on Local. 3. The gate's fallback `showSubscriptionDialog` → `showPricingTable` starts with `if (!isCloud) return` (`useSubscriptionDialog.ts`), so on Local the block is invisible: no dialog, no toast, nothing. ```mermaid flowchart LR A[Run click] --> B[Comfy.QueuePrompt] B --> C{canAccessSubscriptionFeatures?} C -- "Local + workspace rail, is_active=false" --> D[showSubscriptionDialog] D --> E["showPricingTable: if (!isCloud) return"] E --> F[silent no-op — Run does nothing] C -- true --> G[app.queuePrompt] ``` ## How we change it Gate the three queue commands with `isCloud && !canAccessSubscriptionFeatures` — subscription gating is a Cloud concept, and this mirrors the legacy rail's own `!isCloud` exemption. The gate flag itself is left untouched: flipping `useWorkspaceBilling.canAccessSubscriptionFeatures` to true on Local would regress the Plan & Credits UI, which intentionally renders the unsubscribed state on Local (#15828). Insufficient-credit handling for partner nodes is unaffected: the backend still rejects the prompt and the error-catalog path (`insufficient_credits` → top-up dialog) handles it, so Local behavior returns to server-driven. ## AS IS / TO BE - **AS IS**: Local + workspace with 0 credits → Run click is a silent no-op for every workflow (QA video in the Slack thread above). - **TO BE**: Local always queues. OSS workflows run; partner-node workflows surface the backend insufficient-credits error with top-up CTA. Cloud gating is unchanged (dialog still shown when unsubscribed). ## Tests - Unit (`useCoreCommands.test.ts`): Local + `canAccessSubscriptionFeatures=false` queues and shows no dialog (fails against the previous code); Cloud unsubscribed still blocks with the `subscribe_to_run` dialog; Cloud subscribed queues. ## Review Focus - The guard intentionally keys on distribution (`isCloud`), not on billing-rail internals, so bootstrap-time rail flapping on Local can never block Run.⚠️ Needs backport to `core/1.51` — this is a 1.51 release blocker. (cherry picked from commit 4a67eb4)
…#16067) ## Why this is needed Enterprise workspaces exist in production (`enterprise_monthly` / `enterprise_annual`, provisioned through the comfy-admin console) but the frontend still renders them as a self-serve catalog plan. FE-1662 verified three gaps against the tree, and re-verification after the capabilities migration (#15803/#15804/#15675) and the ENTERPRISE contract landing (#15855) found the surviving surface smaller but real. Supersedes #15403 — same behavioral spec and design of record ([Figma 4404-13011](https://www.figma.com/design/CkFTD4c20PyRGpNVAJgpfV/Team-Plan---Workspaces?node-id=4404-13011), DES-782), rebuilt on the server-capabilities architecture that merged underneath it. Co-authored with @comfydesigner, whose branch this replaces. - Fixes FE-1662 ## Root cause Three distinct causes, one per change group: 1. **Label fallbacks assume the catalog is total.** `resolveSubscriptionTierKey` falls back to `'standard'` for any unmapped tier, so an ENTERPRISE workspace's plan card renders **"Standard"**, Standard's **$20 USD/mo** price (`useWorkspacePlanPricing` has the same fallback), Standard's feature list, and the credits bar borrows Standard's 4,200-credit monthly pool (`CreditsTile.tierKey ?? DEFAULT_TIER_KEY`). A scheduled change to an enterprise plan falls through the `team`-prefix check and labels itself "Standard". 2. **Pricing-table entry points gate on membership, not on whether a catalog exists.** The `?pricing=` deep link (`usePricingTableUrlLoader`), the profile menu's "Plans & pricing", and settings' "View more details about plans & pricing" all gate on `canManageSubscription` (owner), so an Enterprise owner can still open the self-serve pricing table. The subscribe-to-run upsell (`CloudRunButtonWrapper`, `useCoreCommands`) gates only on `canAccessSubscriptionFeatures`, so a lapsed Enterprise workspace is offered a self-serve checkout it must not use. 3. **No representation for a tier outside the catalog.** A tier the build doesn't recognize (server ahead of client) borrowed all of the above from Standard — price and feature claims for a plan the frontend cannot identify. Lifecycle actions (cancel / reactivate / plan change / member invites) are **not** part of this PR's policy surface: the server already resolves them (`hideLifecycleCapabilities` in billing-api keeps `can_top_up=true` and closes the rest), and main already consumes those capabilities. This PR covers rendering and the pricing-catalog entry points only. ## How **One derived policy for every pricing-table entry point.** `useWorkspaceUI.canOpenPricingSurface` reads the server-resolved `can_subscribe_self_serve` on the workspace rail and falls back to membership on `legacy_stripe` — the exact shape of `canReactivatePlan` (#15967), so the legacy-rail regression class that #15967/#16043/#16046 fixed cannot recur here. Consumers: profile-menu "Plans & pricing", settings "View more details", and the `?pricing=` deep link (which now awaits capability initialization before deciding, like the `?topup=` loader, so a pre-load deep link can't slip through). **Tier drives rendering only.** `isSalesManagedTier` (ENTERPRISE or unmapped) hides the catalog price row, benefits list, and borrowed credit pool; `planDisplayName` renders "Enterprise" / "Current plan"; the scheduled-change label resolves enterprise slugs (the only signal on that path — enterprise plans are absent from `plans`); `formatTierName` gains a `te()` guard so an unknown tier degrades to a capitalized string instead of a raw i18n key. The subscribe-to-run upsell and the run-command dialog stay hidden on sales-managed plans (`SubscribeToRun` requires a catalog to sell into); the run button remains a run button. **Capability-driven credits tile.** The inactive-plan zero-state now applies only when the server also withholds top-up (`inactivePlan && !canTopUp`): lapsed self-serve plans keep today's reactivate-to-use-credits treatment (`lapsedSelfServeCapabilities` withholds top-up), while a sales-managed plan — whose top-up stays open whatever the subscription row says — keeps its real balance and Add credits. **Delete workspace hides on Enterprise** (DES-782): deletion requires a cancellation only sales can perform, so the disabled menu item was a permanent dead end. ## Behavioral spec (from #15403, verified by tests) 1. Enterprise owner cannot self-serve any plan change — no upgrade, downgrade, cancel, or reactivate (server capabilities; regression-tested here). 2. The pricing table never appears for an Enterprise workspace — settings, profile menu, or `?pricing=` deep link (quiet no-op). 3. The plan reads "Enterprise" with its renewal date — never another tier's name, price, credits, or feature list. 4. Money-in stays open: top-up and Billing & invoices always reachable. 5. A cancelled or ended Enterprise subscription shows the standard state with no Reactivate/Subscribe action. 6. An unrecognized tier renders as "Current plan" with no borrowed catalog content and no self-serve actions; credits, top-up, and runs keep working, no crash. > Story 5's amended form (ended Enterprise → Subscribe returns, per the 2026-08-21 decision with Justin) is **deliberately out of scope**: billing-api resolves `can_subscribe_self_serve=false` for any enterprise subscription row including ended ones, so that behavior needs a backend change first (contract-first). Tracked as a follow-up. ## Tests - **Unit (321 passing across the 11 touched suites):** new coverage in `tierPricing` (helpers), `useWorkspaceUI` (`canOpenPricingSurface` rail split), `SubscriptionPanelContentWorkspace` (stories 1, 3, 4, 5, 6 + scheduled-change label), `CurrentUserPopoverWorkspace` (menu entry + resubscribe), `usePricingTableUrlLoader` (deep-link no-op + pre-load race), `CreditsTile` (sales-managed pool + inactive state), `CloudRunButtonWrapper` / `useCoreCommands` (upsell suppression), `useWorkspaceMenuItems` (cancel/delete/leave). - **E2E (`browser_tests/tests/dialogs/enterpriseTierCloud.spec.ts`, 7 tests, @cloud):** one per user story against the real cloud build with server-shaped capability mocks (`hideLifecycleCapabilities` shape), plus a Pro-team self-serve regression and an unrecognized-tier no-crash regression. `endedSubscription.spec.ts` additionally pins that a non-enterprise inactive team keeps its Reactivate button. All 10 pass locally against a ComfyUI server serving the cloud dist. - `CloudWorkspaceMockHelper` gained an optional capability-overrides parameter so specs can mock the server's sales-managed shape. ## AS IS / TO BE Screenshots from the real app (cloud dist served by ComfyUI) being attached in a follow-up edit to this description: Plan & Credits panel (Standard-mislabel → Enterprise card), profile menu (Plans & pricing removed), ended-enterprise run button (subscribe upsell removed). Co-authored-by: comfydesigner <247099495+comfydesigner@users.noreply.github.com> (cherry picked from commit bab0873)
0d091c1 to
fe39ab2
Compare
Backport of #16067 to
cloud/1.52.Merge order — this PR is stacked
Base is deliberately
backport-16046-to-cloud-1.52, notcloud/1.52. GitHub retargets this PR tocloud/1.52once its parent merges.cloud/1.52→ #15799 → #15803 → #15804 → #15675 → #15967 → #16043 → #16046 → #16067Every commit in this chain cherry-picks cleanly; there are no hand-resolved conflicts anywhere in the stack.
Verification
Run at the tip of the full stack: 93 unit test files, 1745 tests, 0 failures (
src/platform/workspace,src/platform/cloud/subscription,src/composables/useCoreCommands.test.ts,src/components/actionbar).Also carries #16032 and #16041
#16067's unit tests need mocks (
app.queuePrompt,trackWorkflowExecution,useQueueSettingsStore) that #16032 introduced, and its run-gate coverage comes from #16041. Both are already backported independently as #16084 and #16059. This branch therefore contains them; whichever lands first makes the other's patch a no-op. Without #16032 theuseCoreCommandshunks conflict and 8 tests fail.