Skip to content

[backport cloud/1.53] fix: normalize nested subgraph definition ids and cover node-shell input rehydration - #16809

Merged
comfy-pr-bot merged 1 commit into
cloud/1.53from
backport-16546-to-cloud-1.53
Sep 3, 2026
Merged

comfy-pr-bot merged 1 commit into
cloud/1.53from
backport-16546-to-cloud-1.53

Conversation

@comfy-pr-bot

Copy link
Copy Markdown
Member

Backport of #16546 to cloud/1.53

Automatically created by backport workflow.

…put rehydration (#16546)

Recursive subgraph-definition id normalization plus coverage for
node-shell input rehydration and the brush-cursor rect read. Rebased
onto current `main`; the node-replacement half was dropped because it
landed separately.

<details><summary>Full context for agent readers</summary>

Addresses part of #15973.

## Included

1. **Input-slot rehydration must not narrow to the `LGraphNode`
constructor path** — `createNodeShellState` (the sole `NodeState`
builder) returned a plain `shallowReactive` array for `inputs`; only
`LGraphNode`'s constructor wrapped it with `createInputSlotView`, so a
`NodeState` built any other way silently lost rehydration. The wrap now
lives in `createNodeShellState` itself, injected as a parameter
(`InputSlotViewFactory`) rather than statically imported: a static
import there re-enters the litegraph module cycle at a point where
`LGraphNode` is not yet defined (`TypeError: Class extends value
undefined` in `SubgraphNode.ts`). Regression test constructs `NodeState`
via `createNodeShellState` directly.

2. **Fixes #16010** — restores the deleted "read the container rect once
per position, not once per axis" coverage for `BrushCursor`, adapted to
the `useElementBounding()` implementation. Also characterizes a
remaining gap: `useElementBounding()`'s observers do not see an ancestor
moved via a transform on a non-target ancestor; only the next cursor
move re-syncs via this component's `watch(cursorPoint, update)`.
Coverage only; wiring an explicit recompute to dialog movement is
separate follow-up work.

3. **Fixes #16012** — `normalizeSubgraphDefinitionIds` only normalized
ids in the top-level `subgraphs` array and never descended into a
definition's own nested `definitions.subgraphs` (structurally valid per
`ExportedSubgraph extends SerialisableGraph`, never produced by our
serializer, so this matters for external tools and older exports).
Nested definitions are now recursively flattened into the returned list
(clearing the redundant nested field) before the existing
id-normalization and reference-rewrite pass. Tests cover one level,
multi-level, empty, and sibling nesting.

## Dropped during rebase (already on `main`)

- The per-node missing-node-warning tracking (#16011) was superseded by
[#16464](#16464),
which fixed the same defect per type. Keeping both would have shipped
two overlapping designs for one bug, so those commits were removed
rather than reconciled.
- The "documented identity break" test and JSDoc for `getInputSlotPos`
were removed:
[#16510](#16510) made
a retained plain-object reference resolvable, so the documented break no
longer exists. `main`'s test for the fixed behavior is kept as-is.
- #16009 was fixed by #16458; #16013 was fixed by #16512. Nothing
duplicated here.

## Testing

Focused `vitest` on the touched files and the `subgraph/` directory (399
tests), `vue-tsc --noEmit`, `oxlint` (type-aware) and `oxfmt --check` on
the touched files — all clean on the rebased head. The
recursive-normalization tests fail against the pre-fix code.

</details>

<!-- authored-by:agent w3-w20 -->
@comfy-pr-bot comfy-pr-bot added the backport Backporting a PR onto a release candidate label Sep 3, 2026
@comfy-pr-bot
comfy-pr-bot requested a review from a team as a code owner September 3, 2026 17:46
@comfy-pr-bot
comfy-pr-bot enabled auto-merge (squash) September 3, 2026 17:46
@github-actions

github-actions Bot commented Sep 3, 2026 •

Copy link
Copy Markdown
Contributor

🎭 Playwright: ✅ 1893 passed, 0 failed

📊 Browser Reports
  • chromium: View Report (✅ 1872 / ❌ 0 / ⚠️ 0 / ⏭️ 4)
  • chromium-2x: View Report (✅ 2 / ❌ 0 / ⚠️ 0 / ⏭️ 0)
  • chromium-0.5x: View Report (✅ 1 / ❌ 0 / ⚠️ 0 / ⏭️ 0)
  • mobile-chrome: View Report (✅ 18 / ❌ 0 / ⚠️ 0 / ⏭️ 0)

🎨 Storybook: ✅ Built — View Storybook

Details

⏰ Completed at: 09/03/2026, 05:48:40 PM UTC

Links

📦 Bundle Size

⏳ Size data collection in progress…

⚡ Performance Report

canvas-idle: · 60.0 avg FPS · 59.5 P5 FPS ✅ (target: ≥52) · 0ms TBT · 55.8 MB heap
canvas-mouse-sweep: · 60.0 avg FPS · 59.7 P5 FPS ✅ (target: ≥52) · 0ms TBT · 65.7 MB heap
canvas-zoom-sweep: · 60.0 avg FPS · 59.9 P5 FPS ✅ (target: ≥52) · 0ms TBT · 71.3 MB heap
dom-widget-clipping: · 60.0 avg FPS · 59.9 P5 FPS ✅ (target: ≥52) · 0ms TBT · 71.7 MB heap
large-graph-idle: · 60.0 avg FPS · 59.7 P5 FPS ✅ (target: ≥52) · 0ms TBT · 82.9 MB heap
large-graph-pan: · 60.0 avg FPS · 59.7 P5 FPS ✅ (target: ≥52) · 0ms TBT · 80.4 MB heap
large-graph-zoom: · 60.0 avg FPS · 59.5 P5 FPS ✅ (target: ≥52) · 0ms TBT · 74.0 MB heap
legacy-node-drag: · 60.0 avg FPS · 59.7 P5 FPS ✅ (target: ≥52) · 0ms TBT · 85.4 MB heap
minimap-idle: · 60.0 avg FPS · 59.9 P5 FPS ✅ (target: ≥52) · 0ms TBT · 83.3 MB heap
subgraph-dom-widget-clipping: · 60.0 avg FPS · 59.7 P5 FPS ✅ (target: ≥52) · 0ms TBT · 82.7 MB heap
subgraph-idle: · 60.0 avg FPS · 59.7 P5 FPS ✅ (target: ≥52) · 0ms TBT · 67.0 MB heap
subgraph-mouse-sweep: · 60.0 avg FPS · 59.5 P5 FPS ✅ (target: ≥52) · 0ms TBT · 57.7 MB heap
subgraph-transition-enter: · 60.0 avg FPS · 59.9 P5 FPS ✅ (target: ≥52) · 141ms TBT · 103.3 MB heap
viewport-pan-sweep: · 60.0 avg FPS · 59.5 P5 FPS ✅ (target: ≥52) · 0ms TBT · 84.4 MB heap
vue-large-graph-idle: · 56.3 avg FPS · 59.5 P5 FPS ✅ (target: ≥52) · 0ms TBT · 169.4 MB heap
vue-large-graph-pan: · 56.3 avg FPS · 59.7 P5 FPS ✅ (target: ≥52) · 66ms TBT · 176.5 MB heap
vue-node-resize-workload: · 56.3 avg FPS · 59.5 P5 FPS ✅ (target: ≥52) · 467ms TBT · 170.9 MB heap
workflow-execution: · 60.0 avg FPS · 59.7 P5 FPS ✅ (target: ≥52) · 0ms TBT · 70.2 MB heap

ℹ️ No baseline found — significance unavailable.

Absolute values
Metric Value
canvas-idle: avg frame time 17ms
canvas-idle: p95 frame time 17ms
canvas-idle: layout duration 0ms
canvas-idle: style recalc duration 8ms
canvas-idle: layout count 0
canvas-idle: style recalc count 9
canvas-idle: task duration 532ms
canvas-idle: script duration 9ms
canvas-idle: TBT 0ms
canvas-idle: heap used 55.8 MB
canvas-idle: DOM nodes -281
canvas-idle: event listeners -156
canvas-mouse-sweep: avg frame time 17ms
canvas-mouse-sweep: p95 frame time 17ms
canvas-mouse-sweep: layout duration 4ms
canvas-mouse-sweep: style recalc duration 38ms
canvas-mouse-sweep: layout count 14
canvas-mouse-sweep: style recalc count 78
canvas-mouse-sweep: task duration 880ms
canvas-mouse-sweep: script duration 158ms
canvas-mouse-sweep: TBT 0ms
canvas-mouse-sweep: heap used 65.7 MB
canvas-mouse-sweep: DOM nodes -280
canvas-mouse-sweep: event listeners -170
canvas-zoom-sweep: avg frame time 17ms
canvas-zoom-sweep: p95 frame time 17ms
canvas-zoom-sweep: layout duration 1ms
canvas-zoom-sweep: style recalc duration 17ms
canvas-zoom-sweep: layout count 6
canvas-zoom-sweep: style recalc count 31
canvas-zoom-sweep: task duration 366ms
canvas-zoom-sweep: script duration 11ms
canvas-zoom-sweep: TBT 0ms
canvas-zoom-sweep: heap used 71.3 MB
canvas-zoom-sweep: DOM nodes 77
canvas-zoom-sweep: event listeners 19
dom-widget-clipping: avg frame time 17ms
dom-widget-clipping: p95 frame time 17ms
dom-widget-clipping: layout duration 0ms
dom-widget-clipping: style recalc duration 8ms
dom-widget-clipping: layout count 0
dom-widget-clipping: style recalc count 11
dom-widget-clipping: task duration 452ms
dom-widget-clipping: script duration 162ms
dom-widget-clipping: TBT 0ms
dom-widget-clipping: heap used 71.7 MB
dom-widget-clipping: DOM nodes 18
dom-widget-clipping: event listeners 1
large-graph-idle: avg frame time 17ms
large-graph-idle: p95 frame time 17ms
large-graph-idle: layout duration 0ms
large-graph-idle: style recalc duration 5ms
large-graph-idle: layout count 0
large-graph-idle: style recalc count 5
large-graph-idle: task duration 598ms
large-graph-idle: script duration 35ms
large-graph-idle: TBT 0ms
large-graph-idle: heap used 82.9 MB
large-graph-idle: DOM nodes -270
large-graph-idle: event listeners -169
large-graph-pan: avg frame time 17ms
large-graph-pan: p95 frame time 17ms
large-graph-pan: layout duration 0ms
large-graph-pan: style recalc duration 10ms
large-graph-pan: layout count 0
large-graph-pan: style recalc count 65
large-graph-pan: task duration 1613ms
large-graph-pan: script duration 807ms
large-graph-pan: TBT 0ms
large-graph-pan: heap used 80.4 MB
large-graph-pan: DOM nodes -273
large-graph-pan: event listeners -74
large-graph-zoom: avg frame time 17ms
large-graph-zoom: p95 frame time 17ms
large-graph-zoom: layout duration 11ms
large-graph-zoom: style recalc duration 9ms
large-graph-zoom: layout count 60
large-graph-zoom: style recalc count 60
large-graph-zoom: task duration 1639ms
large-graph-zoom: script duration 735ms
large-graph-zoom: TBT 0ms
large-graph-zoom: heap used 74.0 MB
large-graph-zoom: DOM nodes 0
large-graph-zoom: event listeners 9
legacy-node-drag: avg frame time 17ms
legacy-node-drag: p95 frame time 17ms
legacy-node-drag: layout duration 0ms
legacy-node-drag: style recalc duration 5ms
legacy-node-drag: layout count 0
legacy-node-drag: style recalc count 41
legacy-node-drag: task duration 1916ms
legacy-node-drag: script duration 944ms
legacy-node-drag: TBT 0ms
legacy-node-drag: heap used 85.4 MB
legacy-node-drag: DOM nodes -138
legacy-node-drag: event listeners 188
minimap-idle: avg frame time 17ms
minimap-idle: p95 frame time 17ms
minimap-idle: layout duration 0ms
minimap-idle: style recalc duration 3ms
minimap-idle: layout count 0
minimap-idle: style recalc count 2
minimap-idle: task duration 553ms
minimap-idle: script duration 32ms
minimap-idle: TBT 0ms
minimap-idle: heap used 83.3 MB
minimap-idle: DOM nodes -275
minimap-idle: event listeners -76
subgraph-dom-widget-clipping: avg frame time 17ms
subgraph-dom-widget-clipping: p95 frame time 17ms
subgraph-dom-widget-clipping: layout duration 0ms
subgraph-dom-widget-clipping: style recalc duration 11ms
subgraph-dom-widget-clipping: layout count 0
subgraph-dom-widget-clipping: style recalc count 47
subgraph-dom-widget-clipping: task duration 417ms
subgraph-dom-widget-clipping: script duration 142ms
subgraph-dom-widget-clipping: TBT 0ms
subgraph-dom-widget-clipping: heap used 82.7 MB
subgraph-dom-widget-clipping: DOM nodes 19
subgraph-dom-widget-clipping: event listeners 7
subgraph-idle: avg frame time 17ms
subgraph-idle: p95 frame time 17ms
subgraph-idle: layout duration 0ms
subgraph-idle: style recalc duration 9ms
subgraph-idle: layout count 0
subgraph-idle: style recalc count 10
subgraph-idle: task duration 488ms
subgraph-idle: script duration 8ms
subgraph-idle: TBT 0ms
subgraph-idle: heap used 67.0 MB
subgraph-idle: DOM nodes -296
subgraph-idle: event listeners -216
subgraph-mouse-sweep: avg frame time 17ms
subgraph-mouse-sweep: p95 frame time 17ms
subgraph-mouse-sweep: layout duration 5ms
subgraph-mouse-sweep: style recalc duration 37ms
subgraph-mouse-sweep: layout count 18
subgraph-mouse-sweep: style recalc count 77
subgraph-mouse-sweep: task duration 827ms
subgraph-mouse-sweep: script duration 109ms
subgraph-mouse-sweep: TBT 0ms
subgraph-mouse-sweep: heap used 57.7 MB
subgraph-mouse-sweep: DOM nodes -296
subgraph-mouse-sweep: event listeners -201
subgraph-transition-enter: avg frame time 17ms
subgraph-transition-enter: p95 frame time 17ms
subgraph-transition-enter: layout duration 17ms
subgraph-transition-enter: style recalc duration 31ms
subgraph-transition-enter: layout count 13
subgraph-transition-enter: style recalc count 17
subgraph-transition-enter: task duration 931ms
subgraph-transition-enter: script duration 32ms
subgraph-transition-enter: TBT 141ms
subgraph-transition-enter: heap used 103.3 MB
subgraph-transition-enter: DOM nodes 13751
subgraph-transition-enter: event listeners 2381
viewport-pan-sweep: avg frame time 17ms
viewport-pan-sweep: p95 frame time 17ms
viewport-pan-sweep: layout duration 0ms
viewport-pan-sweep: style recalc duration 35ms
viewport-pan-sweep: layout count 0
viewport-pan-sweep: style recalc count 248
viewport-pan-sweep: task duration 5815ms
viewport-pan-sweep: script duration 2626ms
viewport-pan-sweep: TBT 0ms
viewport-pan-sweep: heap used 84.4 MB
viewport-pan-sweep: DOM nodes -272
viewport-pan-sweep: event listeners -154
vue-large-graph-idle: avg frame time 18ms
vue-large-graph-idle: p95 frame time 17ms
vue-large-graph-idle: layout duration 0ms
vue-large-graph-idle: style recalc duration 0ms
vue-large-graph-idle: layout count 0
vue-large-graph-idle: style recalc count 0
vue-large-graph-idle: task duration 16661ms
vue-large-graph-idle: script duration 277ms
vue-large-graph-idle: TBT 0ms
vue-large-graph-idle: heap used 169.4 MB
vue-large-graph-idle: DOM nodes -6548
vue-large-graph-idle: event listeners -7472
vue-large-graph-pan: avg frame time 18ms
vue-large-graph-pan: p95 frame time 17ms
vue-large-graph-pan: layout duration 0ms
vue-large-graph-pan: style recalc duration 18ms
vue-large-graph-pan: layout count 0
vue-large-graph-pan: style recalc count 166
vue-large-graph-pan: task duration 20221ms
vue-large-graph-pan: script duration 879ms
vue-large-graph-pan: TBT 66ms
vue-large-graph-pan: heap used 176.5 MB
vue-large-graph-pan: DOM nodes -6548
vue-large-graph-pan: event listeners -7470
vue-node-resize-workload: avg frame time 18ms
vue-node-resize-workload: p95 frame time 17ms
vue-node-resize-workload: layout duration 31ms
vue-node-resize-workload: style recalc duration 89ms
vue-node-resize-workload: layout count 20
vue-node-resize-workload: style recalc count 20
vue-node-resize-workload: task duration 6007ms
vue-node-resize-workload: script duration 106ms
vue-node-resize-workload: TBT 467ms
vue-node-resize-workload: heap used 170.9 MB
vue-node-resize-workload: DOM nodes -6548
vue-node-resize-workload: event listeners -7470
workflow-execution: avg frame time 17ms
workflow-execution: p95 frame time 17ms
workflow-execution: layout duration 2ms
workflow-execution: style recalc duration 20ms
workflow-execution: layout count 3
workflow-execution: style recalc count 15
workflow-execution: task duration 121ms
workflow-execution: script duration 11ms
workflow-execution: TBT 0ms
workflow-execution: heap used 70.2 MB
workflow-execution: DOM nodes 136
workflow-execution: event listeners 99
Raw data
{
  "timestamp": "2026-09-03T18:00:16.245Z",
  "gitSha": "4d99a45c24697190893c597c87fbfd1c586605ef",
  "branch": "backport-16546-to-cloud-1.53",
  "measurements": [
    {
      "name": "canvas-idle",
      "durationMs": 2068.4459999999945,
      "styleRecalcs": 9,
      "styleRecalcDurationMs": 7.947999999999999,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 572.345,
      "heapDeltaBytes": -11439172,
      "heapUsedBytes": 58883768,
      "domNodes": -279,
      "jsHeapTotalBytes": 5234688,
      "scriptDurationMs": 9.385000000000002,
      "eventListeners": -157,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.670000000000012,
      "p95FrameDurationMs": 16.800000000000182
    },
    {
      "name": "canvas-idle",
      "durationMs": 2017.971999999986,
      "styleRecalcs": 8,
      "styleRecalcDurationMs": 7.451999999999998,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 491.4560000000001,
      "heapDeltaBytes": -11288272,
      "heapUsedBytes": 58198704,
      "domNodes": -283,
      "jsHeapTotalBytes": 4972544,
      "scriptDurationMs": 8.251999999999999,
      "eventListeners": -155,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.800000000000182
    },
    {
      "name": "canvas-mouse-sweep",
      "durationMs": 1799.1499999999405,
      "styleRecalcs": 76,
      "styleRecalcDurationMs": 36.324000000000005,
      "layouts": 14,
      "layoutDurationMs": 4.523,
      "taskDurationMs": 861.9519999999999,
      "heapDeltaBytes": -7937668,
      "heapUsedBytes": 62196680,
      "domNodes": -281,
      "jsHeapTotalBytes": 5758976,
      "scriptDurationMs": 153.29000000000002,
      "eventListeners": -155,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.700000000000728
    },
    {
      "name": "canvas-mouse-sweep",
      "durationMs": 1861.8960000000015,
      "styleRecalcs": 79,
      "styleRecalcDurationMs": 38.900999999999996,
      "layouts": 14,
      "layoutDurationMs": 4.033,
      "taskDurationMs": 898.1250000000001,
      "heapDeltaBytes": 5265196,
      "heapUsedBytes": 75592448,
      "domNodes": -279,
      "jsHeapTotalBytes": 5496832,
      "scriptDurationMs": 163.59400000000002,
      "eventListeners": -185,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.799999999999272
    },
    {
      "name": "canvas-zoom-sweep",
      "durationMs": 1685.0130000000263,
      "styleRecalcs": 29,
      "styleRecalcDurationMs": 17.332,
      "layouts": 6,
      "layoutDurationMs": 1.14,
      "taskDurationMs": 365.606,
      "heapDeltaBytes": 4451668,
      "heapUsedBytes": 74956376,
      "domNodes": 76,
      "jsHeapTotalBytes": 5505024,
      "scriptDurationMs": 11.122,
      "eventListeners": 19,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.699999999999818
    },
    {
      "name": "canvas-zoom-sweep",
      "durationMs": 1723.186999999939,
      "styleRecalcs": 32,
      "styleRecalcDurationMs": 17.358999999999998,
      "layouts": 6,
      "layoutDurationMs": 1.041,
      "taskDurationMs": 366.773,
      "heapDeltaBytes": 4461996,
      "heapUsedBytes": 74507812,
      "domNodes": 77,
      "jsHeapTotalBytes": 5505024,
      "scriptDurationMs": 11.241999999999999,
      "eventListeners": 19,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.700000000000728
    },
    {
      "name": "dom-widget-clipping",
      "durationMs": 644.3550000000187,
      "styleRecalcs": 10,
      "styleRecalcDurationMs": 6.810999999999999,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 454.62499999999994,
      "heapDeltaBytes": 17833000,
      "heapUsedBytes": 87455600,
      "domNodes": 16,
      "jsHeapTotalBytes": 6029312,
      "scriptDurationMs": 162.686,
      "eventListeners": 0,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.66333333333332,
      "p95FrameDurationMs": 16.700000000000728
    },
    {
      "name": "dom-widget-clipping",
      "durationMs": 629.5630000000756,
      "styleRecalcs": 12,
      "styleRecalcDurationMs": 8.878000000000002,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 448.42400000000004,
      "heapDeltaBytes": -7800592,
      "heapUsedBytes": 62892692,
      "domNodes": 20,
      "jsHeapTotalBytes": 6815744,
      "scriptDurationMs": 160.443,
      "eventListeners": 2,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.699999999999818
    },
    {
      "name": "large-graph-idle",
      "durationMs": 2035.0939999999582,
      "styleRecalcs": 5,
      "styleRecalcDurationMs": 4.864,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 584.058,
      "heapDeltaBytes": -13546680,
      "heapUsedBytes": 87129184,
      "domNodes": -269,
      "jsHeapTotalBytes": -2142208,
      "scriptDurationMs": 36.521,
      "eventListeners": -155,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.800000000000182
    },
    {
      "name": "large-graph-idle",
      "durationMs": 2066.4130000000114,
      "styleRecalcs": 5,
      "styleRecalcDurationMs": 4.753,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 612.9350000000002,
      "heapDeltaBytes": 10899888,
      "heapUsedBytes": 86781524,
      "domNodes": -271,
      "jsHeapTotalBytes": -1916928,
      "scriptDurationMs": 33.817,
      "eventListeners": -183,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.670000000000012,
      "p95FrameDurationMs": 16.700000000000728
    },
    {
      "name": "large-graph-pan",
      "durationMs": 2257.127999999966,
      "styleRecalcs": 67,
      "styleRecalcDurationMs": 11.685999999999998,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 1604.192,
      "heapDeltaBytes": 14917044,
      "heapUsedBytes": 80134160,
      "domNodes": -270,
      "jsHeapTotalBytes": 225280,
      "scriptDurationMs": 805.738,
      "eventListeners": -153,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.700000000000728
    },
    {
      "name": "large-graph-pan",
      "durationMs": 2308.2319999999754,
      "styleRecalcs": 63,
      "styleRecalcDurationMs": 8.256000000000004,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 1622.118,
      "heapDeltaBytes": 22695604,
      "heapUsedBytes": 88503368,
      "domNodes": -276,
      "jsHeapTotalBytes": 225280,
      "scriptDurationMs": 808.569,
      "eventListeners": 6,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.66333333333335,
      "p95FrameDurationMs": 16.800000000000182
    },
    {
      "name": "large-graph-zoom",
      "durationMs": 3517.1890000000303,
      "styleRecalcs": 60,
      "styleRecalcDurationMs": 9.433999999999997,
      "layouts": 60,
      "layoutDurationMs": 11.340000000000003,
      "taskDurationMs": 1659.703,
      "heapDeltaBytes": 12043840,
      "heapUsedBytes": 79489140,
      "domNodes": 0,
      "jsHeapTotalBytes": 0,
      "scriptDurationMs": 742.491,
      "eventListeners": 10,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.799999999999272
    },
    {
      "name": "large-graph-zoom",
      "durationMs": 3437.26300000003,
      "styleRecalcs": 60,
      "styleRecalcDurationMs": 9.346999999999998,
      "layouts": 60,
      "layoutDurationMs": 11.28,
      "taskDurationMs": 1619.0160000000003,
      "heapDeltaBytes": 8162420,
      "heapUsedBytes": 75660056,
      "domNodes": 0,
      "jsHeapTotalBytes": 0,
      "scriptDurationMs": 726.566,
      "eventListeners": 8,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666696,
      "p95FrameDurationMs": 16.799999999999272
    },
    {
      "name": "legacy-node-drag",
      "durationMs": 3115.3060000000323,
      "styleRecalcs": 40,
      "styleRecalcDurationMs": 4.659,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 1920.5379999999998,
      "heapDeltaBytes": 22246312,
      "heapUsedBytes": 89183840,
      "domNodes": 0,
      "jsHeapTotalBytes": 417792,
      "scriptDurationMs": 947.322,
      "eventListeners": 188,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666636,
      "p95FrameDurationMs": 16.700000000000728
    },
    {
      "name": "legacy-node-drag",
      "durationMs": 3097.759999999994,
      "styleRecalcs": 41,
      "styleRecalcDurationMs": 5.355000000000002,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 1912.1189999999997,
      "heapDeltaBytes": 23205672,
      "heapUsedBytes": 89872360,
      "domNodes": -276,
      "jsHeapTotalBytes": 417792,
      "scriptDurationMs": 941.0070000000002,
      "eventListeners": 188,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666636,
      "p95FrameDurationMs": 16.799999999999272
    },
    {
      "name": "minimap-idle",
      "durationMs": 2026.585999999952,
      "styleRecalcs": 3,
      "styleRecalcDurationMs": 2.2709999999999986,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 551.4250000000001,
      "heapDeltaBytes": 21856076,
      "heapUsedBytes": 87579728,
      "domNodes": -272,
      "jsHeapTotalBytes": 0,
      "scriptDurationMs": 31.369000000000007,
      "eventListeners": -155,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.66333333333335,
      "p95FrameDurationMs": 16.700000000000728
    },
    {
      "name": "minimap-idle",
      "durationMs": 2002.7760000000399,
      "styleRecalcs": 1,
      "styleRecalcDurationMs": 3.436999999999999,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 553.62,
      "heapDeltaBytes": 21776088,
      "heapUsedBytes": 87136140,
      "domNodes": -278,
      "jsHeapTotalBytes": 0,
      "scriptDurationMs": 32.234,
      "eventListeners": 4,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.699999999999818
    },
    {
      "name": "subgraph-dom-widget-clipping",
      "durationMs": 594.8710000000119,
      "styleRecalcs": 47,
      "styleRecalcDurationMs": 11.794999999999998,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 420.7369999999999,
      "heapDeltaBytes": 14341816,
      "heapUsedBytes": 85972684,
      "domNodes": 20,
      "jsHeapTotalBytes": 4980736,
      "scriptDurationMs": 141.78000000000003,
      "eventListeners": 8,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.66333333333335,
      "p95FrameDurationMs": 16.699999999999818
    },
    {
      "name": "subgraph-dom-widget-clipping",
      "durationMs": 608.0949999999348,
      "styleRecalcs": 46,
      "styleRecalcDurationMs": 10.549999999999999,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 412.541,
      "heapDeltaBytes": 14747020,
      "heapUsedBytes": 87403404,
      "domNodes": 18,
      "jsHeapTotalBytes": 5242880,
      "scriptDurationMs": 142.97000000000003,
      "eventListeners": 6,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.800000000000182
    },
    {
      "name": "subgraph-idle",
      "durationMs": 2023.0099999999993,
      "styleRecalcs": 9,
      "styleRecalcDurationMs": 8.415,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 484.79100000000005,
      "heapDeltaBytes": 2880008,
      "heapUsedBytes": 75596244,
      "domNodes": -296,
      "jsHeapTotalBytes": 5758976,
      "scriptDurationMs": 7.893999999999998,
      "eventListeners": -231,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.66333333333332,
      "p95FrameDurationMs": 16.800000000000182
    },
    {
      "name": "subgraph-idle",
      "durationMs": 2021.284000000037,
      "styleRecalcs": 10,
      "styleRecalcDurationMs": 9.708000000000002,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 491.349,
      "heapDeltaBytes": -7775964,
      "heapUsedBytes": 64945172,
      "domNodes": -296,
      "jsHeapTotalBytes": 5758976,
      "scriptDurationMs": 7.564000000000001,
      "eventListeners": -201,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.700000000000728
    },
    {
      "name": "subgraph-mouse-sweep",
      "durationMs": 1718.6290000000781,
      "styleRecalcs": 77,
      "styleRecalcDurationMs": 37.859,
      "layouts": 18,
      "layoutDurationMs": 5.666999999999999,
      "taskDurationMs": 837.567,
      "heapDeltaBytes": -11990296,
      "heapUsedBytes": 60362300,
      "domNodes": -298,
      "jsHeapTotalBytes": 5758976,
      "scriptDurationMs": 110.43599999999999,
      "eventListeners": -201,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.800000000000182
    },
    {
      "name": "subgraph-mouse-sweep",
      "durationMs": 1721.8070000000125,
      "styleRecalcs": 77,
      "styleRecalcDurationMs": 35.491,
      "layouts": 18,
      "layoutDurationMs": 4.695,
      "taskDurationMs": 816.5830000000001,
      "heapDeltaBytes": -11652976,
      "heapUsedBytes": 60691824,
      "domNodes": -294,
      "jsHeapTotalBytes": 6021120,
      "scriptDurationMs": 106.57,
      "eventListeners": -201,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.66333333333332,
      "p95FrameDurationMs": 16.800000000000182
    },
    {
      "name": "subgraph-transition-enter",
      "durationMs": 1417.2059999999647,
      "styleRecalcs": 17,
      "styleRecalcDurationMs": 31.347,
      "layouts": 13,
      "layoutDurationMs": 17.098,
      "taskDurationMs": 931.4720000000001,
      "heapDeltaBytes": 21161468,
      "heapUsedBytes": 108358888,
      "domNodes": 13751,
      "jsHeapTotalBytes": 11272192,
      "scriptDurationMs": 31.741000000000007,
      "eventListeners": 2381,
      "totalBlockingTimeMs": 141,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.700000000000728
    },
    {
      "name": "viewport-pan-sweep",
      "durationMs": 8528.055999999993,
      "styleRecalcs": 247,
      "styleRecalcDurationMs": 35.355,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 5834.334,
      "heapDeltaBytes": 13355552,
      "heapUsedBytes": 88516108,
      "domNodes": -273,
      "jsHeapTotalBytes": -905216,
      "scriptDurationMs": 2602.188,
      "eventListeners": -169,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.66333333333332,
      "p95FrameDurationMs": 16.799999999999272
    },
    {
      "name": "viewport-pan-sweep",
      "durationMs": 8466.046000000006,
      "styleRecalcs": 248,
      "styleRecalcDurationMs": 34.875,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 5796.013,
      "heapDeltaBytes": -12025808,
      "heapUsedBytes": 88388880,
      "domNodes": -270,
      "jsHeapTotalBytes": -868352,
      "scriptDurationMs": 2650.1580000000004,
      "eventListeners": -139,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.799999999999272
    },
    {
      "name": "vue-large-graph-idle",
      "durationMs": 17496.25900000001,
      "styleRecalcs": 0,
      "styleRecalcDurationMs": 0,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 16777.411,
      "heapDeltaBytes": -22834844,
      "heapUsedBytes": 179377596,
      "domNodes": -6548,
      "jsHeapTotalBytes": 2084864,
      "scriptDurationMs": 283.392,
      "eventListeners": -7473,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 17.776666666666642,
      "p95FrameDurationMs": 16.80000000000291
    },
    {
      "name": "vue-large-graph-idle",
      "durationMs": 17010.60099999984,
      "styleRecalcs": 0,
      "styleRecalcDurationMs": 0,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 16543.716,
      "heapDeltaBytes": -32742236,
      "heapUsedBytes": 175785900,
      "domNodes": -6548,
      "jsHeapTotalBytes": -3420160,
      "scriptDurationMs": 271.092,
      "eventListeners": -7471,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 17.776666666666763,
      "p95FrameDurationMs": 16.799999999999272
    },
    {
      "name": "vue-large-graph-pan",
      "durationMs": 20720.768000000022,
      "styleRecalcs": 165,
      "styleRecalcDurationMs": 17.708000000000002,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 20330.016,
      "heapDeltaBytes": -19235296,
      "heapUsedBytes": 190095612,
      "domNodes": -6548,
      "jsHeapTotalBytes": -2592768,
      "scriptDurationMs": 853.759,
      "eventListeners": -7471,
      "totalBlockingTimeMs": 44,
      "frameDurationMs": 17.776666666666763,
      "p95FrameDurationMs": 16.700000000000728
    },
    {
      "name": "vue-large-graph-pan",
      "durationMs": 20494.99999999989,
      "styleRecalcs": 167,
      "styleRecalcDurationMs": 17.305999999999987,
      "layouts": 0,
      "layoutDurationMs": 0,
      "taskDurationMs": 20111.697,
      "heapDeltaBytes": -22226496,
      "heapUsedBytes": 179958492,
      "domNodes": -6548,
      "jsHeapTotalBytes": 1568768,
      "scriptDurationMs": 903.9609999999999,
      "eventListeners": -7469,
      "totalBlockingTimeMs": 87,
      "frameDurationMs": 17.776666666666642,
      "p95FrameDurationMs": 16.799999999999272
    },
    {
      "name": "vue-node-resize-workload",
      "durationMs": 6109.93499999995,
      "styleRecalcs": 20,
      "styleRecalcDurationMs": 90.55399999999997,
      "layouts": 20,
      "layoutDurationMs": 27.714000000000016,
      "taskDurationMs": 5997.237999999999,
      "heapDeltaBytes": -28722004,
      "heapUsedBytes": 174287228,
      "domNodes": -6548,
      "jsHeapTotalBytes": 9084928,
      "scriptDurationMs": 107.04799999999999,
      "eventListeners": -7469,
      "totalBlockingTimeMs": 362,
      "frameDurationMs": 17.773333333333298,
      "p95FrameDurationMs": 16.799999999999272
    },
    {
      "name": "vue-node-resize-workload",
      "durationMs": 6117.600999999922,
      "styleRecalcs": 20,
      "styleRecalcDurationMs": 86.85499999999996,
      "layouts": 20,
      "layoutDurationMs": 34.25300000000001,
      "taskDurationMs": 6016.472000000002,
      "heapDeltaBytes": -26035548,
      "heapUsedBytes": 184108016,
      "domNodes": -6548,
      "jsHeapTotalBytes": 4694016,
      "scriptDurationMs": 104.046,
      "eventListeners": -7471,
      "totalBlockingTimeMs": 572,
      "frameDurationMs": 17.776666666666642,
      "p95FrameDurationMs": 16.799999999999272
    },
    {
      "name": "workflow-execution",
      "durationMs": 486.3080000000082,
      "styleRecalcs": 18,
      "styleRecalcDurationMs": 21.670999999999996,
      "layouts": 3,
      "layoutDurationMs": 2.5100000000000002,
      "taskDurationMs": 115.92600000000002,
      "heapDeltaBytes": 5315116,
      "heapUsedBytes": 73771216,
      "domNodes": 151,
      "jsHeapTotalBytes": 262144,
      "scriptDurationMs": 11.504000000000001,
      "eventListeners": 99,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.666666666666668,
      "p95FrameDurationMs": 16.800000000000182
    },
    {
      "name": "workflow-execution",
      "durationMs": 495.3969999999117,
      "styleRecalcs": 12,
      "styleRecalcDurationMs": 19.258,
      "layouts": 3,
      "layoutDurationMs": 0.9510000000000001,
      "taskDurationMs": 126.14399999999998,
      "heapDeltaBytes": 5050800,
      "heapUsedBytes": 73417640,
      "domNodes": 121,
      "jsHeapTotalBytes": 262144,
      "scriptDurationMs": 10.580999999999998,
      "eventListeners": 99,
      "totalBlockingTimeMs": 0,
      "frameDurationMs": 16.670000000000012,
      "p95FrameDurationMs": 16.700000000000728
    }
  ]
}

🔬 E2E Coverage

Metric Covered Total Pct
Lines 48029 70518 68.1% 🟡
Functions 0 0 — —
Branches 0 0 — —
Top 10 files by uncovered lines
File Coverage Missed
src/LGraphCanvas.ts 67.1% 1188
src/LGraphNode.ts 69.4% 397
src/extensions/core/cameraInfo/CameraInfoViewport.ts 2.0% 343
src/platform/workspace/stores/billingOperationStore.ts 8.3% 300
src/platform/workspace/stores/workspaceAuthStore.ts 36.0% 288
src/platform/workspace/stores/teamWorkspaceStore.ts 37.7% 261
src/LGraph.ts 78.8% 255
src/scripts/app.ts 71.7% 247
src/scripts/pnginfo.ts 21.4% 221
src/stores/assetsStore.ts 44.7% 204

@github-actions github-actions Bot added the risk:R3 PR risk grade (advisory shadow check; grader-owned) label Sep 3, 2026
@codecov

codecov Bot commented Sep 3, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

@@              Coverage Diff              @@
##             cloud/1.53   #16809   +/-   ##
=============================================
  Coverage              ?   83.29%           
=============================================
  Files                 ?     2023           
  Lines                 ?   117044           
  Branches              ?    32459           
=============================================
  Hits                  ?    97496           
  Misses                ?    19200           
  Partials              ?      348           
Flag Coverage Δ
e2e 66.61% <83.33%> (?)
unit 76.55% <100.00%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
src/core/graph/nodeShell/nodeShellState.ts 100.00% <ø> (ø)
src/lib/litegraph/src/LGraphNode.ts 69.19% <100.00%> (ø)
...ib/litegraph/src/subgraph/subgraphDeduplication.ts 98.82% <100.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@comfy-pr-bot
comfy-pr-bot merged commit 117f03b into cloud/1.53 Sep 3, 2026
108 checks passed
@comfy-pr-bot
comfy-pr-bot deleted the backport-16546-to-cloud-1.53 branch September 3, 2026 18:10
Penguinjanator pushed a commit to Penguinjanator/ComfyUI_frontend that referenced this pull request Nov 5, 2026
…y-Org#22013)

## Summary

Uses the websocket contract Comfy-Org/ComfyUI#16763 and Comfy-Org#16809 shipped,
which the frontend never adopted: `queuePrompt` sent no
`workflow_metadata`, so the server had nothing to stamp beyond the id
inside `extra_pnginfo`. This sends it, reads what comes back, and uses
it to place a job that no per-tab mapping knows about.

Replaces Comfy-Org#20045. Comfy-Org#21666 landed the instance-keyed gate for the Agent
while that PR was in review, so the headline cross-tab fix is already on
main. What was left is here, rebuilt on top of it.

## Changes

- `queuePrompt` sends `workflow_metadata: { workflow_id }`, and the
stamped id is forwarded to the gate from `execution_start`,
`progress_state`, the `executed` listener, and the binary preview
header, whose decoder was dropping it.
- The ownership gate — now `rememberStampAndCheckActiveWorkflow`, named
for the per-job stamp it records — gains two legs below `instanceId`:
the session path, then the frame's own workflow id. The graph id is the
weakest leg on purpose, because every copy of a workflow shares it, so
copy-paste into a new tab gives two tabs one id and keying on it first
makes each match the other's jobs.
- The all-zero UUID is discarded rather than compared, on both sides. It
is `LGraph._id`'s default and the codebase reads it as "no id yet", so
comparing it as a real id matched nothing and rejected a fresh graph's
own frames.
- `forgetFinishedJobs` releases the tab's workflow status. Only a
terminal frame cleared it, so a job that ended without one left the
badge claiming the tab was running for the rest of the session. It
releases an orphaned Running badge only: a workflow whose newer job
already completed keeps its Completed or Failed badge when an older
unreadable job is forgotten.
- ADR-EXECUTION-ROUTING-0049 records the resolution order and that the
unresolvable-frame fallback departs from ADR-GRAPH-DOCUMENT-0026 D2,
with the condition for removing the exception.

## Review focus

- **Comfy-Org#21666's gate had no unit coverage**, and the existing
`executionStore` fixtures carry no `instanceId`, so nothing exercised
the instance leg. `executionStore.workflowOwnership.test.ts` covers it
first, so the behaviour this builds on is pinned before anything is
added to it.
- **The unresolvable fallback is the weakest point.** It is narrower
than permissive, since a foreign job's unresolvable frame is dropped
while another job is active, but with two tabs open and a frame
unresolvable it can still land on the wrong one. The ADR says so.
- **`progress_text` is still unattributable on current core.** Core
packs it as a binary frame `send_sync` cannot stamp, and the frontend
decodes a job id out of it only under `supports_progress_text_metadata`,
which no core version sets — so the gate is called with no job id and
returns before any stamp lookup. Comfy-Org/ComfyUI#16887 is what
unblocks the leg.

## Tests

Every change is verified by mutation: the fix reverted and the test
confirmed to fail. Each wire boundary falsifies on its own — dropping
the `workflow_metadata` spread fails the request rows, dropping the `!==
zeroUuid` guard fails the sentinel row, removing `workflowId` from the
type-4 decoder fails the preview decode, and removing either app
forwarding argument fails the unmapped-routing case. Removing the
instance comparison fails the shared-graph case, the path leg two, the
workflow-id leg one, and the status release one.

Store, request and decoder coverage lives in
`executionStore.workflowOwnership.test.ts`,
`executionStore.terminalRecovery.test.ts`, `api.queuePrompt.test.ts`,
`api.previewMetadata.test.ts` and `app.test.ts`. `typecheck:app`,
`typecheck:browser` and the `fallow` audit gate are clean, with 0
introduced findings of any kind.

Both store suites register tabs through `workflowStore.attachWorkflow`
rather than assigning `openWorkflows`, because `applyWorkflowStatus`
refuses to record a status for a workflow the real `isOpen` does not
consider open. Assigning the computed made the premise silently false.

`browser_tests/tests/wsReconnectStaleJob.spec.ts` carries the black-box
regression for the status release. It strands one unreadable job on each
of two workflows — one of them the workflow's only job, the other
alongside a live sibling — and uses the orphaned workflow's badge
disappearing as the cleanup barrier before asserting the sibling's badge
survives, because the detail-request counters move before the responses
are fulfilled and cannot establish completion. Verified three ways on
`--project=chromium`: 6/6 green on the repair and 3/3 on
`--repeat-each=3`; failing at the barrier when cleanup is prevented from
running, so the barrier is not vacuous; and failing at the sibling
assertion under the pre-Comfy-Org#22013 clear ordering.

Comfy-Org#20700 still covers replacing the remaining scripted reconnect specs
with real-backend tests.

## Sibling overlap

Overlaps Comfy-Org#20982 (draft) at `packages/api-client/src/ComfyApi.ts`, where
both add a different member to the same `BackendApiCalls` interface:
that PR an `agent_status` entry, this one `workflowId` on the existing
`b_preview_with_metadata` entry. No shared behaviour or symbol.

**Comfy-Org#11951 conflicts on policy, not on text.** It proposes a
`messageMatchesActiveWorkflow` resolver that consults the frame's
workflow id ahead of session ownership — the inverse of the order
decided here, and the order that makes two tabs sharing one copied graph
id match each other's jobs. Its resolver is superseded; remaining work
there should be carried onto this gate rather than restoring the
id-first policy during integration. Recorded in
ADR-EXECUTION-ROUTING-0049 under the rejected alternatives. Needs a
human call rather than being settled by this PR.

**Comfy-Org#22186 landed first, and this branch carried the contracts across.**
It merged 2026-10-30 (`d9290b0`), moving the API and execution contracts
into `packages/api-client`. The merge of `main` at `24b64d62` relocated
this PR's request field, preview decoding and stamped types into
`packages/api-client/src/ComfyApi.ts` and
`packages/api-client/src/executionTypes.ts`. The relocation is
content-identical: comparing this PR's own diff before the merge
(`9facf6c7`..`a8e25943`) against after it (`1bbea48f`..`24b64d62`), the
entire changed-line delta is two lines out and six in, all in
`api.previewMetadata.test.ts` — the `ComfyApi` import path and the
constructor options the package now requires. No production line
changed.

**Comfy-Org#22271 (open) overlaps on ownership policy.** It adds an unconditional
`detail.workflow_id !== this.rootGraph.id` rejection after the output
ownership check, which can reject a job this PR's stronger instance/path
identity accepts, and treats the all-zero UUID as a real identity rather
than the "no id yet" default this PR discards. Its remaining coverage
should be carried onto this PR's single ownership decision rather than
kept as an independent guard. Same class of conflict as Comfy-Org#11951, and the
same kind of human call.

Proposed order is this PR first, since Comfy-Org#20982 is a draft that has not
moved since 2026-10-18, then a one-line rebase there. Reversed is
equally cheap: this branch would merge main and re-add its line.

## Derivation, and the control that it is load-bearing

`workflow_metadata` is no longer hand-declared. Comfy-Org#22426 is on `main`, so
both
wire types now come from `@comfyorg/comfyui-api-types`, which generates
core's
`PromptRequest` from `openapi.yaml` pinned at `4281eb0a14`:

```ts
// request — the spec's map narrowed to the one key this client sends
workflow_metadata?: Pick<PromptWorkflowMetadata, 'workflow_id'>

// frame — the map's VALUE type, not the map
type StampedWorkflowId = { workflow_id?: PromptWorkflowMetadata[string] }
```

Core's spec defines no websocket frame schemas. It documents that
`workflow_metadata` is echoed onto every JSON frame carrying a
`prompt_id`, so
the frame field is that request contract read back. The frame carries
the map's
contents merged into the frame object, which is why the value type is
what
transfers — a `Pick` or `Partial` of the map would describe the wrong
shape
here even though it would compile.

The dependency is on `packages/api-client`, not the app, since
`ComfyApi` builds
the body.

### Verification Evidence

**1. Delete the member from the pinned spec, regenerate — `pnpm
typecheck` fails.**

```
packages/comfyui-api-types/src/index.ts(9,29): error TS2339:
  Property 'workflow_metadata' does not exist on type 'PromptRequest'.
```

Restored: spec hash back to `8f0da854…`, `check:generated` 0,
`typecheck` 0.

**2. That is not sufficient on its own.** The error above surfaces at
the
package's own alias — the first link in the chain — so it does not show
that
consumers are tied to the spec. Isolating them: retype the spec's value
to
`integer` *and* relax the package's `Record<string, string>` constraint,
leaving
consumers as the only thing that can fail. The retype reaches real call
sites:

```
src/stores/executionStore.ts(592,38): error TS2345: Argument of type
  'number | undefined' is not assignable to parameter of type 'string | undefined'.
src/stores/executionStore.ts(593,55): error TS2345: …
src/stores/executionStore.ts(752,64): error TS2345: …
src/scripts/app.ts(782,11):          error TS2345: …
```

Both controls reverted. Gates after restore: `typecheck` 0,
`typecheck:browser` 0, `oxlint --type-aware` on both changed files 0
(verified
scanning — an injected `no-explicit-any` is reported), 239
`packages/api-client`
tests passing.

`main` was merged rather than rebased, so existing review anchors are
preserved.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport Backporting a PR onto a release candidate risk:R3 PR risk grade (advisory shadow check; grader-owned)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants