Repository navigation
[backport core/1.54] fix: mint disjoint-range node ids for CRDT-bound graphs to prevent agent/frontend id collision (#18095) - #18524
Conversation
…ent/frontend id collision (#18095) <!-- ccr-slack-attribution --> _Requested by **Christian Byrne** · [Slack thread](https://comfy-organization.slack.com/archives/C0BGH348Z0C/p1789589396272619?thread_ts=1789589396.272619&cid=C0BGH348Z0C)_ Fixes the root cause of the agent/frontend node-id collision: the frontend's local node-id counter (`idAllocation.ts`, `++lastNodeId`) and the server-side agent independently minted node ids for the same bound CRDT doc, with no shared reservation between them. When both minted before observing the other's write, their `add_node` ops collided on `comfy-multi-player`'s applier register `["node", id]`, which resolves the collision as pure last-write-wins over `(base_version, actor, op_id)` and silently dropped the loser (`"lww-dropped"`) — with no error surfaced to either actor. One mechanism, three symptoms: 1. a duplicated node is repeatedly wiped 2. a phantom node (a blank Save Image, in the repro below) appears in its place 3. the agent's own canonical graph read disagrees with the still-visible canvas **Fix:** a root graph bound to the in-app agent's collaborative doc now mints node ids in a new `'crdt-disjoint'` mode (`idAllocation.ts`) instead of the default sequential counter — a random id with bit 41 forced set and bit 40 forced clear, disjoint from the agent's own `2**40 | random52` convention by construction, not by odds. This closes the id-collision defect for real production traffic. **What this PR does NOT fix (read before closing anything):** the *silent* resolution of two writes that land on the same node id. However that id is arrived at, the applier still resolves the shared `["node", id]` register as pure last-write-wins and drops the loser with no error surfaced to either actor — the user's edit vanishes on the next full reconcile, a phantom node takes its place, and the agent's canonical read disagrees with the visible canvas. That behavior is unchanged by this PR and is what the two `test.fail()` Playwright specs pin. Disjoint-range minting makes it much harder to *reach* (the two actors no longer pick one id by accident), but it is still reachable — concurrent edits after a reconnect, an id replayed from an older document, or any future mint path that stops respecting the range split. Do not treat the tracked item this PR closes as covering it. **Blast radius:** every user with an agent-bound workflow open will start receiving large (~2^41–2^52-magnitude), randomly-ordered node ids from this mint path instead of small sequential ones — a real, user-visible behavioral change (node-id badges, any code that assumes small/sequential ids for a bound graph), not a test-only change. - **What**: - `src/lib/litegraph/src/idAllocation.ts` — new `NodeIdMintMode` (`'sequential'` default, `'crdt-disjoint'`) and `mintCrdtDisjointNodeId()`. `mintNodeId(state, mode)` dispatches on it; sequential mode and `observeNodeId` are unchanged. - `src/lib/litegraph/src/docBoundGraphs.ts` — a probe registry litegraph pulls at mint time (`isRootGraphDocBound`). `attachMintPortWiring` is its only registrant, so the enabled/doc-bound/current-graph signal the mint ports already gate their sends on is also what decides the mint mode: no second copy of that state, no watch, no shadow id, no component-side teardown (`detach()` unregisters). Dependency direction is inverted rather than added to — litegraph no longer reaches into `@/stores` for this. - `src/lib/litegraph/src/LGraph.ts` — subgraph-interior mints stay sequential even when the root graph is agent-bound; only root-level mints use the disjoint mode. - `browser_tests/fixtures/agentCrdtIdCollisionFixture.ts` — a new repro harness. Deliberately **not** built on `agentConversationFixture` (see its module doc): that fixture replays a recording captured against a real backend and only ever calls `HostDoc.apply()` for the *agent's* own ops, never the frontend's, so it can't exercise two actors writing the same node id. This harness instead: - boots the real docked agent panel against a mocked `/ws` + REST layer (no real ComfyUI/agent backend — see "What I could not run live" below), - drives the **real** "Duplicate" context-menu action so the colliding id is genuinely minted by `idAllocation.ts` and the outbound `doc_ops` frame is genuinely produced by `opSender`/`layoutMintPort`, - now that the `'crdt-disjoint'` mint above makes a *natural* id collision on a frontend-minted id impossible, **forces** the same-id write (it reuses the disjoint id the frontend actually minted, read back off its own outbound `doc_ops` frame) and resolves both writes through the **unmodified production applier** (`@comfyorg/comfy-multi-player`'s `applyOps`) via `HostDoc.applyWire`. It is not, and no longer claims to be, a repro of an allocation race. - `browser_tests/fixtures/agentFollowerHostSocket.ts` — one `heldClientOps()` accessor, so a caller using the shared host's existing `humanOpsHost: 'hold'` mode can reach the `doc_ops` batch the host is sitting on and decide when it reaches the document. The collision scenario needs different `doc_ops` timing, not a second transport, so it runs on the shared host rather than a second WebSocket implementation of its own. No new option and no second parser: ops arrive validated by main's `agentWireFrame.ts` (`parseWireOps`), and both writes resolve through main's single `HostDoc.applyWire` path. - `browser_tests/tests/agent/agentNodeIdCollision.spec.ts` — two `test.fail()` specs pinning the still-open silent-LWW-drop behavior described above (not the id-allocation defect, which is fixed here and covered by unit tests) (symptoms 1+2 combined in one test, since they're two faces of the same LWW-overwrite event; symptom 3 in the other): 1. *"wipes a duplicated node and replaces it with a phantom node..."* — duplicates the seed node, mints a competing agent `add_node` (SaveImage) at the same id with a higher `base_version`, applies both through the real applier (asserting the human op comes back `"lww-dropped"` — real proof of the mechanism, not asserted by narration), delivers the agent's winning write as a live `doc_update`, then forces a full catch-up reconcile (a tab-switch away and back, exactly `agentTabSwitchCatchUp.spec.ts`'s existing mechanism) and asserts the duplicate's own content is still there. Screenshots attached before/after. 2. *"leaves the agent's own graph read disagreeing with the still-visible canvas..."* — same collision, but nothing is delivered back to the client. Asserts the canvas still shows the user's own edit (true — the drop is genuinely silent) then, past `test.fail()`, asserts the agent's canonical `projection()` read agrees with it (false: it's the agent's `SaveImage`, not the user's node). - `src/lib/litegraph/src/idAllocation.property.test.ts` — a `fast-check` property test (the "other test type"; chosen because it's the most direct level below the Playwright/CRDT plumbing where the actual gap lives — see "Why this test type" below). One property pins the pre-fix gap (two independently-minted counters sharing the same last-observed baseline always collide); four more assert `'crdt-disjoint'` allocator properties — never landing on a simulated agent-style mint, single or batched (imported against the production `AGENT_RESERVED_BIT` constant rather than a re-spelled literal), every mint's bit-40-clear/bit-41-set/safe-integer shape, and no repeats across a run of local mints. - `src/workbench/extensions/agent/crdt/agentNodeMaterializer.ts` — a runtime guard: a remote node id materialized on a CRDT-bound graph carrying **neither** reserved bit reports via `reportError()`, converting a silent premise break (if comfy-cli's `mint_id()` ever stops setting its reserved bit) into a visible signal. It narrows to a numeric integer first: `NodeId` is `string | number` and a bound doc may legally carry a legacy `"named"` node or a `"57:3"` subgraph address, which must materialize normally rather than abort reconciliation. - **Breaking**: the id-mint behavior change described above (small sequential → large random ids on an agent-bound graph) ships to production. No API/schema changes; the only fixture-API addition is `AgentFollowerHostSocket.heldClientOps()`. - **Dependencies**: none new (`fast-check` is already a repo dependency, used elsewhere in `*.property.test.ts` files). The task suggested either an edge-case test directly against `comfy-multi-player`'s applier (that package lives in a separate repo, `Comfy-Org/comfy-multi-player`, not reachable from this repo's own unit suite) or a property/edge-case test on `idAllocation.ts` demonstrating no collision-avoidance. I went with the latter. While investigating I found the mechanism is more specific than "no collision check": `LGraph.add()` **does** call `observeNodeId` for a locally-known id, and `agentNodeMaterializer.ts`'s `materialize()` **does** call `graph.add(node)` (so `observeNodeId` fires) when a remote node is reconciled onto the canvas. The actual gap is the **race window** — `idAllocation.ts` mints synchronously from purely local state, with no reservation or cross-actor check, while the agent's competing mint reaches this graph only asynchronously (network + CRDT sync latency) via that same `observeNodeId` call. The property test pins exactly that: nothing in `idAllocation.ts` can close this window because it has no channel to the other actor's mint at all. **Merge note (2026-09-22):** merged `origin/main` (`c03c900`) in. Two fixture conflicts were resolved in favour of main, which had since landed the same seams this branch added: `humanOpsHost: 'hold'` supersedes the capture seam, `applyWire` supersedes `applyClient`, and `agentWireFrame.ts`'s `parseWireOps` supersedes the client-frame parser this branch had written (upstream deliberately validates only the envelope shape, so a deferred or malformed op still reaches `applyOps` for its real verdict). The lockfile is taken from main unchanged (`@comfyorg/comfy-multi-player` 0.2.1 → 0.3.2); the affected unit suites pass against 0.3.2 (57 files, 1134 passed, 6 expected-fail), and `pnpm typecheck`, `pnpm typecheck:browser` and `pnpm lint` are clean. **Environment note:** this sandbox's pre-installed Chromium (`/opt/pw-browsers/chromium-1194`) is an older revision than what this repo's pinned `@playwright/test` (1.61.1) expects (1228); I pointed `launchOptions.executablePath` at the pre-installed binary for local runs only and reverted that config change before committing (not part of this PR's diff). - **Playwright (`agentNodeIdCollision.spec.ts`), full run against Chromium, headed via the real docked agent panel:** ``` wipes a duplicated node and replaces it with a phantom node when the agent's write is forced onto the same id @cloud @agent -> expected failed leaves the agent's own graph read disagreeing with the still-visible canvas after its write is silently dropped @cloud @agent -> expected failed 2 passed (33.6s) ``` Both are reported `status: "expected", expectedStatus: "failed"` (Playwright's JSON reporter) — i.e. they genuinely fail, for the right reason, every run I made: - Test 1's actual failure: `expect(locator).toHaveValue(...)` — `locator('[data-node-id="72"]').getByLabel('text', { exact: true })` — **element not found** (the duplicate's own widget is gone; the node now renders as a blank Save Image). - Test 2's actual failure: `expect(canonicalNode?.type).toBe('CLIPTextEncode')` — **Received: "SaveImage"**. - Neither failed on a setup/fixture error (confirmed by the structural assertions placed *before* each `test.fail()`, which all passed: the collision genuinely happened, `humanApply.outcomes` was genuinely `"lww-dropped"`). - Screenshots (`testInfo.attach`) confirm this visually: "before" shows the duplicate on top of the seed with its own text; "after" (post-reconcile) shows the seed node unchanged and, directly below it at the collided id, a bare "Save Image" node (disconnected `images` input, `filename_prefix: ComfyUI`) — the duplicate is simply gone. The desync test's screenshot shows the canvas still displaying the user's untouched duplicate while the assertion (past `test.fail()`) proves the doc disagrees. - **Vitest (`idAllocation.property.test.ts` + existing `idAllocation.test.ts` + `LGraph.test.ts` + `AgentPanelRoot.test.ts`):** all green (127 + 227 tests respectively across those files). The property tests pass: the one gap property still demonstrates the pre-fix collision, and the four allocator properties assert the `'crdt-disjoint'` fix holds. - `pnpm typecheck`, `pnpm typecheck:browser`, `eslint`, `oxlint`, `stylelint`, and `oxfmt --check` are all clean on every file this PR touches. I could not run the *existing* `agentConversationFixture`-based specs (e.g. `agentTabSwitchCatchUp.spec.ts`) in this sandbox either, for the same reason: they pass `objectInfo: 'server'`, which requires a live ComfyUI backend behind `DEV_SERVER_COMFYUI_URL` to serve real `/api/object_info` — there is no Python/ComfyUI backend available here. This is a pre-existing environment gap, not a regression from this PR (confirmed by reverting my only non-test-file edit, `playwright.config.ts`'s local `executablePath`, and seeing the exact same pre-existing tests fail to boot for the identical `/api/object_info` reason). My new fixture works around this by providing its own minimal, schema-typed `/api/object_info` mock for just the two node types the repro needs (`CLIPTextEncode`, `SaveImage`), so it does not depend on a live backend at all. I did not attempt a live run against the real backend `comfy-agent` service or the real `comfy-multi-player`-backed doc host — that would require standing up services this environment doesn't have; the repro instead runs the actual `comfy-multi-player` npm package's applier in-process (same package the production doc host runs), which is what the collision-resolution assertions are checked against. - Using `HostDoc.applyWire` for the agent's own (host-side) write as well as for the client's held batch: it is the same production applier either way, but `applyWire`'s doc frames it as the client path, so say if you would rather they stayed separate. - The `forceReconcile()` tab-switch mechanism in the fixture: is a real tab switch still the right way to force a whole-doc reconcile now that PR #17963 patches a still-live node in place for the *incremental* path, or is there a more direct hook worth exposing for future collision tests? - Whether combining symptoms 1+2 into one test (documented rationale in the spec's file doc) matches how you'd want this triaged once a fix lands, versus splitting them. - The cross-repo premise `AGENT_RESERVED_BIT` rests on (comfy-cli's `mint_id()` always setting bit 40) is cited in `idAllocation.ts`'s doc comment with a source permalink, and guarded at runtime in `agentNodeMaterializer.ts` — but is still only checkable by reading comfy-cli, not by this repo's own tests. Before (duplicate visible, own text widget) → After (post-reconcile: duplicate gone, phantom "Save Image" at the same id) → Desync (canvas still shows the untouched duplicate while the doc already disagrees). Attached as Playwright `testInfo.attach` artifacts on the runs above; happy to paste them inline here if useful. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01CYUNXA5xHtJHMoNoaEayq6 --- _Generated by [Claude Code](https://claude.ai/code/session_01CYUNXA5xHtJHMoNoaEayq6)_ --------- Co-authored-by: Claude <noreply@anthropic.com>
|
Important Review skippedIgnore keyword(s) in the title. ⛔ Ignored keywords (2)
Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository: Comfy-Org/ComfyUI_frontend/.coderabbit.yaml Review profile: ASSERTIVE Plan: Advanced Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Comment |
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
🎨 Storybook: ✅ Built — View Storybook🎭 Playwright: ✅ 1938 passed, 0 failed📊 Browser Reports
📦 Bundle Size
⚡ Performance Report
Show regressions
All metrics
Historical variance (last 15 runs)
Trend (last 15 commits on main)
Raw data{
"timestamp": "2026-09-23T04:18:21.989Z",
"gitSha": "40e8bb03b4cddf98ee8ca63bbcf3d739762b1451",
"branch": "backport-18095-to-core-1.54",
"measurements": [
{
"name": "canvas-idle",
"durationMs": 2034.3510000000151,
"styleRecalcs": 9,
"styleRecalcDurationMs": 9.151,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 499.31299999999993,
"heapDeltaBytes": -11158328,
"heapUsedBytes": 59083128,
"domNodes": -279,
"jsHeapTotalBytes": 5234688,
"scriptDurationMs": 8.79,
"eventListeners": -196,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "canvas-idle",
"durationMs": 2045.7810000000336,
"styleRecalcs": 9,
"styleRecalcDurationMs": 7.816,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 495.188,
"heapDeltaBytes": 173356,
"heapUsedBytes": 70309284,
"domNodes": -280,
"jsHeapTotalBytes": 5758976,
"scriptDurationMs": 11.063,
"eventListeners": -164,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.670000000000012,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "canvas-mouse-sweep",
"durationMs": 1837.1480000000133,
"styleRecalcs": 77,
"styleRecalcDurationMs": 30.163999999999998,
"layouts": 14,
"layoutDurationMs": 3.9169999999999994,
"taskDurationMs": 870.784,
"heapDeltaBytes": 13874480,
"heapUsedBytes": 84267188,
"domNodes": -280,
"jsHeapTotalBytes": 5496832,
"scriptDurationMs": 159.97699999999998,
"eventListeners": -164,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "canvas-mouse-sweep",
"durationMs": 1846.5910000000463,
"styleRecalcs": 76,
"styleRecalcDurationMs": 28.704,
"layouts": 14,
"layoutDurationMs": 3.892,
"taskDurationMs": 848.336,
"heapDeltaBytes": 7217368,
"heapUsedBytes": 77634424,
"domNodes": -278,
"jsHeapTotalBytes": 6021120,
"scriptDurationMs": 160.08700000000002,
"eventListeners": -166,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "canvas-zoom-sweep",
"durationMs": 1755.4309999999873,
"styleRecalcs": 32,
"styleRecalcDurationMs": 18.657,
"layouts": 6,
"layoutDurationMs": 1.1309999999999998,
"taskDurationMs": 362.04900000000004,
"heapDeltaBytes": 4375492,
"heapUsedBytes": 74530300,
"domNodes": 77,
"jsHeapTotalBytes": 5505024,
"scriptDurationMs": 10.38,
"eventListeners": 19,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.699999999999818
},
{
"name": "canvas-zoom-sweep",
"durationMs": 1723.0590000000348,
"styleRecalcs": 31,
"styleRecalcDurationMs": 17.691,
"layouts": 6,
"layoutDurationMs": 1.27,
"taskDurationMs": 353.793,
"heapDeltaBytes": 4349316,
"heapUsedBytes": 75373200,
"domNodes": 77,
"jsHeapTotalBytes": 5767168,
"scriptDurationMs": 11.334,
"eventListeners": 19,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "dom-widget-clipping",
"durationMs": 638.3030000000076,
"styleRecalcs": 8,
"styleRecalcDurationMs": 5.004999999999999,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 439.58699999999993,
"heapDeltaBytes": -7540612,
"heapUsedBytes": 63195368,
"domNodes": 12,
"jsHeapTotalBytes": 6029312,
"scriptDurationMs": 162.518,
"eventListeners": 2,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333335,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "dom-widget-clipping",
"durationMs": 629.6310000000176,
"styleRecalcs": 11,
"styleRecalcDurationMs": 7.4990000000000006,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 456.62899999999996,
"heapDeltaBytes": -7900168,
"heapUsedBytes": 63203316,
"domNodes": 18,
"jsHeapTotalBytes": 7077888,
"scriptDurationMs": 164.013,
"eventListeners": 2,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "large-graph-idle",
"durationMs": 2030.4249999999797,
"styleRecalcs": 7,
"styleRecalcDurationMs": 6.173999999999999,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 629.1309999999999,
"heapDeltaBytes": -15900380,
"heapUsedBytes": 86861816,
"domNodes": -264,
"jsHeapTotalBytes": 454656,
"scriptDurationMs": 35.019000000000005,
"eventListeners": -164,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "large-graph-idle",
"durationMs": 2052.5649999999587,
"styleRecalcs": 5,
"styleRecalcDurationMs": 4.670000000000001,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 600.513,
"heapDeltaBytes": -16873008,
"heapUsedBytes": 86185816,
"domNodes": -270,
"jsHeapTotalBytes": -331776,
"scriptDurationMs": 36.774,
"eventListeners": -162,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "large-graph-pan",
"durationMs": 2507.712999999967,
"styleRecalcs": 66,
"styleRecalcDurationMs": 11.404000000000002,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 1809.063,
"heapDeltaBytes": 6166356,
"heapUsedBytes": 82821972,
"domNodes": -248,
"jsHeapTotalBytes": 643072,
"scriptDurationMs": 908.0699999999999,
"eventListeners": -192,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "large-graph-pan",
"durationMs": 2309.470000000033,
"styleRecalcs": 67,
"styleRecalcDurationMs": 12.165,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 1713.972,
"heapDeltaBytes": 13460156,
"heapUsedBytes": 90416500,
"domNodes": -269,
"jsHeapTotalBytes": 1429504,
"scriptDurationMs": 848.4929999999999,
"eventListeners": -162,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "large-graph-zoom",
"durationMs": 3456.041999999968,
"styleRecalcs": 60,
"styleRecalcDurationMs": 9.347999999999999,
"layouts": 60,
"layoutDurationMs": 11.661000000000001,
"taskDurationMs": 1659.9630000000002,
"heapDeltaBytes": 11768780,
"heapUsedBytes": 79793552,
"domNodes": 0,
"jsHeapTotalBytes": 0,
"scriptDurationMs": 756.4159999999999,
"eventListeners": 8,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.80000000000109
},
{
"name": "large-graph-zoom",
"durationMs": 3513.00399999991,
"styleRecalcs": 61,
"styleRecalcDurationMs": 10.225999999999999,
"layouts": 60,
"layoutDurationMs": 11.621999999999998,
"taskDurationMs": 1669.7,
"heapDeltaBytes": 9900212,
"heapUsedBytes": 76765264,
"domNodes": 2,
"jsHeapTotalBytes": 524288,
"scriptDurationMs": 760.1150000000001,
"eventListeners": 8,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "legacy-node-drag",
"durationMs": 3128.836999999976,
"styleRecalcs": 40,
"styleRecalcDurationMs": 4.8149999999999995,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 1963.9009999999998,
"heapDeltaBytes": 25540388,
"heapUsedBytes": 92665716,
"domNodes": 0,
"jsHeapTotalBytes": 942080,
"scriptDurationMs": 1004.1930000000001,
"eventListeners": 188,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333335,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "legacy-node-drag",
"durationMs": 3140.1449999999613,
"styleRecalcs": 40,
"styleRecalcDurationMs": 4.771000000000001,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 1942.749,
"heapDeltaBytes": 22143116,
"heapUsedBytes": 89969232,
"domNodes": 0,
"jsHeapTotalBytes": 417792,
"scriptDurationMs": 975.099,
"eventListeners": 188,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "minimap-idle",
"durationMs": 2048.2039999999984,
"styleRecalcs": 6,
"styleRecalcDurationMs": 6.356999999999998,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 622.117,
"heapDeltaBytes": 5401160,
"heapUsedBytes": 82848504,
"domNodes": -277,
"jsHeapTotalBytes": -1155072,
"scriptDurationMs": 34.969,
"eventListeners": -194,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "minimap-idle",
"durationMs": 2007.6530000000048,
"styleRecalcs": 3,
"styleRecalcDurationMs": 2.3280000000000003,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 554.882,
"heapDeltaBytes": 21854936,
"heapUsedBytes": 88108108,
"domNodes": -271,
"jsHeapTotalBytes": 0,
"scriptDurationMs": 33.495999999999995,
"eventListeners": -164,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333335,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "subgraph-dom-widget-clipping",
"durationMs": 576.2520000000109,
"styleRecalcs": 47,
"styleRecalcDurationMs": 10.707,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 401.91299999999995,
"heapDeltaBytes": 15046288,
"heapUsedBytes": 87870940,
"domNodes": 20,
"jsHeapTotalBytes": 6029312,
"scriptDurationMs": 139.305,
"eventListeners": 8,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "subgraph-dom-widget-clipping",
"durationMs": 592.9670000000442,
"styleRecalcs": 47,
"styleRecalcDurationMs": 11.167,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 424.42600000000004,
"heapDeltaBytes": 14269052,
"heapUsedBytes": 86279676,
"domNodes": 20,
"jsHeapTotalBytes": 5767168,
"scriptDurationMs": 142.339,
"eventListeners": 6,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "subgraph-idle",
"durationMs": 2022.5360000000023,
"styleRecalcs": 9,
"styleRecalcDurationMs": 8.189,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 479.778,
"heapDeltaBytes": 6179388,
"heapUsedBytes": 78186168,
"domNodes": -296,
"jsHeapTotalBytes": 5758976,
"scriptDurationMs": 8.048000000000004,
"eventListeners": -210,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.670000000000012,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "subgraph-idle",
"durationMs": 2006.7280000000096,
"styleRecalcs": 11,
"styleRecalcDurationMs": 10.101999999999999,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 484.996,
"heapDeltaBytes": -14120816,
"heapUsedBytes": 58562316,
"domNodes": -294,
"jsHeapTotalBytes": 4710400,
"scriptDurationMs": 8.086,
"eventListeners": -210,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "subgraph-mouse-sweep",
"durationMs": 1724.108000000001,
"styleRecalcs": 77,
"styleRecalcDurationMs": 26.938000000000002,
"layouts": 18,
"layoutDurationMs": 5.1450000000000005,
"taskDurationMs": 816.619,
"heapDeltaBytes": -6861804,
"heapUsedBytes": 66450824,
"domNodes": -295,
"jsHeapTotalBytes": 6807552,
"scriptDurationMs": 111.328,
"eventListeners": -242,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "subgraph-mouse-sweep",
"durationMs": 1772.5030000000288,
"styleRecalcs": 80,
"styleRecalcDurationMs": 30.503000000000004,
"layouts": 18,
"layoutDurationMs": 4.841,
"taskDurationMs": 839.41,
"heapDeltaBytes": -8747400,
"heapUsedBytes": 63629132,
"domNodes": -293,
"jsHeapTotalBytes": 6283264,
"scriptDurationMs": 112.365,
"eventListeners": -240,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "subgraph-transition-enter",
"durationMs": 1401.157000000012,
"styleRecalcs": 19,
"styleRecalcDurationMs": 31.965000000000007,
"layouts": 15,
"layoutDurationMs": 15.409000000000002,
"taskDurationMs": 911.272,
"heapDeltaBytes": 21966292,
"heapUsedBytes": 106137704,
"domNodes": 13751,
"jsHeapTotalBytes": 10485760,
"scriptDurationMs": 30.391000000000002,
"eventListeners": 2385,
"totalBlockingTimeMs": 143,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "viewport-pan-sweep",
"durationMs": 8687.025000000005,
"styleRecalcs": 248,
"styleRecalcDurationMs": 35.452,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 6003.875,
"heapDeltaBytes": -4385440,
"heapUsedBytes": 71919600,
"domNodes": -282,
"jsHeapTotalBytes": 4349952,
"scriptDurationMs": 2810.545,
"eventListeners": -176,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "viewport-pan-sweep",
"durationMs": 8507.447999999953,
"styleRecalcs": 248,
"styleRecalcDurationMs": 35.43599999999999,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 5898.517,
"heapDeltaBytes": 10366428,
"heapUsedBytes": 86324964,
"domNodes": -241,
"jsHeapTotalBytes": 1167360,
"scriptDurationMs": 2705.958,
"eventListeners": -178,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "vue-large-graph-idle",
"durationMs": 16876.952999999958,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 16464.679,
"heapDeltaBytes": -58477464,
"heapUsedBytes": 178879844,
"domNodes": -8068,
"jsHeapTotalBytes": -18526208,
"scriptDurationMs": 271.721,
"eventListeners": -14933,
"totalBlockingTimeMs": 0,
"frameDurationMs": 17.776666666666763,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "vue-large-graph-idle",
"durationMs": 16807.57600000004,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 16366.287,
"heapDeltaBytes": -39621176,
"heapUsedBytes": 178249888,
"domNodes": -8068,
"jsHeapTotalBytes": -8925184,
"scriptDurationMs": 272.134,
"eventListeners": -14933,
"totalBlockingTimeMs": 0,
"frameDurationMs": 17.780000000000047,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "vue-large-graph-pan",
"durationMs": 20865.053999999986,
"styleRecalcs": 174,
"styleRecalcDurationMs": 17.42100000000002,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 20408.434,
"heapDeltaBytes": -25278860,
"heapUsedBytes": 192665180,
"domNodes": -8068,
"jsHeapTotalBytes": -9519104,
"scriptDurationMs": 913.406,
"eventListeners": -14929,
"totalBlockingTimeMs": 39,
"frameDurationMs": 17.776666666666642,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "vue-large-graph-pan",
"durationMs": 20551.61899999996,
"styleRecalcs": 174,
"styleRecalcDurationMs": 17.164999999999985,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 20222.791,
"heapDeltaBytes": -51951544,
"heapUsedBytes": 165098504,
"domNodes": -8068,
"jsHeapTotalBytes": -10481664,
"scriptDurationMs": 944.9100000000001,
"eventListeners": -14929,
"totalBlockingTimeMs": 8,
"frameDurationMs": 17.776666666666642,
"p95FrameDurationMs": 16.80000000000291
},
{
"name": "vue-node-resize-workload",
"durationMs": 6111.084000000005,
"styleRecalcs": 20,
"styleRecalcDurationMs": 79.237,
"layouts": 20,
"layoutDurationMs": 21.350999999999996,
"taskDurationMs": 5970.333999999999,
"heapDeltaBytes": -37857328,
"heapUsedBytes": 179405384,
"domNodes": -8068,
"jsHeapTotalBytes": 14721024,
"scriptDurationMs": 108.348,
"eventListeners": -14929,
"totalBlockingTimeMs": 406,
"frameDurationMs": 17.77333333333336,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "vue-node-resize-workload",
"durationMs": 6112.7760000000535,
"styleRecalcs": 20,
"styleRecalcDurationMs": 81.451,
"layouts": 20,
"layoutDurationMs": 23.146999999999988,
"taskDurationMs": 6010.576,
"heapDeltaBytes": -36401992,
"heapUsedBytes": 181862976,
"domNodes": -8068,
"jsHeapTotalBytes": 17604608,
"scriptDurationMs": 107.66099999999999,
"eventListeners": -14929,
"totalBlockingTimeMs": 392,
"frameDurationMs": 17.776666666666642,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "vue-zoom-out-idle",
"durationMs": 8677.251000000013,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 8382.019000000002,
"heapDeltaBytes": 8310648,
"heapUsedBytes": 176585952,
"domNodes": 0,
"jsHeapTotalBytes": -28835840,
"scriptDurationMs": 156.10000000000002,
"eventListeners": -14,
"totalBlockingTimeMs": 0,
"frameDurationMs": 17.776666666666642,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "vue-zoom-out-idle",
"durationMs": 8819.121999999992,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 8444.848000000002,
"heapDeltaBytes": 8026252,
"heapUsedBytes": 179110560,
"domNodes": 0,
"jsHeapTotalBytes": -12058624,
"scriptDurationMs": 146.53000000000006,
"eventListeners": -10,
"totalBlockingTimeMs": 0,
"frameDurationMs": 17.779999999999927,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "workflow-execution",
"durationMs": 485.48099999999295,
"styleRecalcs": 22,
"styleRecalcDurationMs": 27.438999999999997,
"layouts": 5,
"layoutDurationMs": 2.342,
"taskDurationMs": 135.841,
"heapDeltaBytes": 5157816,
"heapUsedBytes": 73080268,
"domNodes": 151,
"jsHeapTotalBytes": 524288,
"scriptDurationMs": 15.267000000000001,
"eventListeners": 67,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.699999999999818
},
{
"name": "workflow-execution",
"durationMs": 462.36899999996695,
"styleRecalcs": 18,
"styleRecalcDurationMs": 16.639999999999997,
"layouts": 2,
"layoutDurationMs": 0.9420000000000002,
"taskDurationMs": 96.79300000000002,
"heapDeltaBytes": 4896828,
"heapUsedBytes": 73186264,
"domNodes": 142,
"jsHeapTotalBytes": 262144,
"scriptDurationMs": 8.841999999999999,
"eventListeners": 67,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
}
]
}🔬 E2E CoverageNote Shard completeness could not be verified for this run, so these totals may not be comparable with a whole merge.
Top 10 files by uncovered lines
|
Codecov Report❌ Patch coverage is
@@ Coverage Diff @@
## core/1.54 #18524 +/- ##
=============================================
- Coverage 83.58% 83.58% -0.01%
=============================================
Files 2096 2097 +1
Lines 123796 123822 +26
Branches 31538 31544 +6
=============================================
+ Hits 103481 103497 +16
- Misses 20136 20146 +10
Partials 179 179
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 10 files with indirect coverage changes 🚀 New features to boost your workflow:
|
…d graphs to prevent agent/frontend id collision (#18095) (#18529) <!-- ccr-slack-attribution --> _Requested by **Christian Byrne** · [Slack thread](https://comfy-organization.slack.com/archives/C0BGH348Z0C/p1789589396272619?thread_ts=1789589396.272619&cid=C0BGH348Z0C)_ Manual backport of #18095 to `cloud/1.54`. The automated backport failed with merge conflicts (see the bot comment on #18095); this PR resolves them by hand per the bot's instructions. Same conflict shape (and same resolution) as the sibling backport to `core/1.54` (#18524). ## Conflicts and how they were resolved - `browser_tests/fixtures/agentFollowerHostSocket.ts`, `browser_tests/fixtures/agentCrdtIdCollisionFixture.ts`, `browser_tests/tests/agent/agentNodeIdCollision.spec.ts` — **dropped**. The new E2E harness in #18095 depends on `agentFollowerHostSocket.ts`, which doesn't exist on `cloud/1.54` (it was added by a still-unbackported PR, #18164). These specs only pin a still-open, unrelated LWW-drop bug via `test.fail()` — they don't exercise the actual fix in this PR — so dropping them does not reduce coverage of the id-mint fix itself (that's covered by the backported unit tests in `idAllocation.property.test.ts` and `idAllocation.test.ts`). - `src/workbench/extensions/agent/crdt/agentNodeMaterializer.ts` / `.test.ts` — content conflicts. `cloud/1.54`'s copy of this file predates several main-only reportError() call sites (`reportNodeIdWriteDropped`, `sanitizeClassNameForTelemetry`, the "node id write-drop guard" test block) that belong to a **different, still-unbackported PR**, not #18095. Verified against the real diff (`git diff <18095-parent> <18095-merge-commit> -- <file>`) and kept only #18095's actual changes: the new `reportReservedBitViolation` guard, its call site, and its "reserved-bit mint-convention guard" tests. The `AGENT_ECS_TAGS` telemetry-tags constant that guard uses is likewise only defined on main by that other PR; it's duplicated locally in this file with a comment explaining why, since only #18095's own two call sites need it here. - `src/workbench/extensions/agent/AgentPanelRoot.test.ts` — trivial import-conflict; kept the existing `useTeamWorkspaceStore` import already present later in the file (no duplicate import) and added the new `LGraph` type import. ## Verification - `pnpm typecheck` — clean. - `pnpm exec eslint` on all touched files — 0 errors (pre-existing `import-x/no-restricted-paths` warnings only, unrelated to this change). - `pnpm exec vitest run` on `agentNodeMaterializer.test.ts`, `AgentPanelRoot.test.ts`, `idAllocation.test.ts`, `idAllocation.property.test.ts`, `LGraph.test.ts`, `mintPortWiring.test.ts`: all pass except 3 pre-existing failures in `AgentPanelRoot.test.ts` (media-card attach/upload tests failing on `TypeError: object.stream is not a function`), confirmed to fail identically on `origin/cloud/1.54` **before** this cherry-pick (this sandbox runs Node 22; the repo pins Node ≥25, which is presumably where that Blob polyfill gap doesn't occur) — unrelated to this change. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01CYUNXA5xHtJHMoNoaEayq6 --- _Generated by [Claude Code](https://claude.ai/code/session_01CYUNXA5xHtJHMoNoaEayq6)_ Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com> Co-authored-by: Claude <noreply@anthropic.com>
Requested by Christian Byrne · Slack thread
Manual backport of #18095 to
core/1.54. The automated backport failed with merge conflicts (see the bot comment on #18095); this PR resolves them by hand per the bot's instructions.Conflicts and how they were resolved
browser_tests/fixtures/agentFollowerHostSocket.ts,browser_tests/fixtures/agentCrdtIdCollisionFixture.ts,browser_tests/tests/agent/agentNodeIdCollision.spec.ts— dropped. The new E2E harness in fix: mint disjoint-range node ids for CRDT-bound graphs to prevent agent/frontend id collision #18095 depends onagentFollowerHostSocket.ts, which doesn't exist oncore/1.54(it was added by a still-unbackported PR, test(agent): pin PM-827 subgraph instance title and promoted widgets across a reconcile #18164). These specs only pin a still-open, unrelated LWW-drop bug viatest.fail()— they don't exercise the actual fix in this PR — so dropping them does not reduce coverage of the id-mint fix itself (that's covered by the backported unit tests inidAllocation.property.test.tsandidAllocation.test.ts).src/workbench/extensions/agent/crdt/agentNodeMaterializer.ts/.test.ts— content conflicts.core/1.54's copy of this file predates several main-only reportError() call sites (reportNodeIdWriteDropped,sanitizeClassNameForTelemetry, the "node id write-drop guard" test block) that belong to a different, still-unbackported PR, not fix: mint disjoint-range node ids for CRDT-bound graphs to prevent agent/frontend id collision #18095. Verified against the real diff (git diff <18095-parent> <18095-merge-commit> -- <file>) and kept only fix: mint disjoint-range node ids for CRDT-bound graphs to prevent agent/frontend id collision #18095's actual changes: the newreportReservedBitViolationguard, its call site, and its "reserved-bit mint-convention guard" tests. TheAGENT_ECS_TAGStelemetry-tags constant that guard uses is likewise only defined on main by that other PR; it's duplicated locally in this file with a comment explaining why, since only fix: mint disjoint-range node ids for CRDT-bound graphs to prevent agent/frontend id collision #18095's own two call sites need it here.src/workbench/extensions/agent/AgentPanelRoot.test.ts— trivial import-conflict; kept the existinguseTeamWorkspaceStoreimport already present later in the file (no duplicate import) and added the newLGraphtype import.Verification
pnpm typecheck— clean.pnpm exec eslinton all touched files — 0 errors (pre-existingimport-x/no-restricted-pathswarnings only, unrelated to this change).pnpm exec vitest runonagentNodeMaterializer.test.ts,AgentPanelRoot.test.ts,idAllocation.test.ts,idAllocation.property.test.ts,LGraph.test.ts,mintPortWiring.test.ts: all pass except 3 pre-existing failures inAgentPanelRoot.test.ts(media-card attach/upload tests failing onTypeError: object.stream is not a function), confirmed to fail identically onorigin/core/1.54before this cherry-pick (this sandbox runs Node 22; the repo pins Node ≥25, which is presumably where that Blob polyfill gap doesn't occur) — unrelated to this change.🤖 Generated with Claude Code
https://claude.ai/code/session_01CYUNXA5xHtJHMoNoaEayq6
Generated by Claude Code