Repository navigation
fix: mint disjoint-range node ids for CRDT-bound graphs to prevent agent/frontend id collision - #18095
Conversation
|
Important Review skippedBot user detected. To trigger a single review, invoke 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 |
🎨 Storybook: ✅ Built — View Storybook🎭 Playwright: ✅ 2115 passed, 0 failed · 1 flaky📊 Browser Reports
📦 Bundle: 9.97 MB gzip 🔴 +705 BDetailsSummary
Category Glance App Entry Points — 3.87 kB (baseline 3.87 kB) • ⚪ 0 BMain entry bundles and manifests
Status: 1 added / 1 removed Graph Workspace — 1.44 MB (baseline 1.44 MB) • ⚪ 0 BGraph editor runtime, canvas, workflow orchestration
Status: 2 added / 2 removed / 1 unchanged Views & Navigation — 132 kB (baseline 132 kB) • ⚪ 0 BTop-level views, pages, and routed surfaces
Status: 14 added / 14 removed / 4 unchanged Panels & Settings — 639 kB (baseline 639 kB) • ⚪ 0 BConfiguration panels, inspectors, and settings screens
Status: 10 added / 10 removed / 18 unchanged User & Accounts — 37.9 kB (baseline 37.9 kB) • ⚪ 0 BAuthentication, profile, and account management bundles
Status: 6 added / 6 removed / 5 unchanged Editors & Dialogs — 126 kB (baseline 126 kB) • ⚪ 0 BModals, dialogs, drawers, and in-app editors
Status: 7 added / 7 removed / 1 unchanged UI Components — 124 kB (baseline 124 kB) • ⚪ 0 BReusable component library chunks
Status: 7 added / 7 removed / 9 unchanged Data & Services — 3.92 MB (baseline 3.92 MB) • 🔴 +1.44 kBStores, services, APIs, and repositories
Status: 13 added / 13 removed / 3 unchanged Utilities & Hooks — 577 kB (baseline 577 kB) • ⚪ 0 BHelpers, composables, and utility bundles
Status: 19 added / 19 removed / 19 unchanged Vendor & Third-Party — 17.4 MB (baseline 17.4 MB) • ⚪ 0 BExternal libraries and shared vendor chunks Status: 18 unchanged Other — 17.8 MB (baseline 17.8 MB) • ⚪ 0 BBundles that do not match a named category
Status: 74 added / 74 removed / 228 unchanged ⚡ Performance Report
Show regressions
All metrics
Historical variance (last 15 runs)
Trend (last 15 commits on main)
Raw data{
"timestamp": "2026-09-23T01:37:01.162Z",
"gitSha": "4cc23a6e2fcbc27efa3f276e84a0b541acdb3acf",
"branch": "test/pm-1251-crdt-node-id-race-repro",
"measurements": [
{
"name": "canvas-idle",
"durationMs": 2004.7350000000392,
"styleRecalcs": 13,
"styleRecalcDurationMs": 7.971000000000001,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 294.047,
"heapDeltaBytes": -7222960,
"heapUsedBytes": 60678868,
"domNodes": -255,
"jsHeapTotalBytes": 4710400,
"scriptDurationMs": 7.802,
"eventListeners": -174,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.670000000000012,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "canvas-idle",
"durationMs": 2002.6920000000246,
"styleRecalcs": 13,
"styleRecalcDurationMs": 9.254,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 314.038,
"heapDeltaBytes": -10023352,
"heapUsedBytes": 57727656,
"domNodes": -256,
"jsHeapTotalBytes": 5496832,
"scriptDurationMs": 8.569,
"eventListeners": -174,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "canvas-mouse-sweep",
"durationMs": 1690.3089999999565,
"styleRecalcs": 48,
"styleRecalcDurationMs": 15.369000000000003,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 611.847,
"heapDeltaBytes": -8188788,
"heapUsedBytes": 59608604,
"domNodes": -254,
"jsHeapTotalBytes": 5758976,
"scriptDurationMs": 119.174,
"eventListeners": -174,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333335,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "canvas-mouse-sweep",
"durationMs": 1693.6990000000378,
"styleRecalcs": 47,
"styleRecalcDurationMs": 14.426,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 544.245,
"heapDeltaBytes": 11204584,
"heapUsedBytes": 78668352,
"domNodes": -258,
"jsHeapTotalBytes": 6021120,
"scriptDurationMs": 108.872,
"eventListeners": -152,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.699999999999818
},
{
"name": "canvas-zoom-sweep",
"durationMs": 1688.8500000000022,
"styleRecalcs": 30,
"styleRecalcDurationMs": 10.759,
"layouts": 6,
"layoutDurationMs": 0.985,
"taskDurationMs": 209.93800000000002,
"heapDeltaBytes": 3160428,
"heapUsedBytes": 70707256,
"domNodes": 78,
"jsHeapTotalBytes": 4718592,
"scriptDurationMs": 9.447,
"eventListeners": 15,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "canvas-zoom-sweep",
"durationMs": 1705.9469999999237,
"styleRecalcs": 31,
"styleRecalcDurationMs": 15.322000000000001,
"layouts": 6,
"layoutDurationMs": 1.062,
"taskDurationMs": 223.66699999999997,
"heapDeltaBytes": 2753912,
"heapUsedBytes": 70609164,
"domNodes": 80,
"jsHeapTotalBytes": 4980736,
"scriptDurationMs": 10.53,
"eventListeners": 15,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "dom-widget-clipping",
"durationMs": 509.72600000000057,
"styleRecalcs": 14,
"styleRecalcDurationMs": 8.895999999999999,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 313.712,
"heapDeltaBytes": 18595840,
"heapUsedBytes": 86327060,
"domNodes": 24,
"jsHeapTotalBytes": 5242880,
"scriptDurationMs": 108.435,
"eventListeners": 0,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000273
},
{
"name": "dom-widget-clipping",
"durationMs": 426.2790000000223,
"styleRecalcs": 15,
"styleRecalcDurationMs": 8.629,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 290.776,
"heapDeltaBytes": 18981480,
"heapUsedBytes": 85688256,
"domNodes": 25,
"jsHeapTotalBytes": 5767168,
"scriptDurationMs": 102.42499999999998,
"eventListeners": 0,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.700000000000273
},
{
"name": "dom-widget-order-dense-n200-w200-i120",
"durationMs": 920.7850000000235,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 552.495,
"heapDeltaBytes": -17365120,
"heapUsedBytes": 73034496,
"domNodes": -293,
"jsHeapTotalBytes": 20578304,
"scriptDurationMs": 38.073,
"eventListeners": -217,
"totalBlockingTimeMs": 291,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "dom-widget-order-dense-n200-w200-i120",
"durationMs": 892.037000000073,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 518.9090000000001,
"heapDeltaBytes": -17472072,
"heapUsedBytes": 72673952,
"domNodes": -292,
"jsHeapTotalBytes": 20840448,
"scriptDurationMs": 36.201,
"eventListeners": -217,
"totalBlockingTimeMs": 272,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "dom-widget-order-sparse-n1000-w20-i120",
"durationMs": 686.2340000000131,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 256.4409999999997,
"heapDeltaBytes": 13478424,
"heapUsedBytes": 89971124,
"domNodes": 0,
"jsHeapTotalBytes": 0,
"scriptDurationMs": 86.82999999999998,
"eventListeners": 0,
"totalBlockingTimeMs": 81,
"frameDurationMs": 16.670000000000012,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "dom-widget-order-sparse-n1000-w20-i120",
"durationMs": 671.3170000000446,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 252.11000000000007,
"heapDeltaBytes": 14671948,
"heapUsedBytes": 90794780,
"domNodes": 0,
"jsHeapTotalBytes": 0,
"scriptDurationMs": 86.38499999999999,
"eventListeners": 0,
"totalBlockingTimeMs": 81,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "extension-clean-combined-draw",
"durationMs": 6466.811000000007,
"styleRecalcs": 1,
"styleRecalcDurationMs": 0.1270000000000021,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 5477.473,
"heapDeltaBytes": -5698392,
"heapUsedBytes": 76897792,
"domNodes": -18,
"jsHeapTotalBytes": 3407872,
"scriptDurationMs": 4145.22,
"eventListeners": 0,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "extension-clean-combined-draw",
"durationMs": 5886.330000000044,
"styleRecalcs": 2,
"styleRecalcDurationMs": 1.1019999999999988,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 4662.905000000001,
"heapDeltaBytes": 26114336,
"heapUsedBytes": 99272892,
"domNodes": 4,
"jsHeapTotalBytes": 3407872,
"scriptDurationMs": 3767.039,
"eventListeners": 0,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "extension-rgthree-prototype-draw",
"durationMs": 6502.273999999999,
"styleRecalcs": 2,
"styleRecalcDurationMs": 1.7040000000000006,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 5355.721,
"heapDeltaBytes": 641216,
"heapUsedBytes": 85283124,
"domNodes": -18,
"jsHeapTotalBytes": 6029312,
"scriptDurationMs": 4187.447999999999,
"eventListeners": -4,
"totalBlockingTimeMs": 25,
"frameDurationMs": 17.220000000000013,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "extension-rgthree-prototype-draw",
"durationMs": 6472.637999999961,
"styleRecalcs": 2,
"styleRecalcDurationMs": 1.4120000000000001,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 5239.334,
"heapDeltaBytes": 6682120,
"heapUsedBytes": 82628488,
"domNodes": -270,
"jsHeapTotalBytes": 9953280,
"scriptDurationMs": 4074.052,
"eventListeners": -174,
"totalBlockingTimeMs": 16,
"frameDurationMs": 17.216666666666665,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "large-graph-idle",
"durationMs": 2022.9679999999917,
"styleRecalcs": 11,
"styleRecalcDurationMs": 6.598,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 339.80299999999994,
"heapDeltaBytes": -2308624,
"heapUsedBytes": 83506380,
"domNodes": -231,
"jsHeapTotalBytes": -1019904,
"scriptDurationMs": 25.910000000000004,
"eventListeners": -152,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333335,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "large-graph-idle",
"durationMs": 2011.8219999999383,
"styleRecalcs": 9,
"styleRecalcDurationMs": 6.119,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 398.07,
"heapDeltaBytes": -4792688,
"heapUsedBytes": 83094084,
"domNodes": -238,
"jsHeapTotalBytes": -1282048,
"scriptDurationMs": 28.258000000000006,
"eventListeners": -152,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "large-graph-pan",
"durationMs": 2525.472000000036,
"styleRecalcs": 68,
"styleRecalcDurationMs": 14.033,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 1214.315,
"heapDeltaBytes": 19398388,
"heapUsedBytes": 83749324,
"domNodes": 14,
"jsHeapTotalBytes": 1011712,
"scriptDurationMs": 596.2180000000001,
"eventListeners": 0,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "large-graph-pan",
"durationMs": 2098.5809999999674,
"styleRecalcs": 68,
"styleRecalcDurationMs": 12.671999999999999,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 1054.675,
"heapDeltaBytes": 14505436,
"heapUsedBytes": 79492524,
"domNodes": 14,
"jsHeapTotalBytes": 2322432,
"scriptDurationMs": 551.979,
"eventListeners": 0,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333335,
"p95FrameDurationMs": 16.699999999999818
},
{
"name": "large-graph-zoom",
"durationMs": 3155.399999999986,
"styleRecalcs": 66,
"styleRecalcDurationMs": 15.733999999999998,
"layouts": 60,
"layoutDurationMs": 14.099000000000002,
"taskDurationMs": 1146.0810000000001,
"heapDeltaBytes": -14713608,
"heapUsedBytes": 74193856,
"domNodes": -241,
"jsHeapTotalBytes": -1019904,
"scriptDurationMs": 506.853,
"eventListeners": -174,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333335,
"p95FrameDurationMs": 16.699999999999818
},
{
"name": "large-graph-zoom",
"durationMs": 3168.543999999997,
"styleRecalcs": 65,
"styleRecalcDurationMs": 13.391999999999998,
"layouts": 60,
"layoutDurationMs": 14.472000000000001,
"taskDurationMs": 1152.8449999999998,
"heapDeltaBytes": 8157636,
"heapUsedBytes": 74399268,
"domNodes": 12,
"jsHeapTotalBytes": 262144,
"scriptDurationMs": 516.3050000000001,
"eventListeners": 0,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333335,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "legacy-node-drag",
"durationMs": 2580.935000000011,
"styleRecalcs": 47,
"styleRecalcDurationMs": 10.990999999999998,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 1519.2850000000003,
"heapDeltaBytes": -7531464,
"heapUsedBytes": 83666096,
"domNodes": -219,
"jsHeapTotalBytes": 1495040,
"scriptDurationMs": 727.7690000000001,
"eventListeners": 6,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "legacy-node-drag",
"durationMs": 2506.0999999999467,
"styleRecalcs": 48,
"styleRecalcDurationMs": 10.315999999999999,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 1402.509,
"heapDeltaBytes": -7759624,
"heapUsedBytes": 82760124,
"domNodes": -214,
"jsHeapTotalBytes": 1232896,
"scriptDurationMs": 698.755,
"eventListeners": 6,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "minimap-idle",
"durationMs": 2023.0549999999994,
"styleRecalcs": 10,
"styleRecalcDurationMs": 6.944999999999999,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 365.78499999999997,
"heapDeltaBytes": -5401816,
"heapUsedBytes": 82807800,
"domNodes": -236,
"jsHeapTotalBytes": -757760,
"scriptDurationMs": 26.839999999999996,
"eventListeners": -174,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.670000000000012,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "minimap-idle",
"durationMs": 2004.4430000000375,
"styleRecalcs": 10,
"styleRecalcDurationMs": 6.374,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 351.668,
"heapDeltaBytes": -8850124,
"heapUsedBytes": 79691652,
"domNodes": -240,
"jsHeapTotalBytes": 290816,
"scriptDurationMs": 26.365999999999993,
"eventListeners": -174,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "subgraph-dom-widget-clipping",
"durationMs": 377.72300000000314,
"styleRecalcs": 49,
"styleRecalcDurationMs": 10.671,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 230.56999999999996,
"heapDeltaBytes": 13745976,
"heapUsedBytes": 83431344,
"domNodes": 24,
"jsHeapTotalBytes": 5242880,
"scriptDurationMs": 90.147,
"eventListeners": 6,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000273
},
{
"name": "subgraph-dom-widget-clipping",
"durationMs": 393.5909999999012,
"styleRecalcs": 49,
"styleRecalcDurationMs": 11.031999999999998,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 270.65700000000004,
"heapDeltaBytes": 13428716,
"heapUsedBytes": 83463100,
"domNodes": 24,
"jsHeapTotalBytes": 4718592,
"scriptDurationMs": 96.073,
"eventListeners": 6,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000273
},
{
"name": "subgraph-idle",
"durationMs": 1993.5939999999732,
"styleRecalcs": 11,
"styleRecalcDurationMs": 6.871,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 283.736,
"heapDeltaBytes": -13661732,
"heapUsedBytes": 55989644,
"domNodes": -274,
"jsHeapTotalBytes": 4972544,
"scriptDurationMs": 7.099999999999999,
"eventListeners": -198,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "subgraph-idle",
"durationMs": 1992.2379999999293,
"styleRecalcs": 11,
"styleRecalcDurationMs": 7.2860000000000005,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 317.383,
"heapDeltaBytes": -2648572,
"heapUsedBytes": 60597664,
"domNodes": -275,
"jsHeapTotalBytes": 5234688,
"scriptDurationMs": 8.663000000000002,
"eventListeners": -220,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "subgraph-mouse-sweep",
"durationMs": 1677.7789999999868,
"styleRecalcs": 47,
"styleRecalcDurationMs": 12.479000000000001,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 487.214,
"heapDeltaBytes": -8240168,
"heapUsedBytes": 61859452,
"domNodes": -272,
"jsHeapTotalBytes": 6283264,
"scriptDurationMs": 78.60600000000001,
"eventListeners": -220,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "subgraph-mouse-sweep",
"durationMs": 1692.7830000000768,
"styleRecalcs": 47,
"styleRecalcDurationMs": 15.271,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 577.601,
"heapDeltaBytes": -10635520,
"heapUsedBytes": 59135352,
"domNodes": -273,
"jsHeapTotalBytes": 4972544,
"scriptDurationMs": 89.472,
"eventListeners": -198,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "subgraph-transition-enter",
"durationMs": 783.7410000000773,
"styleRecalcs": 19,
"styleRecalcDurationMs": 19.168999999999997,
"layouts": 5,
"layoutDurationMs": 7.810000000000001,
"taskDurationMs": 528.174,
"heapDeltaBytes": 20176496,
"heapUsedBytes": 103290832,
"domNodes": 13667,
"jsHeapTotalBytes": 10747904,
"scriptDurationMs": 18.971,
"eventListeners": 2383,
"totalBlockingTimeMs": 59,
"frameDurationMs": 16.66999999999998,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "viewport-pan-sweep",
"durationMs": 8204.20299999995,
"styleRecalcs": 250,
"styleRecalcDurationMs": 39.253,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 3668.144,
"heapDeltaBytes": -10397156,
"heapUsedBytes": 76069896,
"domNodes": -234,
"jsHeapTotalBytes": 778240,
"scriptDurationMs": 1805.7709999999997,
"eventListeners": -152,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "viewport-pan-sweep",
"durationMs": 8231.429999999931,
"styleRecalcs": 251,
"styleRecalcDurationMs": 42.812999999999995,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 4001.583,
"heapDeltaBytes": -6415896,
"heapUsedBytes": 80130524,
"domNodes": -232,
"jsHeapTotalBytes": -532480,
"scriptDurationMs": 1893.135,
"eventListeners": -152,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "vue-large-graph-idle",
"durationMs": 11490.943000000016,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 10829.065,
"heapDeltaBytes": -50535636,
"heapUsedBytes": 179578460,
"domNodes": -8062,
"jsHeapTotalBytes": -16171008,
"scriptDurationMs": 143.69600000000003,
"eventListeners": -14928,
"totalBlockingTimeMs": 0,
"frameDurationMs": 17.220000000000073,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "vue-large-graph-idle",
"durationMs": 12190.448999999944,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 11645.373,
"heapDeltaBytes": -38275940,
"heapUsedBytes": 184090496,
"domNodes": -8062,
"jsHeapTotalBytes": -14999552,
"scriptDurationMs": 165.459,
"eventListeners": -14928,
"totalBlockingTimeMs": 0,
"frameDurationMs": 17.223333333333358,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "vue-large-graph-pan",
"durationMs": 13594.876,
"styleRecalcs": 67,
"styleRecalcDurationMs": 12.399999999999995,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 13167.332999999999,
"heapDeltaBytes": -57793704,
"heapUsedBytes": 168658400,
"domNodes": -8062,
"jsHeapTotalBytes": -21504000,
"scriptDurationMs": 562.7080000000001,
"eventListeners": -14928,
"totalBlockingTimeMs": 0,
"frameDurationMs": 17.220000000000073,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "vue-large-graph-pan",
"durationMs": 13600.509999999986,
"styleRecalcs": 70,
"styleRecalcDurationMs": 13.019000000000002,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 13348.228,
"heapDeltaBytes": -64415516,
"heapUsedBytes": 175735452,
"domNodes": -8062,
"jsHeapTotalBytes": -12419072,
"scriptDurationMs": 627.359,
"eventListeners": -14928,
"totalBlockingTimeMs": 101,
"frameDurationMs": 17.223333333333237,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "vue-node-resize-workload",
"durationMs": 3897.738000000004,
"styleRecalcs": 20,
"styleRecalcDurationMs": 49.43300000000001,
"layouts": 20,
"layoutDurationMs": 19.433000000000007,
"taskDurationMs": 3818.2970000000005,
"heapDeltaBytes": -43999428,
"heapUsedBytes": 179072120,
"domNodes": -8061,
"jsHeapTotalBytes": 21553152,
"scriptDurationMs": 58.596999999999994,
"eventListeners": -14928,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "vue-node-resize-workload",
"durationMs": 3324.434999999994,
"styleRecalcs": 20,
"styleRecalcDurationMs": 50.704,
"layouts": 20,
"layoutDurationMs": 21.142,
"taskDurationMs": 3268.014,
"heapDeltaBytes": -21815360,
"heapUsedBytes": 193489896,
"domNodes": -8062,
"jsHeapTotalBytes": 23535616,
"scriptDurationMs": 54.42600000000001,
"eventListeners": -14928,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.669999999999952,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "vue-zoom-out-idle",
"durationMs": 5802.719999999908,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 5563.795000000001,
"heapDeltaBytes": -12987208,
"heapUsedBytes": 165953140,
"domNodes": 0,
"jsHeapTotalBytes": -14942208,
"scriptDurationMs": 101.65200000000002,
"eventListeners": 0,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "vue-zoom-out-idle",
"durationMs": 5954.590000000053,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 5543.7609999999995,
"heapDeltaBytes": 9666572,
"heapUsedBytes": 188259664,
"domNodes": 0,
"jsHeapTotalBytes": -39059456,
"scriptDurationMs": 74.08900000000001,
"eventListeners": 0,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "workflow-execution",
"durationMs": 71.52199999995901,
"styleRecalcs": 5,
"styleRecalcDurationMs": 9.820999999999998,
"layouts": 3,
"layoutDurationMs": 0.7879999999999999,
"taskDurationMs": 50.64000000000001,
"heapDeltaBytes": 3209128,
"heapUsedBytes": 68771256,
"domNodes": 105,
"jsHeapTotalBytes": 0,
"scriptDurationMs": 5.467,
"eventListeners": 33,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000273
},
{
"name": "workflow-execution",
"durationMs": 62.20199999995657,
"styleRecalcs": 6,
"styleRecalcDurationMs": 9.979,
"layouts": 3,
"layoutDurationMs": 0.824,
"taskDurationMs": 48.82900000000001,
"heapDeltaBytes": 3059760,
"heapUsedBytes": 65224016,
"domNodes": 102,
"jsHeapTotalBytes": 262144,
"scriptDurationMs": 4.685,
"eventListeners": 33,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.799999999999727
}
]
}🔬 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
🌾 Fallow: ✅ PassedFallow audits the diff for duplication, complexity and dead code. It gates on new findings only, so when the audit completes, a red is something this PR introduced or moved — never inherited backlog. A red can also mean the audit itself did not finish; the details below say which happened. No new findings in the changed files. Reproduce locally# the base the gate compared against
npx fallow audit --root . --quiet --format json \
--changed-since 518545b176b575e687ce654c32c45b7520b57ded
Full docs: ADR-DEVEX-LINT-0015 🧩 Custom Nodes Ecosystem Matrix: ✅ PassedExecutes the frontend JS of every registry pack that ships any, against this change, in both renderers. The eight
On a pin-bump PR, a red gate means the ecosystem moved — not that your diff broke something. That is what the bump PR is for. Outside a pin bump or a cold rebuild of the unpinned tail, a red means the diff. Note the corpus size and the executed count are different numbers, and the verdict is against the executed count: roughly 3,100 of ~5,100 packs ship no extension-shaped JS and are skipped. Reproduce locally# build one shard's fixture, then run it
python3 scripts/registry-census/build_matrix.py --shard 1/4
MATRIX_RENDERER=vue MATRIX_VUE=1 \
npx vitest run --config vitest.matrix.config.mts
Full docs: scripts/registry-census/README.md |
…sion (PM-1251) Adds test.fail() Playwright coverage that reproduces PM-1251's root cause end to end: idAllocation.ts's local node-id counter and the server-side agent independently mint ids for the same bound CRDT doc, with no shared reservation. When both mint before observing each other, their add_node ops collide on comfy-multi-player's applier and last-write-wins silently drops the loser, with no error surfaced to either actor. - agentCrdtIdCollisionFixture.ts: a repro harness (deliberately not agentConversationFixture, which never exercises a human-authored doc_ops frame) that drives a real Ctrl+D/duplicate-menu action so the id is genuinely minted by idAllocation.ts, captures the resulting outbound doc_ops frame, and replays the collision through the unmodified production applier via HostDoc.applyWireOps (new, additive method on the existing agent-conversation HostDoc). - agentNodeIdCollision.spec.ts: two test.fail() specs proving (1) a duplicated node is wiped and replaced by a phantom node once a whole-doc reconcile (tab switch) picks up the collision, and (2) the agent's own canonical graph read disagrees with the still-visible canvas after its write is silently dropped, with screenshots attached as visual proof. - idAllocation.property.test.ts: a fast-check property pinning the same gap at the unit level — two independently-minted counters from the same baseline always collide on their next mint. - mockAgentThreadsList.ts: shared helper for the empty-threads-list mock, extracted out of agentCrdtIdCollisionFixture.ts to avoid duplicating the same route stub already inlined elsewhere. - onClientFrame in agentCrdtIdCollisionFixture.ts is split into handleDocSubscribe/handleDocOps to keep each handler's branching simple.
de2c781 to
389a302
Compare
Playwright videos for new testsDownload the recorded videos and HTML report Recorded projects: cloud Recorded test titles:
|
Codecov Report❌ Patch coverage is
@@ Coverage Diff @@
## main #18095 +/- ##
==========================================
+ Coverage 83.34% 84.36% +1.02%
==========================================
Files 2990 2284 -706
Lines 147233 130544 -16689
Branches 38048 35536 -2512
==========================================
- Hits 122715 110137 -12578
+ Misses 23237 20111 -3126
+ Partials 1281 296 -985
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 788 files with indirect coverage changes 🚀 New features to boost your workflow:
|
Verdict: NOT TRIVIALI looked at whether the race window in What's already there, and why it isn't enough
The design invariant this is actually violating
This matters for triage: if comfy-cli's real Options consideredA. Server-authoritative synchronous allocation. Round-trip every mint through a single allocator before use. Correct, but a real architectural change spanning frontend + cloud + latency/UX cost on every add-node. Ruled out as disproportionate to the bug. B. Namespace ids by actor / bring both producers into KA-5 compliance (random mint in a disjoint range). This is what the system's own schema already prescribes and, per C. Surface RecommendationOption B, scoped to CRDT-bound sessions, is the most promising direction because it matches a design invariant the system already committed to (KA-5) rather than adding new machinery -- but it needs a human decision before implementation on:
Happy to turn whichever direction gets picked into an implementation PR. Generated by Claude Code |
…e-id-race-repro # Conflicts: # browser_tests/fixtures/agentConversationHostDoc.ts
…e-id-race-repro # Conflicts: # browser_tests/fixtures/agentConversationHostDoc.ts
There was a problem hiding this comment.
🔍 Cursor Review — Consolidated panel
Triggered by @christian-byrne.
Found 10 finding(s).
| Severity | Count |
|---|---|
| 🟠 High | 1 |
| 🟡 Medium | 5 |
| 🟢 Low | 4 |
Panel: 8/8 reviewers contributed findings.
…PM-1251) A local mint could land on an id the in-app agent independently mints for the same collaborative doc: idAllocation.ts's ++lastNodeId counter gets bumped into the agent's numeric neighborhood by observeNodeId, then walks forward one integer at a time until it lands on an id the agent mints next, silently dropped by last-write-wins. mintNodeId now takes an explicit mint mode. LGraph.add() picks 'crdt-disjoint' only for a mint on a root graph the agent panel has bound to its collaborative doc (tracked in a new, minimal agentCrdtGraphBindingStore, written from AgentPanelRoot.vue's existing isBoundWorkflowActive signal), and 'sequential' otherwise -- plain local graphs are unchanged. A crdt-disjoint mint draws a random id with bit 40 forced clear and bit 41 forced set, which can never equal the agent's `2**40 | random52` ids (KA-5) by construction, not by odds. Subgraph-interior mints stay sequential; the op layer never targets that scope.
…epro - Only ack a captured op, and only bump HostDoc's seq, once it has actually applied (agentConversationHostDoc.ts, agentCrdtIdCollisionFixture.ts) - Guard handleDocOps on workflow_id like handleDocSubscribe already does - Assign the mocked WS route's socket in routeWebSocket, not onClientFrame, so a reconnect can't keep writing to a stale closed socket - Clarify mintAgentCollision's forced-collision scope now that the disjoint-range mint fix has landed, and share that setup (with its own assertions, which fail loudly independent of test.fail()) between both agentNodeIdCollision.spec.ts tests via a new driveCollision helper - Assert node existence before its type in the second spec's final check - Drop idAllocation.property.test.ts's two tautological pre-fix properties in favor of the one that doesn't restate mintNodeId's own formula
dante01yoon
left a comment
There was a problem hiding this comment.
Thanks for the very thorough writeup — the RCA narrative, the decision to run the real comfy-multi-player applier instead of a hand-rolled stand-in, and the per-comment replies to the Cursor panel all made this much faster to review. I confirmed at head that the earlier panel findings were genuinely addressed: handleDocOps now guards workflow_id, applyWireOps filters op_ids to applied outcomes and only bumps seq when something applied, receipt-acking is gone in favour of ackCapturedOutcomes, this.socket is assigned in the routeWebSocket callback, and the desync spec asserts canonicalNode is defined before its type.
Two things I want to credit before the findings, because they are the parts this kind of PR usually gets wrong:
- The deliberate failures are declared so they report. Both specs use
test.fail(), nottest.fixme, so when the silent-LWW half is fixed the runner flags "expected to fail, but passed". No Vitestit.failsanywhere. That is the right choice. - The failures are contained. CI is fully green at head (86 pass / 17 skipping / 0 fail).
playwright-tests (cloud)reports313 passed, 1 skippedwith the new spec confirmed executed by theplaywright-video-new-testsjob ("all tests inbrowser_tests/tests/agent/agentNodeIdCollision.spec.ts"). No required lane is red and I found no added flake in the reporter output.
The blocking findings fall into three groups.
1. The PR is not test-only, and the title/body say it is. Head ships a production behaviour change to node-id allocation across four src/ files (idAllocation.ts, LGraph.ts, a new agentCrdtGraphBindingStore.ts, and AgentPanelRoot.vue). The body still says "Breaking: none — test-only changes plus one additive method on an existing test fixture class", and the title is test:. Your inline replies show you know the fix is on the branch, so I read this as a stale description rather than anything hidden — but it needs correcting before merge, because a test: prefix is exactly what gets waved through without production scrutiny.
2. The fix's premise is unverified and the tests that "prove" it are tautologies. The whole crdt-disjoint partition rests on the agent minting 2**40 | random52. I grepped the repo at head: that contract appears only in the three files this PR adds or edits. There is no shared constant, no generated type in @comfyorg/ingest-types or @comfyorg/registry-types, and nothing in @comfyorg/comfy-multi-player. The property test then models the agent side with its own local copy of the same assumption, so it confirms the mirror rather than the contract. Details inline on idAllocation.ts:41 and idAllocation.property.test.ts:76.
3. Two house-rule-A violations in the new harness, both with a generated type already available and already used by sibling agent fixtures in this repo. Details inline on agentCrdtIdCollisionFixture.ts:513 and mockAgentThreadsList.ts:8. To be explicit about what is fine: the rest of the harness is exemplary here — WorkflowListResponse and AgentRunMode from @comfyorg/ingest-types, ObjectInfoResponse from @/schemas/nodeDefSchema, UserDataFullInfo, and Op/ApplyOutcome/WidgetCatalog/WorkflowJSON from @comfyorg/comfy-multi-player are all the right imports.
On the review-focus questions you raised
- Does each spec fail for the stated reason? I could not execute the Playwright suite (no ComfyUI backend, and the sandbox restriction on installing dependencies), so I traced the mechanism rather than observing it. The failure paths you describe are consistent with the code:
driveCollision's structural assertions (agentApply.outcomes=applied,humanApply.outcomes=lww-dropped) all run before eithertest.fail(), and your empirical note about Playwright's_modifieronly flippingexpectedStatusfrom the call site onward matches the documented semantics — so a fixture regression in the shared setup does still fail the run rather than being absorbed. That is the right structure. The one place I could not confirm the failure is attributable purely to production behaviour is spec 1's node-selection step; seeagentCrdtIdCollisionFixture.ts:379. - Does the repro pin the collision or a symptom? A symptom, deliberately — and I think the scoping decision is right, but the labelling has not caught up.
mintAgentCollisionnow says the forced same-id write exists to pin "the OTHER, still-open half of PM-1251" (silent LWW with no error surfaced), which is accurate and is genuinely still unfixed. But the spec's own file doc (lines 33-35) still tells the next reader to "fliptest.fail()away once PM-1251 ships a fix" — and this PR fixes the id-collision half of PM-1251. See the inline note there. - Who owns id allocation? Both sides mint, independently, which is the defect. The frontend mints client-side (
idAllocation.ts, viaLGraph.addand the duplicate/paste path) and the agent mints server-side; neither reserves against the other. This PR does not move authority — it keeps allocation client-side and changes only the local strategy — so it is not house-rule-C territory in the "frontend synthesizing server state" sense. It is house-rule-C territory in the "prove your premise" sense: a two-party range partition is being asserted unilaterally by one party with no shared, versioned source of truth. Worth naming now because it shapes the eventual fix: the durable version of this is the reservation published from the contract (or an actor-scoped id namespace), not a bit convention transcribed into a frontend constant. forceReconcile()via tab switch: I have no objection. YourecsFollowerAdapter.tsreconcileNextFramereasoning holds as written, and the inline citation you added means the invariant will not be silently lost. Not worth a dedicated hook yet.- Combining symptoms 1+2: fine by me — they are one LWW event and splitting them would just duplicate
driveCollision.
What the -6 deletions did
I read all six. They are benign and contain no removed behaviour or deleted coverage: LGraph.test.ts -1 is an import line rewritten to add toRootGraphId; LGraph.ts -3 are the import type line (adding NodeIdMintMode) and the two mintNodeId(state) call sites replaced in place with the mode-aware form; idAllocation.ts -2 are the old mintNodeId signature and body, replaced by the mode-dispatching version whose 'sequential' default is byte-identical in behaviour. No test was removed and no guard was weakened.
Validation performed / skipped
- Performed: full diff read at head; head-version reads of every changed file; repo-wide grep at head for the agent mint contract,
KA-5, and the generated agent types; CI status and theplaywright-tests (cloud)job log; re-check of all ten prior Cursor findings against head. - Skipped: no local execution of Playwright or Vitest (no backend available and dependency installation is out of scope for this review), so every runtime claim above is traced from source, not observed. I also could not verify the
comfy-climint_id()implementation or theKA-5reference, since neither is reachable from this repository — which is itself the substance of theidAllocation.ts:41finding.
Happy to re-review promptly once these are addressed — the harness underneath is good work and I would like to see it land.
| * bound workflow activates/deactivates; read by `LGraph.add()` to choose a | ||
| * node-id mint mode that cannot collide with the agent's own mints (PM-1251). | ||
| */ | ||
| export const useAgentCrdtGraphBindingStore = defineStore( |
There was a problem hiding this comment.
issue: This is a new production Pinia store, and together with idAllocation.ts, LGraph.ts and AgentPanelRoot.vue it makes this PR a production change to node-id allocation — not a test-only PR.
The title is test: failing repro coverage ... and the description still states "Breaking: none — test-only changes plus one additive method on an existing test fixture class". Your reply on mintAgentCollision shows you're aware the 'crdt-disjoint' mint is on the branch, so I read this as a description that didn't get updated rather than anything concealed — but it does need fixing before merge.
Why it matters concretely: a test: prefix is the signal reviewers, release notes and risk tooling use to decide how much production scrutiny a change gets. Every user who opens the agent panel on a bound workflow will start receiving ~2^41-magnitude node ids from this path, which is a real behavioural change that deserves to be announced as one.
Could you retitle to fix: (or feat:) and rewrite the Summary/Changes sections to lead with the 'crdt-disjoint' mint and its blast radius, keeping the repro coverage as the secondary half? The existing RCA prose is good and mostly still applies — it's the "what this PR does" framing that's stale.
There was a problem hiding this comment.
Retitled to fix: mint disjoint-range node ids for CRDT-bound graphs to prevent agent/frontend id collision and rewrote the Summary/Changes/Breaking sections to lead with the production 'crdt-disjoint' mint change and its blast radius (large/random node ids on agent-bound graphs going to production), with the repro coverage now framed as secondary. Kept the existing RCA prose as you suggested.
(Edited to remove an internal tracker ID from this public repo.)
There was a problem hiding this comment.
Tracked as FE-2793. The PR merged with this thread unresolved, so the finding is carried in Linear rather than lost here. Filed automatically; close the ticket if the finding is no longer true at main.
| * forced SET, partitions the two actors' ranges by construction (KA-5) — not | ||
| * by odds — regardless of what `observeNodeId` has observed. | ||
| */ | ||
| const AGENT_RESERVED_BIT = 1n << 40n |
There was a problem hiding this comment.
issue: The correctness of this whole fix rests on a cross-repo premise that isn't verifiable from this repository, and there's no guard if it stops holding.
The comment above states the agent mints 2**40 | random52bits (comfy-cli's mint_id()), and AGENT_RESERVED_BIT hard-codes that as the partition boundary. I grepped the repo at head for 1099511627776, 1n << 40n, 1 << 40, 2**40 and mint_id: the only hits are idAllocation.ts (here), idAllocation.test.ts:36 and idAllocation.property.test.ts:72,76 — all added by this PR. There is no shared constant, nothing exported from @comfyorg/ingest-types or @comfyorg/registry-types, and nothing in @comfyorg/comfy-multi-player@0.2.1. The KA-5 citation is likewise unresolvable — it appears nowhere else in the repo.
So this is a two-party range partition that only one party has written down, in a language and repo the other party never reads. The failure mode is the bad kind: if comfy-cli's mint_id() ever changes its reservation bit — or a second agent backend mints differently — the partition silently evaporates, PM-1251 returns in exactly its original form, and nothing here goes red, because the only tests of this property model the agent with a local copy of the same assumption (see my note on idAllocation.property.test.ts:76).
Two things would resolve this for me, and the first is cheap:
- Make the premise checkable from here: cite the comfy-cli source file/permalink for
mint_id()in this comment, so a future reader can diff the assumption against its source rather than trusting the transcription. - Add a runtime assertion that turns a broken premise into a visible failure rather than silent data loss — e.g. in
agentNodeMaterializer, report (viareportError) when a remote agent-originated node id arrives with bit 40 clear. That converts "the partition quietly stopped existing" into a signal.
Longer term this belongs in the contract rather than in a frontend constant — a published reservation or an actor-scoped id namespace — but I'm not asking for that here.
There was a problem hiding this comment.
Added a source citation to the doc comment: Comfy-Org/comfy-cli's comfy_cli/workflow_ops.py:65-72 with a permalink pinned to that repo's current head commit (aec5220), confirmed by reading the file directly (_ID_FLOOR = 1 << 40, mint_id() -> _ID_FLOOR | random.getrandbits(52)).
Also added a runtime guard, reportReservedBitViolation in agentNodeMaterializer.ts, that calls reportError() (errorType: 'agent_node_id_reserved_bit_violation') when a remote node id materialized on a CRDT-bound graph is large enough to be a modern mint but matches neither the agent's nor this app's reserved-bit convention. Exported a matchesReservedBitConvention predicate from idAllocation.ts so both this guard and the property test check against the same production logic rather than two independent copies of the bit math.
| const agentMintedId = (): fc.Arbitrary<bigint> => | ||
| fc | ||
| .bigInt({ min: 0n, max: (1n << 52n) - 1n }) | ||
| .map((random) => (1n << 40n) | random) |
There was a problem hiding this comment.
issue: All three properties in this file are true by construction, so none of them can fail for any generated input — they don't discriminate between the fix working, the fix being unbound, and the premise being wrong.
Walking them:
agentMintedId()here produces(1n << 40n) | random, so bit 40 is always set.mintCrdtDisjointNodeIdproduces(random & ~AGENT_RESERVED_BIT) | CRDT_DISJOINT_FLOOR, so bit 40 is always clear. Two values that differ in a fixed bit can never be equal, so both'crdt-disjoint'properties hold by inspection, for every input, regardless of what the real agent does.fast-checkis generating inputs that cannot reach a counterexample.- The
'sequential'property runs two identically-seededLGraphStates through the same puremintNodeIdcall and asserts they agree — a restatement of determinism. Your own comment at lines 31-38 concedes it "is not a regression guard that a fix could flip red", which I read as agreement.
The sharper problem is the one the comment on line 72 names without treating as a problem: agentMintedId mirrors the assumption that idAllocation.ts:41 encodes. Both sides of the comparison are written here, from the same belief, so the property confirms the mirror, not the contract. If comfy-cli changed its mint tomorrow this file would stay green.
We hit this exact shape two days ago in #17585 (AGENT_SUBGRAPH_INITIAL_TEXT = '' made the headline assertion pass whether the behaviour worked, was unbound, or had regressed), which is why I'm treating it as blocking rather than a style note.
What would actually discriminate, in rough order of value:
- A test that fails when the fix is unbound — i.e. drives
LGraph.add()on an agent-bound root graph through the realAgentPanelRootwiring, rather than callingbindingStore.setBound()directly asLGraph.test.tsdoes. That is the gap that matters most (see my note onAgentPanelRoot.vue:634). - If the bit convention is going to live in a constant, assert
'crdt-disjoint'output againstAGENT_RESERVED_BITimported from production rather than a literal respelled in the test, so at least the test tracks the production constant and can't drift from it independently.
A property that can't fail is worse than no property, because it reads in review as coverage.
There was a problem hiding this comment.
Agreed both properties can't be made to fail on the actual cross-repo premise from this repo alone — did the two things you suggested instead:
agentMintedIdnow ORs against the importedAGENT_RESERVED_BIT(fromidAllocation.ts) instead of a re-spelled1n << 40nliteral, so it can't independently drift from the production value.- Added
AgentPanelRoot.test.ts's "rebinds CRDT mint eligibility..." test, which mounts the real component and drives the actualAgentPanelRoot.vue:632watch getter end to end (notbindingStore.setBound()directly, per your point Bump braces from 3.0.2 to 3.0.3 in /tests-ui #1) — confirmed it fails red against the pre-fix getter from yourAgentPanelRoot.vue:634comment and passes green with that fix, so it's the "fails when the fix is unbound" test you ranked highest-value.
Left the 'sequential'-mode property as-is per your agreement that it's a documented, non-blocking restatement of determinism.
There was a problem hiding this comment.
Tracked as FE-2793. The PR merged with this thread unresolved, so the finding is carried in Linear rather than lost here. Filed automatically; close the ticket if the finding is no longer true at main.
| let boundCrdtRootGraphId: RootGraphId | null = null | ||
| watch( | ||
| () => | ||
| agentPanelStore.enabled && isBoundWorkflowActive.value && app.isGraphReady |
There was a problem hiding this comment.
issue: This watch getter reads app.isGraphReady, which is a plain non-reactive getter, so the binding can latch on a stale value and leave the 'crdt-disjoint' fix inert in production.
app is export const app = new ComfyApp() (src/scripts/app.ts:2730) — a plain class instance, never wrapped in reactive() — and isGraphReady is a plain getter over rootGraphInternal (src/scripts/app.ts:362). Reading it inside a watch getter therefore registers no dependency. The same is true of app.rootGraph.id on the line below.
The sibling watch 24 lines above documents exactly this trap and compensates for it:
// `app.isGraphReady` is a plain getter; reading `canvasStore.canvas` (set
// right after `app.setup()`) makes the follower's graph watch fire once the
// root graph exists.
() => (canvasStore.canvas && app.isGraphReady ? app.rootGraph : null),
This new getter tracks only agentPanelStore.enabled and isBoundWorkflowActive (which itself depends on boundWorkflowId and workflowStore.activeWorkflow). None of those track graph readiness or root-graph identity. So on a workflow switch, where activeWorkflow flips while the root graph is being torn down and rebuilt, the getter evaluates against whichever rootGraph happens to exist at that instant and then isn't re-evaluated until one of those three unrelated deps changes again. boundCrdtRootGraphId keeps pointing at the previous root graph id (or null), the new root graph is never marked bound, nodeIdMintModeFor returns 'sequential', and PM-1251's collision window reopens — silently, with the fix apparently present.
The reason I'm treating this as blocking rather than speculative is that nothing in the PR would catch it: LGraph.test.ts calls bindingStore.setBound() directly and never exercises this watch, and the Playwright spec forces the collision via mintAgentCollision regardless of which mint mode produced the id, so it cannot detect an inert mint mode either. The fix could be fully non-functional in production and every test here would still report exactly what it reports today.
Suggested change: gate this getter the same way its sibling does, so readiness is tracked through a reactive value —
() =>
agentPanelStore.enabled &&
isBoundWorkflowActive.value &&
canvasStore.canvas &&
app.isGraphReady
? toRootGraphId(app.rootGraph.id)
: null,I could not run the app to observe this, so I'm describing the mechanism rather than a reproduction — but the existing comment at line 610 is strong evidence the hazard is real and known in this file.
Separately and non-blocking: attachMintPortWiring right below already receives isDocBound: () => isBoundWorkflowActive.value. Once this is correct, it may be worth collapsing the new store, the manual watch, the boundCrdtRootGraphId shadow variable and the onBeforeUnmount teardown into that existing channel rather than maintaining a second one.
There was a problem hiding this comment.
Fixed — the getter now also reads canvasStore.canvas, matching the sibling watch right above it (AgentPanelRoot.vue:610-613), so it re-evaluates when the root graph actually changes across a workflow switch instead of latching on agentPanelStore.enabled/isBoundWorkflowActive alone (5272729).
Added a regression test in AgentPanelRoot.test.ts ("rebinds CRDT mint eligibility to the current root graph...") that mounts the real component, drives the actual watch getter (not bindingStore.setBound() directly), and toggles canvasStore.canvas across a simulated root-graph swap — verified it fails red against the pre-fix getter and passes green with this fix.
Left the attachMintPortWiring consolidation you suggested as a follow-up rather than folding it in now — wanted this specific reactivity fix isolated and easy to verify under review.
There was a problem hiding this comment.
Consolidated for real now, in f17190b — the store, the watch, the shadow id and the teardown are all gone, and src/stores/agentCrdtGraphBindingStore.ts is deleted.
attachMintPortWiring already receives the enabled/doc-bound/current-graph signal, so it is now the only thing that answers the mint-mode question. It registers one pull-based probe:
const unregisterDocBoundProbe = registerDocBoundRootGraphProbe(() => {
if (!deps.isEnabled() || !deps.isDocBound()) return null
const graph = deps.getGraph()
if (!graph) return null
return graph.rootGraph?.id ?? graph.id
})and LGraph.nodeIdMintModeFor reads isRootGraphDocBound(graph.id) at mint time. What that buys beyond deleting a duplicate:
- The mint mode is derived from the exact trio the mint ports gate their own sends on, so a graph draws from the disjoint range precisely when its edits are reaching the doc — one source of truth instead of two that can disagree.
- Pull, not push, means there is no reactivity to keep alive. That removes the whole class of bug the previous commit on this branch was fixing (the watch that never re-fired when only the root graph changed) rather than fixing it a second time, and the
canvasStore.canvasread that existed only to nudge that watch is gone with it. detach()unregisters, so theonBeforeUnmountcleanup in the component disappears too.
The registry is src/lib/litegraph/src/docBoundGraphs.ts — 34 lines, zero imports — so the dependency is inverted rather than added to: litegraph reads a sibling instead of importing @/stores/*, and the workbench layer registers downward into it. That also clears the lib -> stores layer warning the store had introduced, instead of trading it for a lib -> workbench one.
Tests moved with the mechanism: LGraph.test.ts drives it through registerDocBoundRootGraphProbe (including a new case that mints go back to sequential once unbound), and AgentPanelRoot.test.ts asserts the panel's own wiring reports the live root graph and follows a root-graph swap without the panel/workflow flags moving.
Generated by Claude Code
| const nodeId = await this.page.evaluate( | ||
| (seedId) => | ||
| window | ||
| .app!.graph.nodes.map((node) => String(node.id)) | ||
| .filter((id) => id !== seedId) | ||
| .sort((a, b) => Number(a) - Number(b)) |
There was a problem hiding this comment.
issue: "Highest numeric id is the node just created" was true under sequential minting, but this PR's own 'crdt-disjoint' mode breaks it — so on the retry path this can select the wrong node and produce a failure that isn't the defect.
mintCrdtDisjointNodeId returns (random & ~AGENT_RESERVED_BIT) | CRDT_DISJOINT_FLOOR, i.e. an unordered random value in roughly [2^41, 2^52]. Once the graph is agent-bound, successive duplicates get ids with no ordering relationship at all.
The retry loop above is where this bites. When attempt 1 mints a bound (random, large) id but its add_node isn't captured within the 2s pollForOutboundAddNode window, the orphan is shoved +2000px aside and left on the graph. Attempt 2 mints another random id. There's then roughly a coin-flip chance the stale orphan's id is the larger of the two, in which case .at(-1) returns the orphan rather than the node just duplicated. If attempt 1's op then lands late, findCapturedAddNode will happily match it and driveCollision will proceed against a node that was deliberately moved off-screen — at which point spec 1's expect(getNodeLocator(nodeId)).toBeVisible() fails in setup, before test.fail(), and the run goes red for a fixture reason rather than the bug.
The fix is to select by identity rather than by magnitude — snapshot the ids before the duplicate and take the set difference:
const before = new Set(
await this.page.evaluate(() =>
window.app!.graph.nodes.map((n) => String(n.id))
)
)
// ... perform the duplicate ...
const nodeId = (
await this.page.evaluate(() =>
window.app!.graph.nodes.map((n) => String(n.id))
)
).find((id) => !before.has(id))That is correct under both mint modes and doesn't depend on ids being ordered or on the seed being the only pre-existing node.
(Noting for completeness: this also means spec 1's headline failure is only attributable to production behaviour when the right node was selected. That's the one place I couldn't fully satisfy myself the repro fails strictly for the stated reason.)
There was a problem hiding this comment.
Fixed per your suggestion — the retry loop now snapshots node ids before the duplicate action and finds the new node by set difference (!before.has(id)) instead of picking the numerically-highest id, so it's correct under 'crdt-disjoint''s unordered ids and can't pick up a stale orphan left over from a prior retry attempt.
There was a problem hiding this comment.
Tracked as FE-2793. The PR merged with this thread unresolved, so the finding is carried in Linear rather than lost here. Filed automatically; close the ticket if the finding is no longer true at main.
| return route.fulfill({ | ||
| status: 202, | ||
| contentType: 'application/json', | ||
| body: JSON.stringify({ |
There was a problem hiding this comment.
issue: (house rule A) This hand-rolls a server response shape that has a generated type, and that type is already used by the sibling agent fixtures in this repo.
The 202 body for POST /api/agent/threads/*/messages is AgentTurnAccepted in @comfyorg/ingest-types (packages/ingest-types/src/types.gen.ts:4339, reachable as AgentPostMessageResponses[202]). The existing fixtures all type it: browser_tests/tests/agent/agentPanelMocks.ts:31 and :340, and browser_tests/fixtures/agentTurnLockFixture.ts:132.
This isn't a stylistic nit here, because the literal is load-bearing for the whole repro: useAgentSession reads ack.workflow_id to bindWorkflow(...), which is what makes the doc bound, which is what makes waitForSubscribe(1) resolve. If the ack shape drifts server-side, this fixture keeps returning a shape the real server no longer sends and the repro boots green against a contract that no longer exists.
The workflow_id field is an extra beyond the generated type — the repo handles that deliberately (agentApiSchema.ts uses zAgentTurnAccepted...passthrough(), and agentRestClient.test.ts:307 covers "keeping extra workflow_id"). So the compliant form is a thin local intersection on the generated export, which the rule explicitly allows:
const accepted = {
thread_id: THREAD_ID,
message_id: MESSAGE_ID,
workflow_id: WORKFLOW_ID
} satisfies AgentTurnAccepted & { workflow_id: string }The rest of the harness already does the right thing throughout — WorkflowListResponse and AgentRunMode from @comfyorg/ingest-types, ObjectInfoResponse from @/schemas/nodeDefSchema, UserDataFullInfo, and the comfy-multi-player types — so this reads as an oversight rather than a disagreement.
While you're here, the two untyped literals below (/api/workflows** → { data: [], pagination: {...} }, which the other workflows route at line 319 already types as WorkflowListResponse, and /api/jobs** → JobsListResponse) are the same pattern and worth the same treatment.
There was a problem hiding this comment.
Fixed — the 202 ack now builds {thread_id, message_id, workflow_id} typed as AgentTurnAccepted & { workflow_id: string } via satisfies, matching agentPanelMocks.ts/agentTurnLockFixture.ts's convention for this same extra field. Also typed the /api/workflows** mock as WorkflowListResponse (matching the other workflows route in this file) and /api/jobs** as JobsListResponse, as you flagged in passing.
There was a problem hiding this comment.
Tracked as FE-2793. The PR merged with this thread unresolved, so the finding is carried in Linear rather than lost here. Filed automatically; close the ticket if the finding is no longer true at main.
| /** Mocks the agent panel's own thread list as always empty. */ | ||
| export async function mockEmptyAgentThreadsList(page: Page): Promise<void> { | ||
| await page.route('**/api/agent/threads', (route) => | ||
| route.fulfill(jsonRoute({ threads: [] })) |
There was a problem hiding this comment.
issue: (house rule A) This mock hand-rolls the thread-list response, and the shape it returns has already drifted from the real contract.
GET /api/agent/threads returns AgentThreadListResponse (packages/ingest-types/src/types.gen.ts:4392):
export type AgentThreadListResponse = {
pagination: PaginationInfo
threads: Array<AgentThreadSummary>
}pagination is required, and this mock omits it — so the harness is serving a body the server cannot produce. That's precisely the drift the rule exists to catch, and it's demonstrable here rather than hypothetical.
It matters more than usual because this is a new shared helper in fixtures/utils/, so every future caller inherits the wrong shape. The repo's existing agent fixtures already get this right and are the model to copy: browser_tests/tests/agent/agentPanelMocks.ts:269, browser_tests/fixtures/agentPromptHistoryFixture.ts:36, and browser_tests/tests/agent/renameFocus.spec.ts:49 (which uses satisfies AgentThreadListResponse).
Suggested:
import type { AgentThreadListResponse } from '@comfyorg/ingest-types'
export async function mockEmptyAgentThreadsList(page: Page): Promise<void> {
const empty: AgentThreadListResponse = {
threads: [],
pagination: { has_more: false, limit: 100, offset: 0, total: 0 }
}
await page.route('**/api/agent/threads', (route) =>
route.fulfill(jsonRoute(empty))
)
}(Please double-check the PaginationInfo field set against the generated type — I'm copying the shape used by the sibling routes in agentCrdtIdCollisionFixture.ts.)
There was a problem hiding this comment.
Fixed per your suggested snippet — now imports AgentThreadListResponse from @comfyorg/ingest-types and includes pagination (checked PaginationInfo's field set against the generated type: has_more, limit, offset, total, plus an optional next_cursor we don't need here), matching the sibling routes' shape.
There was a problem hiding this comment.
Tracked as FE-2793. The PR merged with this thread unresolved, so the finding is carried in Linear rather than lost here. Filed automatically; close the ticket if the finding is no longer true at main.
| * Both tests are `test.fail()`: they assert the CORRECT/fixed behavior, | ||
| * which the bug currently breaks. Flip `test.fail()` away once PM-1251 (or | ||
| * PM-1250) ships a fix — the assertions below should not otherwise change. |
There was a problem hiding this comment.
suggestion: This breadcrumb now points at a ticket that this PR closes, which sets up the next reader to "fix" the tests rather than the defect.
These two specs are the good kind of pin — test.fail() rather than test.fixme, so when the behaviour is corrected the runner reports "expected to fail, but passed" and the pin announces its own expiry. That part is right and I'd like it to keep working.
The problem is what it's pinned to. Per your reply on mintAgentCollision, the collision is now forced deliberately because the 'crdt-disjoint' mint on this same branch makes a natural collision on a frontend-minted id impossible — so what these specs actually pin is the still-open second half: two writes landing on the same id resolve via silent last-write-wins with no error surfaced to either actor. That's a genuinely unfixed defect and worth pinning. But this doc still tells the reader to "flip test.fail() away once PM-1251 (or PM-1250) ships a fix", and PM-1251 is the ticket this PR fixes the id-allocation half of. Once it's closed, someone will find two permanently-red-by-design specs whose only in-file reference is a closed ticket, and the cheapest reading will be that the tests are stale.
The file header also still describes the unfixed root cause ("with no shared reservation between them"), which the same branch now resolves.
Could you update this block to say plainly: (a) the id-allocation half is fixed in this PR by 'crdt-disjoint' minting, (b) these specs pin the remaining half — silent LWW with no error surfaced — and (c) link the specific open ticket for that half (PM-1250 if that's the right one, otherwise a new one)? That keeps the pin's expiry signal attached to a ticket that will still be open when it fires.
There was a problem hiding this comment.
Updated the header: it now states plainly that the id-allocation defect is fixed by this PR's 'crdt-disjoint' mint, and that these two specs pin a separate, still-open defect — the silent last-write-wins drop when two writes land on the same node id — which this PR does NOT fix. No more "flip test.fail() away once the ticket ships" pointing at an item this PR closes.
On tracker numbers: I'm not referencing any in this repo's code or in these threads (public repo), so the remaining behavior is described by what it does instead. If you want the specs retargeted at a specific tracked item, tell me and I'll keep the reference out of the tree and put it wherever you prefer.
(Edited to remove internal tracker IDs from this public repo.)
…ew on PM-1251 repro - AgentPanelRoot.vue: gate the CRDT graph-binding watch on canvasStore.canvas too, matching the sibling watch above it - the getter previously only tracked agentPanelStore.enabled/isBoundWorkflowActive, so it never re-evaluated app.rootGraph across a workflow switch and could leave the 'crdt-disjoint' mint fix inert in production. - idAllocation.ts: cite comfy-cli's mint_id() source for AGENT_RESERVED_BIT's premise and export a matchesReservedBitConvention predicate. - agentNodeMaterializer.ts: report via reportError() when a remote node id on a CRDT-bound graph matches neither known mint convention. - idAllocation.property.test.ts: import AGENT_RESERVED_BIT from production instead of a re-spelled literal. - AgentPanelRoot.test.ts: new test driving the real watch getter end to end (fails without the fix above). - agentCrdtIdCollisionFixture.ts: find the duplicated node by id-set difference instead of numeric magnitude (broken by unordered 'crdt-disjoint' ids); type the ack/workflows/jobs mocks against generated types instead of hand-rolling them. - mockAgentThreadsList.ts: include the required pagination field. - agentNodeIdCollision.spec.ts: update the header to say the id-allocation half of PM-1251 is fixed here and these specs pin the remaining silent-LWW-drop half.
|
The I attempted to re-run just that job, but GitHub currently rejects it ( 🤖 Generated with Claude Code |
This comment has been minimized.
This comment has been minimized.
dante01yoon
left a comment
There was a problem hiding this comment.
Re-review at head 52727299 (1 commit since my review at a4215529). All three blocking groups are resolved, and the suggestion: is too. I verified each against head source rather than against the replies. Approving.
Prior findings — verdicts
| # | Finding | Verdict | Evidence at head |
|---|---|---|---|
| 1 | PR ships a production change to node-id allocation while titled test: and described as "test-only changes plus one additive method" |
Resolved | Title is now fix: mint disjoint-range node ids for CRDT-bound graphs…. The Summary leads with the 'crdt-disjoint' mint, there is an explicit Blast radius paragraph naming the user-visible consequence (large randomly-ordered ids on bound graphs, node-id badges, any code assuming small sequential ids), and Breaking now reads "the id-mint behavior change described above … ships to production" instead of "none". The repro coverage is framed as the secondary half. That is the framing I asked for |
| 2a | The 2**40 | random52 premise is unverifiable from this repo, with no guard if it stops holding |
Resolved | idAllocation.ts:41-47 carries a commit-pinned permalink to comfy-cli's comfy_cli/workflow_ops.py:65-72 at aec5220, so the transcription is now diffable against its source. The runtime guard exists: reportReservedBitViolation (agentNodeMaterializer.ts:374-401) fires reportError() with errorType: 'agent_node_id_reserved_bit_violation' when a remote id on a bound graph matches neither convention. The two early-outs are correctly ordered — isBound(scope.rootGraphId) first, then BigInt(nodeId) < AGENT_RESERVED_BIT, so legacy small sequential ids can't trip it. Both were the cheap options I named, and you took both |
| 2b | All three properties are true by construction; agentMintedId mirrors the assumption idAllocation.ts encodes |
Resolved on the terms I offered | I gave two remedies and both landed. (2) agentMintedId now maps over the imported AGENT_RESERVED_BIT (idAllocation.property.test.ts:82-84), so it can no longer drift from production independently, and the doc comment is honest that it still cannot verify comfy-cli's actual mint. (1) — the one I ranked highest — is the new AgentPanelRoot.test.ts case, below. I am not asking for more here: a property that cannot observe the other repo cannot be made to fail on the cross-repo premise, and you said so rather than claiming otherwise |
| 3 | The CRDT-binding watch getter reads non-reactive app.isGraphReady, so the fix can latch stale and be inert in production |
Resolved | AgentPanelRoot.vue:628-635 now gates on canvasStore.canvas && app.isGraphReady, matching the sibling watch 24 lines above that documents this exact trap. More importantly this is now covered: AgentPanelRoot.test.ts:6604-6627 mounts the real component, drives the actual watch, and swaps the root graph across a canvas teardown/rebuild without touching agentPanelStore.enabled or isBoundWorkflowActive — precisely the two deps the pre-fix getter relied on — then asserts graph-a unbinds and graph-b binds. Against the pre-fix getter that assertion cannot pass, so this is the "fails when the fix is unbound" test the PR was missing |
| 4 | .at(-1) "highest numeric id is the node just created" is false under 'crdt-disjoint''s unordered ids; a stale retry orphan can be selected |
Resolved | agentCrdtIdCollisionFixture.ts:374-393 snapshots idsBefore into a Set and selects by .find((id) => !before.has(id)). Correct under both mint modes, and independent of the seed being the only pre-existing node. The comment states the reasoning ("only by which id wasn't there before") |
| 5 | (house rule A) 202 ack hand-rolled; generated AgentTurnAccepted exists and sibling fixtures use it |
Resolved | :530 — } satisfies AgentTurnAccepted & { workflow_id: string }, the thin-intersection form the rule allows, with a comment naming the passthrough() handling of the extra field. The two I flagged in passing are done too: WorkflowListResponse at :538 (matching :324) and JobsListResponse at :553 |
| 6 | (house rule A) mockAgentThreadsList omits required pagination, so it serves a body the server cannot produce — in a new shared helper |
Resolved | Typed AgentThreadListResponse with pagination: { has_more, limit, offset, total } (mockAgentThreadsList.ts:9-12). Future callers inherit the real shape |
| 7 | (suggestion:) The spec breadcrumb pins to a ticket this PR closes, setting the next reader up to "fix" the tests |
Resolved | The header now states plainly that this PR fixes the id-allocation half, that the specs pin the remaining half (silent LWW, no error surfaced), and that the flip condition is "PM-1251's remaining half ships a fix" (agentNodeIdCollision.spec.ts:25-33, 43-46). The stale "with no shared reservation between them" root-cause framing is now scoped to the pre-fix past tense |
One residual note — non-blocking, no action needed to merge
The expiry breadcrumb is now attached to "PM-1251's remaining half" rather than to a distinct open ticket. That is a real improvement over pointing at the bare ticket, but if PM-1251 is closed when this merges, the two permanently-red-by-design specs will again reference a closed ticket. If a separate ticket exists for the silent-LWW half, linking it in that header later would make the pin self-expiring for good. Not worth another round trip.
CI and validation
Green at 52727299: 86 pass / 17 skipping / 0 fail.
Performed: full diff read at head; head-version reads of idAllocation.ts, idAllocation.property.test.ts, mockAgentThreadsList.ts, agentCrdtIdCollisionFixture.ts, and agentNodeIdCollision.spec.ts; diff reads of AgentPanelRoot.vue, AgentPanelRoot.test.ts, and agentNodeMaterializer.ts; traced the new test against the pre-fix getter's dependency set; re-read the rewritten description against the shipped diff; CI status at head.
Not performed: no local execution of Playwright or Vitest (no backend, no dependency install), so the new AgentPanelRoot.test.ts case's red-then-green result is your report, not observed by me — though its mechanism is checkable from source and I did check it. I also still cannot reach comfy-cli from this repo to verify mint_id() independently; the permalink plus the runtime guard are exactly the mitigation for that, which is why it no longer blocks.
Thanks for taking the reactivity finding seriously enough to cover it rather than just patch it — the inert-fix case was the one that would have been invisible after merge.
- idAllocation.test.ts: rename the MAX_SAFE_INTEGER+2n test case from "one past" to "two past" and explain it's chosen because Number() rounds it down into the violating range. - agentNodeIdCollision.spec.ts: tag the describe block @vue-nodes so it participates in Vue-node-filtered runs via bootAgentApp's shared tag-driven readiness path. - agentCrdtIdCollisionFixture.ts: drop the now-redundant manual 'Comfy.VueNodes.Enabled': true setting, since bootAgentApp already enables it from the @vue-nodes tag. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CYUNXA5xHtJHMoNoaEayq6
DrJKL
left a comment
There was a problem hiding this comment.
Verdict: ready to approve
I confirmed the Vue-node tag/setup finding, safe-boundary label, and issue placeholder are fixed. Tag-driven boot now enables the renderer, the redundant setting is gone, and the updated boundary name matches MAX_SAFE_INTEGER + 2n.
One prior body nit remains partially addressed:
- P3 Nit: The Playwright evidence is still from an older implementation even though part of its title was refreshed. It omits the new
@vue-nodestag, uses the previous test title, and reports node ID72, which cannot come from the current bit-41 disjoint allocator. Please rerun and replace the output/failure details/screenshots, or label the evidence as an older run rather than presenting it as current.
I left one additional nonblocking P3 inline finding on the second test's title.
Checks at fc372d15220dd46fd05e68abcc26bd673fcabf55: frozen install; full typecheck, changed-file ESLint, type-aware oxlint, full format check, knip, and git diff --check passed; 459 focused Vitest tests passed; Playwright discovered both tagged collision specs. GitHub reports 85 successful, 17 skipped, and one failed check; the failure remains the co-author-trailer policy check.
|
|
||
| test( | ||
| "leaves the agent's own graph read disagreeing with the " + | ||
| 'still-visible canvas after its write is silently dropped', |
There was a problem hiding this comment.
P3: This title says its write after naming the agent, but driveCollision asserts that the agent write is applied and the human/frontend write is lww-dropped. Please name the dropped side explicitly, for example after the user's write is silently dropped, so the test report describes the behavior it actually proves.
There was a problem hiding this comment.
Agreed — right after naming the agent, "its write" reads as the agent's write being the one dropped, when driveCollision actually proves the opposite: the agent's write is applied and the human/frontend write is lww-dropped.
This is confirmed nonblocking in your approval (#18095 (review)), and this repo dismisses stale approvals on push — so rather than push a new commit now and lose that approval, I'll retitle to name the dropped side explicitly (e.g. "...after the user's write is silently dropped") in a fast-follow.
Generated by Claude Code
There was a problem hiding this comment.
Tracked as FE-2793. The PR merged with this thread unresolved, so the finding is carried in Linear rather than lost here. Filed automatically; close the ticket if the finding is no longer true at main.
DrJKL
left a comment
There was a problem hiding this comment.
Verdict: approved
No blocking findings remain. I confirmed the latest renderer-tag, fixture setup, boundary-label, and PR-body fixes, and the implementation checks are green.
Two nonblocking documentation findings remain and can be handled without holding the PR:
- P3: The second collision test title says
its writeafter naming the agent, but the harness proves the human/frontend write islww-droppedwhile the agent write is applied. Name the dropped side explicitly. - P3 Nit: The PR body's Playwright evidence is from an older implementation: it omits
@vue-nodes, uses an earlier title, and reports node ID72, which cannot come from the current bit-41 allocator. Rerun it or label it as historical.
Validation at fc372d15220dd46fd05e68abcc26bd673fcabf55: full typecheck, changed-file ESLint, type-aware oxlint, format, knip, and git diff --check passed; 459 focused Vitest tests passed; Playwright discovered both tagged specs. The only failing GitHub check is the co-author-trailer policy check.
|
Acknowledging the remaining PR-body nit (raised in #18095 (review) and reconfirmed nonblocking in the approval, #18095 (review)): the Playwright evidence in the PR description is stale — it predates the Since the PR is approved at Generated by Claude Code |
|
|
… graphs to prevent agent/frontend id collision (#18095) (#18524) <!-- 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 `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 #18095 depends on `agentFollowerHostSocket.ts`, which doesn't exist on `core/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. `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 #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/core/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>
…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
Summary
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, theiradd_nodeops collided oncomfy-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: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 own2**40 | random52convention 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 twotest.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.
Changes
src/lib/litegraph/src/idAllocation.ts— newNodeIdMintMode('sequential'default,'crdt-disjoint') andmintCrdtDisjointNodeId().mintNodeId(state, mode)dispatches on it; sequential mode andobserveNodeIdare unchanged.src/lib/litegraph/src/docBoundGraphs.ts— a probe registry litegraph pulls at mint time (isRootGraphDocBound).attachMintPortWiringis 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@/storesfor 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 onagentConversationFixture(see its module doc): that fixture replays a recording captured against a real backend and only ever callsHostDoc.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:/ws+ REST layer (no real ComfyUI/agent backend — see "What I could not run live" below),idAllocation.tsand the outbounddoc_opsframe is genuinely produced byopSender/layoutMintPort,'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 outbounddoc_opsframe) and resolves both writes through the unmodified production applier (@comfyorg/comfy-multi-player'sapplyOps) viaHostDoc.applyWire. It is not, and no longer claims to be, a repro of an allocation race.browser_tests/fixtures/agentFollowerHostSocket.ts— oneheldClientOps()accessor, so a caller using the shared host's existinghumanOpsHost: 'hold'mode can reach thedoc_opsbatch the host is sitting on and decide when it reaches the document. The collision scenario needs differentdoc_opstiming, 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'sagentWireFrame.ts(parseWireOps), and both writes resolve through main's singleHostDoc.applyWirepath.browser_tests/tests/agent/agentNodeIdCollision.spec.ts— twotest.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):add_node(SaveImage) at the same id with a higherbase_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 livedoc_update, then forces a full catch-up reconcile (a tab-switch away and back, exactlyagentTabSwitchCatchUp.spec.ts's existing mechanism) and asserts the duplicate's own content is still there. Screenshots attached before/after.test.fail(), asserts the agent's canonicalprojection()read agrees with it (false: it's the agent'sSaveImage, not the user's node).src/lib/litegraph/src/idAllocation.property.test.ts— afast-checkproperty 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 productionAGENT_RESERVED_BITconstant 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 viareportError(), converting a silent premise break (if comfy-cli'smint_id()ever stops setting its reserved bit) into a visible signal. It narrows to a numeric integer first:NodeIdisstring | numberand a bound doc may legally carry a legacy"named"node or a"57:3"subgraph address, which must materialize normally rather than abort reconciliation.AgentFollowerHostSocket.heldClientOps().fast-checkis already a repo dependency, used elsewhere in*.property.test.tsfiles).Why this test type (unit vs. the alternatives considered)
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 onidAllocation.tsdemonstrating no collision-avoidance. I went with the latter. While investigating I found the mechanism is more specific than "no collision check":LGraph.add()does callobserveNodeIdfor a locally-known id, andagentNodeMaterializer.ts'smaterialize()does callgraph.add(node)(soobserveNodeIdfires) when a remote node is reconciled onto the canvas. The actual gap is the race window —idAllocation.tsmints 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 sameobserveNodeIdcall. The property test pins exactly that: nothing inidAllocation.tscan close this window because it has no channel to the other actor's mint at all.What I ran and what actually happened
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,applyWiresupersedesapplyClient, andagentWireFrame.ts'sparseWireOpssupersedes the client-frame parser this branch had written (upstream deliberately validates only the envelope shape, so a deferred or malformed op still reachesapplyOpsfor its real verdict). The lockfile is taken from main unchanged (@comfyorg/comfy-multi-player0.2.1 → 0.3.2); the affected unit suites pass against 0.3.2 (57 files, 1134 passed, 6 expected-fail), andpnpm typecheck,pnpm typecheck:browserandpnpm lintare 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 pointedlaunchOptions.executablePathat the pre-installed binary for local runs only and reverted that config change before committing (not part of this PR's diff).agentNodeIdCollision.spec.ts), full run against Chromium, headed via the real docked agent panel:status: "expected", expectedStatus: "failed"(Playwright's JSON reporter) — i.e. they genuinely fail, for the right reason, every run I made: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).expect(canonicalNode?.type).toBe('CLIPTextEncode')— Received: "SaveImage".test.fail(), which all passed: the collision genuinely happened,humanApply.outcomeswas genuinely"lww-dropped").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 (disconnectedimagesinput,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 (pasttest.fail()) proves the doc disagrees.idAllocation.property.test.ts+ existingidAllocation.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, andoxfmt --checkare all clean on every file this PR touches.What I could not run live, and why
I could not run the existing
agentConversationFixture-based specs (e.g.agentTabSwitchCatchUp.spec.ts) in this sandbox either, for the same reason: they passobjectInfo: 'server', which requires a live ComfyUI backend behindDEV_SERVER_COMFYUI_URLto 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 localexecutablePath, and seeing the exact same pre-existing tests fail to boot for the identical/api/object_inforeason). My new fixture works around this by providing its own minimal, schema-typed/api/object_infomock 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-agentservice or the realcomfy-multi-player-backed doc host — that would require standing up services this environment doesn't have; the repro instead runs the actualcomfy-multi-playernpm package's applier in-process (same package the production doc host runs), which is what the collision-resolution assertions are checked against.Review Focus
HostDoc.applyWirefor the agent's own (host-side) write as well as for the client's held batch: it is the same production applier either way, butapplyWire's doc frames it as the client path, so say if you would rather they stayed separate.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 fix(agent): keep live nodes displayed as saved through a catch-up reconcile #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?AGENT_RESERVED_BITrests on (comfy-cli'smint_id()always setting bit 40) is cited inidAllocation.ts's doc comment with a source permalink, and guarded at runtime inagentNodeMaterializer.ts— but is still only checkable by reading comfy-cli, not by this repo's own tests.Screenshots
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.attachartifacts on the runs above; happy to paste them inline here if useful.🤖 Generated with Claude Code
https://claude.ai/code/session_01CYUNXA5xHtJHMoNoaEayq6
Generated by Claude Code