Repository navigation
[backport cloud/1.54] fix: mint disjoint-range node ids for CRDT-bound graphs to prevent agent/frontend id collision (#18095) - #18529
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
|
🎭 Playwright: ✅ 1935 passed, 0 failed · 1 flaky📊 Browser Reports
🎨 Storybook: ✅ Built — View Storybook📦 Bundle Size
⚡ Performance Report
Absolute values
Raw data{
"timestamp": "2026-09-23T04:32:20.037Z",
"gitSha": "5209afafebbc08fa2ec20e32175c91f2722a247b",
"branch": "backport-18095-to-cloud-1.54",
"measurements": [
{
"name": "canvas-idle",
"durationMs": 2038.9540000000466,
"styleRecalcs": 9,
"styleRecalcDurationMs": 8.551,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 529.721,
"heapDeltaBytes": 2699488,
"heapUsedBytes": 73442236,
"domNodes": -280,
"jsHeapTotalBytes": 5234688,
"scriptDurationMs": 8.544999999999996,
"eventListeners": -164,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.699999999999818
},
{
"name": "canvas-idle",
"durationMs": 2055.2359999999226,
"styleRecalcs": 9,
"styleRecalcDurationMs": 9.157,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 517.358,
"heapDeltaBytes": -11881472,
"heapUsedBytes": 58003668,
"domNodes": -279,
"jsHeapTotalBytes": 4186112,
"scriptDurationMs": 9.751,
"eventListeners": -196,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333335,
"p95FrameDurationMs": 16.699999999999818
},
{
"name": "canvas-mouse-sweep",
"durationMs": 1999.601000000041,
"styleRecalcs": 78,
"styleRecalcDurationMs": 35.57000000000001,
"layouts": 14,
"layoutDurationMs": 4.597,
"taskDurationMs": 958.8610000000001,
"heapDeltaBytes": 11600556,
"heapUsedBytes": 82357340,
"domNodes": -281,
"jsHeapTotalBytes": 6021120,
"scriptDurationMs": 186.81300000000002,
"eventListeners": -166,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "canvas-mouse-sweep",
"durationMs": 1833.385999999905,
"styleRecalcs": 76,
"styleRecalcDurationMs": 29.781000000000002,
"layouts": 14,
"layoutDurationMs": 4.173,
"taskDurationMs": 894.8779999999999,
"heapDeltaBytes": -4960980,
"heapUsedBytes": 64997228,
"domNodes": -280,
"jsHeapTotalBytes": 5234688,
"scriptDurationMs": 162.50900000000001,
"eventListeners": -196,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.699999999999818
},
{
"name": "canvas-zoom-sweep",
"durationMs": 1734.7430000000372,
"styleRecalcs": 31,
"styleRecalcDurationMs": 17.418,
"layouts": 6,
"layoutDurationMs": 1.177,
"taskDurationMs": 366.38,
"heapDeltaBytes": 4350272,
"heapUsedBytes": 74162464,
"domNodes": 75,
"jsHeapTotalBytes": 4980736,
"scriptDurationMs": 12.975999999999997,
"eventListeners": 19,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.699999999999818
},
{
"name": "canvas-zoom-sweep",
"durationMs": 1722.6899999999432,
"styleRecalcs": 31,
"styleRecalcDurationMs": 17.305,
"layouts": 6,
"layoutDurationMs": 0.995,
"taskDurationMs": 369.7819999999999,
"heapDeltaBytes": 4239132,
"heapUsedBytes": 74326584,
"domNodes": 76,
"jsHeapTotalBytes": 5242880,
"scriptDurationMs": 11.753999999999998,
"eventListeners": 19,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "dom-widget-clipping",
"durationMs": 708.5619999999722,
"styleRecalcs": 10,
"styleRecalcDurationMs": 7.639000000000002,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 481.186,
"heapDeltaBytes": 18093916,
"heapUsedBytes": 82997000,
"domNodes": 16,
"jsHeapTotalBytes": 5242880,
"scriptDurationMs": 179.10399999999998,
"eventListeners": 2,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "dom-widget-clipping",
"durationMs": 655.6739999999763,
"styleRecalcs": 9,
"styleRecalcDurationMs": 6.699,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 451.59700000000004,
"heapDeltaBytes": 18115384,
"heapUsedBytes": 88047484,
"domNodes": 14,
"jsHeapTotalBytes": 5505024,
"scriptDurationMs": 166.03199999999998,
"eventListeners": 2,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.699999999999818
},
{
"name": "large-graph-idle",
"durationMs": 2070.9130000000187,
"styleRecalcs": 6,
"styleRecalcDurationMs": 6.359999999999998,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 660.1060000000001,
"heapDeltaBytes": 4447492,
"heapUsedBytes": 80972688,
"domNodes": -283,
"jsHeapTotalBytes": -1679360,
"scriptDurationMs": 34.57600000000001,
"eventListeners": -192,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "large-graph-idle",
"durationMs": 2059.91599999993,
"styleRecalcs": 6,
"styleRecalcDurationMs": 5.7570000000000014,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 638.711,
"heapDeltaBytes": 11549608,
"heapUsedBytes": 87155232,
"domNodes": -268,
"jsHeapTotalBytes": -1679360,
"scriptDurationMs": 37.59700000000001,
"eventListeners": -192,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333335,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "large-graph-pan",
"durationMs": 2199.0619999999694,
"styleRecalcs": 62,
"styleRecalcDurationMs": 7.872000000000004,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 1618.4500000000003,
"heapDeltaBytes": 22276288,
"heapUsedBytes": 88725460,
"domNodes": 0,
"jsHeapTotalBytes": 225280,
"scriptDurationMs": 835.5140000000001,
"eventListeners": 6,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "large-graph-pan",
"durationMs": 2326.008999999999,
"styleRecalcs": 68,
"styleRecalcDurationMs": 13.370999999999997,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 1706.0040000000001,
"heapDeltaBytes": -9239652,
"heapUsedBytes": 68259364,
"domNodes": -284,
"jsHeapTotalBytes": 155648,
"scriptDurationMs": 842.36,
"eventListeners": -192,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66999999999998,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "large-graph-zoom",
"durationMs": 3650.9189999999876,
"styleRecalcs": 62,
"styleRecalcDurationMs": 12.576000000000004,
"layouts": 60,
"layoutDurationMs": 11.597000000000001,
"taskDurationMs": 1783.791,
"heapDeltaBytes": -2675832,
"heapUsedBytes": 75913832,
"domNodes": -284,
"jsHeapTotalBytes": -1417216,
"scriptDurationMs": 801.428,
"eventListeners": -188,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.670000000000012,
"p95FrameDurationMs": 16.80000000000109
},
{
"name": "large-graph-zoom",
"durationMs": 3631.7289999999502,
"styleRecalcs": 62,
"styleRecalcDurationMs": 11.998999999999999,
"layouts": 60,
"layoutDurationMs": 11.911999999999999,
"taskDurationMs": 1774.924,
"heapDeltaBytes": -2966388,
"heapUsedBytes": 75949640,
"domNodes": -287,
"jsHeapTotalBytes": -2203648,
"scriptDurationMs": 785.95,
"eventListeners": -188,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "legacy-node-drag",
"durationMs": 3132.121999999981,
"styleRecalcs": 40,
"styleRecalcDurationMs": 4.945999999999999,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 1953.999,
"heapDeltaBytes": 26706820,
"heapUsedBytes": 94633220,
"domNodes": -280,
"jsHeapTotalBytes": 417792,
"scriptDurationMs": 978.6899999999999,
"eventListeners": 188,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666696,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "legacy-node-drag",
"durationMs": 3143.948999999907,
"styleRecalcs": 40,
"styleRecalcDurationMs": 4.399,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 1936.2410000000002,
"heapDeltaBytes": 21875664,
"heapUsedBytes": 89689400,
"domNodes": 0,
"jsHeapTotalBytes": 942080,
"scriptDurationMs": 969.5459999999999,
"eventListeners": 188,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "minimap-idle",
"durationMs": 2024.8250000000212,
"styleRecalcs": 6,
"styleRecalcDurationMs": 5.850999999999998,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 585.6999999999999,
"heapDeltaBytes": 9166556,
"heapUsedBytes": 87031692,
"domNodes": -269,
"jsHeapTotalBytes": -1941504,
"scriptDurationMs": 33.915,
"eventListeners": -192,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "minimap-idle",
"durationMs": 2022.3740000000134,
"styleRecalcs": 1,
"styleRecalcDurationMs": 0.8879999999999999,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 565.9630000000001,
"heapDeltaBytes": 22093324,
"heapUsedBytes": 88499864,
"domNodes": 2,
"jsHeapTotalBytes": 0,
"scriptDurationMs": 35.68000000000001,
"eventListeners": 6,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "subgraph-dom-widget-clipping",
"durationMs": 607.8519999999799,
"styleRecalcs": 47,
"styleRecalcDurationMs": 12.07,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 434.859,
"heapDeltaBytes": 15070628,
"heapUsedBytes": 88148348,
"domNodes": 20,
"jsHeapTotalBytes": 6029312,
"scriptDurationMs": 150.457,
"eventListeners": 8,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "subgraph-dom-widget-clipping",
"durationMs": 598.1590000000097,
"styleRecalcs": 46,
"styleRecalcDurationMs": 10.408,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 406.455,
"heapDeltaBytes": 15014200,
"heapUsedBytes": 87885692,
"domNodes": 18,
"jsHeapTotalBytes": 5505024,
"scriptDurationMs": 143.68399999999997,
"eventListeners": 6,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "subgraph-idle",
"durationMs": 2012.5050000000329,
"styleRecalcs": 10,
"styleRecalcDurationMs": 8.755999999999998,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 526.161,
"heapDeltaBytes": -9336408,
"heapUsedBytes": 62654312,
"domNodes": -295,
"jsHeapTotalBytes": 6021120,
"scriptDurationMs": 8.572999999999997,
"eventListeners": -240,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.699999999999818
},
{
"name": "subgraph-idle",
"durationMs": 2022.3199999999224,
"styleRecalcs": 10,
"styleRecalcDurationMs": 8.79,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 494.7130000000001,
"heapDeltaBytes": -7859484,
"heapUsedBytes": 64472628,
"domNodes": -293,
"jsHeapTotalBytes": 5496832,
"scriptDurationMs": 7.927,
"eventListeners": -240,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333335,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "subgraph-mouse-sweep",
"durationMs": 1739.875999999981,
"styleRecalcs": 77,
"styleRecalcDurationMs": 26.852,
"layouts": 18,
"layoutDurationMs": 4.972,
"taskDurationMs": 822.9159999999999,
"heapDeltaBytes": -5847568,
"heapUsedBytes": 67227648,
"domNodes": -296,
"jsHeapTotalBytes": 6807552,
"scriptDurationMs": 111.615,
"eventListeners": -242,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.670000000000012,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "subgraph-mouse-sweep",
"durationMs": 1715.69599999998,
"styleRecalcs": 77,
"styleRecalcDurationMs": 26.948999999999998,
"layouts": 18,
"layoutDurationMs": 4.421,
"taskDurationMs": 822.164,
"heapDeltaBytes": -141512,
"heapUsedBytes": 73058596,
"domNodes": -296,
"jsHeapTotalBytes": 6021120,
"scriptDurationMs": 108.83400000000002,
"eventListeners": -212,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "subgraph-transition-enter",
"durationMs": 1401.0820000000876,
"styleRecalcs": 18,
"styleRecalcDurationMs": 32.61599999999999,
"layouts": 14,
"layoutDurationMs": 15.757999999999997,
"taskDurationMs": 952.953,
"heapDeltaBytes": 20093116,
"heapUsedBytes": 104107408,
"domNodes": 13751,
"jsHeapTotalBytes": 10747904,
"scriptDurationMs": 30.82700000000001,
"eventListeners": 2385,
"totalBlockingTimeMs": 144,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "viewport-pan-sweep",
"durationMs": 8424.967999999979,
"styleRecalcs": 247,
"styleRecalcDurationMs": 34.463,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 5918.409,
"heapDeltaBytes": 14026568,
"heapUsedBytes": 89570476,
"domNodes": -271,
"jsHeapTotalBytes": -405504,
"scriptDurationMs": 2736.9150000000004,
"eventListeners": -178,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.670000000000012,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "viewport-pan-sweep",
"durationMs": 8615.363000000001,
"styleRecalcs": 248,
"styleRecalcDurationMs": 36.64000000000001,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 5967.099,
"heapDeltaBytes": 5423532,
"heapUsedBytes": 81128516,
"domNodes": -268,
"jsHeapTotalBytes": 380928,
"scriptDurationMs": 2754.2439999999997,
"eventListeners": -176,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "vue-large-graph-idle",
"durationMs": 17399.711000000025,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 16769.206000000002,
"heapDeltaBytes": -38506400,
"heapUsedBytes": 178487004,
"domNodes": -8068,
"jsHeapTotalBytes": -12070912,
"scriptDurationMs": 313.67699999999996,
"eventListeners": -14931,
"totalBlockingTimeMs": 0,
"frameDurationMs": 17.776666666666642,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "vue-large-graph-idle",
"durationMs": 17273.41000000001,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 16797.777,
"heapDeltaBytes": -59515924,
"heapUsedBytes": 178130664,
"domNodes": -8068,
"jsHeapTotalBytes": -19689472,
"scriptDurationMs": 277.604,
"eventListeners": -14931,
"totalBlockingTimeMs": 0,
"frameDurationMs": 17.779999999999927,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "vue-large-graph-pan",
"durationMs": 20975.374999999985,
"styleRecalcs": 165,
"styleRecalcDurationMs": 18.801000000000013,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 20705.087,
"heapDeltaBytes": -51463924,
"heapUsedBytes": 169238800,
"domNodes": -8068,
"jsHeapTotalBytes": -10428416,
"scriptDurationMs": 928.4709999999999,
"eventListeners": -14927,
"totalBlockingTimeMs": 135,
"frameDurationMs": 17.773333333333238,
"p95FrameDurationMs": 16.80000000000291
},
{
"name": "vue-large-graph-pan",
"durationMs": 21303.494,
"styleRecalcs": 169,
"styleRecalcDurationMs": 19.459000000000003,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 20947.844,
"heapDeltaBytes": -62114264,
"heapUsedBytes": 168879828,
"domNodes": -8068,
"jsHeapTotalBytes": -19836928,
"scriptDurationMs": 957.235,
"eventListeners": -14931,
"totalBlockingTimeMs": 197,
"frameDurationMs": 17.776666666666763,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "vue-node-resize-workload",
"durationMs": 6311.666000000003,
"styleRecalcs": 20,
"styleRecalcDurationMs": 80.63100000000001,
"layouts": 20,
"layoutDurationMs": 23.749000000000006,
"taskDurationMs": 6224.706,
"heapDeltaBytes": -43106960,
"heapUsedBytes": 180434720,
"domNodes": -8068,
"jsHeapTotalBytes": 10735616,
"scriptDurationMs": 113.21199999999999,
"eventListeners": -14929,
"totalBlockingTimeMs": 423,
"frameDurationMs": 17.776666666666703,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "vue-node-resize-workload",
"durationMs": 6264.039000000025,
"styleRecalcs": 20,
"styleRecalcDurationMs": 83.092,
"layouts": 20,
"layoutDurationMs": 23.73900000000001,
"taskDurationMs": 6182.281,
"heapDeltaBytes": -37447972,
"heapUsedBytes": 181846956,
"domNodes": -8068,
"jsHeapTotalBytes": 16195584,
"scriptDurationMs": 114.97000000000001,
"eventListeners": -14927,
"totalBlockingTimeMs": 508,
"frameDurationMs": 18.33666666666662,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "vue-zoom-out-idle",
"durationMs": 9058.293000000049,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 8580.8,
"heapDeltaBytes": 19839412,
"heapUsedBytes": 178876468,
"domNodes": 0,
"jsHeapTotalBytes": -11796480,
"scriptDurationMs": 144.63800000000003,
"eventListeners": -12,
"totalBlockingTimeMs": 0,
"frameDurationMs": 17.216666666666665,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "vue-zoom-out-idle",
"durationMs": 8785.418000000049,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 8559.801,
"heapDeltaBytes": 3462492,
"heapUsedBytes": 177859324,
"domNodes": 0,
"jsHeapTotalBytes": -18350080,
"scriptDurationMs": 191.85600000000002,
"eventListeners": -12,
"totalBlockingTimeMs": 6,
"frameDurationMs": 17.779999999999927,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "workflow-execution",
"durationMs": 116.48800000000392,
"styleRecalcs": 8,
"styleRecalcDurationMs": 15.343999999999998,
"layouts": 2,
"layoutDurationMs": 1.377,
"taskDurationMs": 76.22,
"heapDeltaBytes": 3070992,
"heapUsedBytes": 71989220,
"domNodes": 131,
"jsHeapTotalBytes": 262144,
"scriptDurationMs": 6.944999999999999,
"eventListeners": 17,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "workflow-execution",
"durationMs": 507.6179999999795,
"styleRecalcs": 13,
"styleRecalcDurationMs": 18.06,
"layouts": 3,
"layoutDurationMs": 0.8170000000000002,
"taskDurationMs": 103.805,
"heapDeltaBytes": 4760712,
"heapUsedBytes": 73698692,
"domNodes": 117,
"jsHeapTotalBytes": 524288,
"scriptDurationMs": 8.176999999999998,
"eventListeners": 67,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
}
]
} |
Codecov Report❌ Patch coverage is
@@ Coverage Diff @@
## cloud/1.54 #18529 +/- ##
=============================================
Coverage ? 83.63%
=============================================
Files ? 2099
Lines ? 124115
Branches ? 31427
=============================================
Hits ? 103799
Misses ? 20138
Partials ? 178
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
Requested by Christian Byrne · Slack thread
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 tocore/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 fix: mint disjoint-range node ids for CRDT-bound graphs to prevent agent/frontend id collision #18095 depends onagentFollowerHostSocket.ts, which doesn't exist oncloud/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.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 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/cloud/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