Repository navigation
fix: don't sweep the agent canvas on a benign first-mint CRDT reset - #18403
claude[bot] wants to merge 14 commits into
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 |
🎭 Playwright: ✅ 2156 passed, 0 failed · 2 flaky📊 Browser Reports
🌾 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 888e079ea9999bbde7aadb0e58eb9c848c84590d
Full docs: ADR-DEVEX-LINT-0015 🎨 Storybook: ✅ Built — View Storybook🧩 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 📦 Bundle: 10 MB gzipDetailsSummary
Category Glance App Entry Points — 3.77 kBMain entry bundles and manifests
Status: 1 added Graph Workspace — 1.45 MBGraph editor runtime, canvas, workflow orchestration
Status: 3 added Views & Navigation — 133 kBTop-level views, pages, and routed surfaces
Status: 18 added Panels & Settings — 643 kBConfiguration panels, inspectors, and settings screens
Status: 28 added User & Accounts — 39.4 kBAuthentication, profile, and account management bundles
Status: 11 added Editors & Dialogs — 126 kBModals, dialogs, drawers, and in-app editors
Status: 8 added UI Components — 125 kBReusable component library chunks
Status: 16 added Data & Services — 4.05 MBStores, services, APIs, and repositories
Status: 15 added Utilities & Hooks — 582 kBHelpers, composables, and utility bundles
Status: 37 added Vendor & Third-Party — 17.4 MBExternal libraries and shared vendor chunks
Status: 18 added Other — 17.9 MBBundles that do not match a named category
Status: 300 added ⚡ Performance Report
Show regressions
All metrics
Historical variance (last 15 runs)
Trend (last 15 commits on main)
Raw data{
"timestamp": "2026-09-29T08:35:12.899Z",
"gitSha": "c4ad9fc3acdaf3f8afdc58ebe53e8e326338f418",
"branch": "repro/agent-crdt-mint-reset-flicker",
"measurements": [
{
"name": "canvas-idle",
"durationMs": 2051.9590000000107,
"styleRecalcs": 11,
"styleRecalcDurationMs": 4.733,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 339.36400000000003,
"heapDeltaBytes": -10635716,
"heapUsedBytes": 68088940,
"domNodes": -228,
"jsHeapTotalBytes": -524288,
"scriptDurationMs": 12.491999999999999,
"eventListeners": -142,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "canvas-idle",
"durationMs": 2025.645000000054,
"styleRecalcs": 10,
"styleRecalcDurationMs": 4.395,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 441.463,
"heapDeltaBytes": -44445252,
"heapUsedBytes": 54017548,
"domNodes": -228,
"jsHeapTotalBytes": 3407872,
"scriptDurationMs": 7.841000000000001,
"eventListeners": -164,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66557377049181,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "canvas-mouse-sweep",
"durationMs": 1802.5450000000092,
"styleRecalcs": 74,
"styleRecalcDurationMs": 17.076,
"layouts": 12,
"layoutDurationMs": 4.333,
"taskDurationMs": 829.075,
"heapDeltaBytes": -4714288,
"heapUsedBytes": 74038292,
"domNodes": -228,
"jsHeapTotalBytes": 1048576,
"scriptDurationMs": 169.353,
"eventListeners": -164,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "canvas-mouse-sweep",
"durationMs": 1870.608999999945,
"styleRecalcs": 78,
"styleRecalcDurationMs": 18.539,
"layouts": 12,
"layoutDurationMs": 4.37,
"taskDurationMs": 838.179,
"heapDeltaBytes": -12826028,
"heapUsedBytes": 65873500,
"domNodes": -228,
"jsHeapTotalBytes": 0,
"scriptDurationMs": 170.72299999999998,
"eventListeners": -142,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66607142857143,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "canvas-zoom-sweep",
"durationMs": 1731.2779999999748,
"styleRecalcs": 33,
"styleRecalcDurationMs": 9.663,
"layouts": 6,
"layoutDurationMs": 1.1660000000000001,
"taskDurationMs": 325.506,
"heapDeltaBytes": 1522356,
"heapUsedBytes": 80297912,
"domNodes": 53,
"jsHeapTotalBytes": 3670016,
"scriptDurationMs": 11.559000000000003,
"eventListeners": 15,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.665384615384614,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "canvas-zoom-sweep",
"durationMs": 1749.2920000000822,
"styleRecalcs": 32,
"styleRecalcDurationMs": 11.506,
"layouts": 6,
"layoutDurationMs": 1.3510000000000002,
"taskDurationMs": 349.35499999999996,
"heapDeltaBytes": 1512428,
"heapUsedBytes": 80427780,
"domNodes": 53,
"jsHeapTotalBytes": 3932160,
"scriptDurationMs": 13.756999999999998,
"eventListeners": 15,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.665714285714284,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "dom-widget-clipping",
"durationMs": 711.4109999999982,
"styleRecalcs": 13,
"styleRecalcDurationMs": 4.171000000000001,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 456.809,
"heapDeltaBytes": -1928504,
"heapUsedBytes": 96809888,
"domNodes": 0,
"jsHeapTotalBytes": 7602176,
"scriptDurationMs": 166.798,
"eventListeners": 0,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.664285714285704,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "dom-widget-clipping",
"durationMs": 762.7519999999777,
"styleRecalcs": 13,
"styleRecalcDurationMs": 4.411,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 478.027,
"heapDeltaBytes": -3059640,
"heapUsedBytes": 95444792,
"domNodes": 0,
"jsHeapTotalBytes": 7602176,
"scriptDurationMs": 175.385,
"eventListeners": 0,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.668888888888876,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "dom-widget-order-dense-n200-w200-i120",
"durationMs": 1163.8799999999492,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 766.79,
"heapDeltaBytes": 6378184,
"heapUsedBytes": 83975632,
"domNodes": 0,
"jsHeapTotalBytes": 2523136,
"scriptDurationMs": 69.56,
"eventListeners": 0,
"totalBlockingTimeMs": 544,
"frameDurationMs": 34.31176470588234,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "dom-widget-order-dense-n200-w200-i120",
"durationMs": 1175.0279999999975,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 825.861,
"heapDeltaBytes": 9583500,
"heapUsedBytes": 85686016,
"domNodes": 0,
"jsHeapTotalBytes": 3571712,
"scriptDurationMs": 69.72,
"eventListeners": 0,
"totalBlockingTimeMs": 551,
"frameDurationMs": 34.8029411764706,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "dom-widget-order-sparse-n1000-w20-i120",
"durationMs": 847.054000000071,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 463.01699999999977,
"heapDeltaBytes": 15877208,
"heapUsedBytes": 90659172,
"domNodes": 0,
"jsHeapTotalBytes": 266240,
"scriptDurationMs": 159.18500000000003,
"eventListeners": 0,
"totalBlockingTimeMs": 225,
"frameDurationMs": 25,
"p95FrameDurationMs": 16.80000000000109
},
{
"name": "dom-widget-order-sparse-n1000-w20-i120",
"durationMs": 862.7749999999423,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 486.11999999999966,
"heapDeltaBytes": 16679752,
"heapUsedBytes": 90785988,
"domNodes": 0,
"jsHeapTotalBytes": 266240,
"scriptDurationMs": 169.663,
"eventListeners": 0,
"totalBlockingTimeMs": 242,
"frameDurationMs": 25.488235294117658,
"p95FrameDurationMs": 16.80000000000109
},
{
"name": "extension-clean-combined-draw",
"durationMs": 10894.970999999998,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 9848.42,
"heapDeltaBytes": -12651444,
"heapUsedBytes": 67504600,
"domNodes": 0,
"jsHeapTotalBytes": -13107200,
"scriptDurationMs": 8072.208,
"eventListeners": 0,
"totalBlockingTimeMs": 1314,
"frameDurationMs": 32.53582089552239,
"p95FrameDurationMs": 66.69999999999982
},
{
"name": "extension-clean-combined-draw",
"durationMs": 9100.53000000005,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 8466.425999999998,
"heapDeltaBytes": -13676408,
"heapUsedBytes": 66775764,
"domNodes": 0,
"jsHeapTotalBytes": -13107200,
"scriptDurationMs": 7155.126,
"eventListeners": 0,
"totalBlockingTimeMs": 1009,
"frameDurationMs": 34.8007662835249,
"p95FrameDurationMs": 66.60000000000036
},
{
"name": "extension-rgthree-prototype-draw",
"durationMs": 10595.726999999897,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 9560.939,
"heapDeltaBytes": -2033012,
"heapUsedBytes": 79330552,
"domNodes": 0,
"jsHeapTotalBytes": -5767168,
"scriptDurationMs": 7903.062,
"eventListeners": 0,
"totalBlockingTimeMs": 1298,
"frameDurationMs": 31.875903614457833,
"p95FrameDurationMs": 66.69999999999891
},
{
"name": "extension-rgthree-prototype-draw",
"durationMs": 10342.509999999947,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 9422.391999999998,
"heapDeltaBytes": -13612892,
"heapUsedBytes": 67642896,
"domNodes": 0,
"jsHeapTotalBytes": -13107200,
"scriptDurationMs": 7797.601000000001,
"eventListeners": 0,
"totalBlockingTimeMs": 1008,
"frameDurationMs": 31.94320987654321,
"p95FrameDurationMs": 50.100000000000364
},
{
"name": "large-graph-idle",
"durationMs": 2054.087000000095,
"styleRecalcs": 9,
"styleRecalcDurationMs": 6.5009999999999994,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 555.307,
"heapDeltaBytes": -35298008,
"heapUsedBytes": 83299428,
"domNodes": -228,
"jsHeapTotalBytes": -622592,
"scriptDurationMs": 27.746999999999993,
"eventListeners": -142,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.665040650406507,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "large-graph-idle",
"durationMs": 2055.0499999999374,
"styleRecalcs": 8,
"styleRecalcDurationMs": 3.139000000000003,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 589.645,
"heapDeltaBytes": -36519232,
"heapUsedBytes": 83128032,
"domNodes": -228,
"jsHeapTotalBytes": 163840,
"scriptDurationMs": 32.376000000000005,
"eventListeners": -142,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.665853658536584,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "large-graph-pan",
"durationMs": 2561.462000000006,
"styleRecalcs": 67,
"styleRecalcDurationMs": 10.582,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 1669.943,
"heapDeltaBytes": -31778512,
"heapUsedBytes": 88157336,
"domNodes": -228,
"jsHeapTotalBytes": 126976,
"scriptDurationMs": 839.987,
"eventListeners": -142,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.775657894736845,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "large-graph-pan",
"durationMs": 2536.6259999999556,
"styleRecalcs": 67,
"styleRecalcDurationMs": 8.923,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 1637.1609999999998,
"heapDeltaBytes": 19760004,
"heapUsedBytes": 82363056,
"domNodes": 0,
"jsHeapTotalBytes": 225280,
"scriptDurationMs": 845.876,
"eventListeners": 0,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666447368421053,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "large-graph-zoom",
"durationMs": 3691.94600000003,
"styleRecalcs": 63,
"styleRecalcDurationMs": 10.884999999999998,
"layouts": 60,
"layoutDurationMs": 13.923,
"taskDurationMs": 1728.012,
"heapDeltaBytes": 12266176,
"heapUsedBytes": 77695748,
"domNodes": 0,
"jsHeapTotalBytes": 0,
"scriptDurationMs": 811.669,
"eventListeners": 0,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666216216216213,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "large-graph-zoom",
"durationMs": 3714.7039999999834,
"styleRecalcs": 61,
"styleRecalcDurationMs": 10.459000000000003,
"layouts": 60,
"layoutDurationMs": 14.161999999999999,
"taskDurationMs": 1754.016,
"heapDeltaBytes": 8222644,
"heapUsedBytes": 72717012,
"domNodes": 0,
"jsHeapTotalBytes": 0,
"scriptDurationMs": 821.396,
"eventListeners": 0,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66591928251121,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "legacy-node-drag",
"durationMs": 3154.0259999999307,
"styleRecalcs": 42,
"styleRecalcDurationMs": 5.953,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 1972.8400000000001,
"heapDeltaBytes": 751480,
"heapUsedBytes": 64590552,
"domNodes": 0,
"jsHeapTotalBytes": 0,
"scriptDurationMs": 1006.4830000000001,
"eventListeners": 180,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.755080213903742,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "legacy-node-drag",
"durationMs": 3183.385000000044,
"styleRecalcs": 43,
"styleRecalcDurationMs": 6.0569999999999995,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 2009.7139999999997,
"heapDeltaBytes": 26001856,
"heapUsedBytes": 90016384,
"domNodes": 0,
"jsHeapTotalBytes": 417792,
"scriptDurationMs": 1022.837,
"eventListeners": 180,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.84232804232804,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "minimap-idle",
"durationMs": 2037.4400000000605,
"styleRecalcs": 6,
"styleRecalcDurationMs": 2.134999999999998,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 523.761,
"heapDeltaBytes": -36598864,
"heapUsedBytes": 84140040,
"domNodes": -228,
"jsHeapTotalBytes": -360448,
"scriptDurationMs": 28.798000000000005,
"eventListeners": -142,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66639344262295,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "minimap-idle",
"durationMs": 2055.6510000000117,
"styleRecalcs": 6,
"styleRecalcDurationMs": 2.929000000000001,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 600.7970000000001,
"heapDeltaBytes": -37677152,
"heapUsedBytes": 83404344,
"domNodes": -228,
"jsHeapTotalBytes": -622592,
"scriptDurationMs": 33.167,
"eventListeners": -142,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66639344262295,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "subgraph-dom-widget-clipping",
"durationMs": 614.8959999999306,
"styleRecalcs": 47,
"styleRecalcDurationMs": 6.348999999999998,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 393.897,
"heapDeltaBytes": 12417300,
"heapUsedBytes": 93839376,
"domNodes": 0,
"jsHeapTotalBytes": 4456448,
"scriptDurationMs": 145.13299999999998,
"eventListeners": 6,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "subgraph-dom-widget-clipping",
"durationMs": 618.739000000005,
"styleRecalcs": 47,
"styleRecalcDurationMs": 5.409999999999998,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 403.834,
"heapDeltaBytes": 12416056,
"heapUsedBytes": 93796892,
"domNodes": 0,
"jsHeapTotalBytes": 4456448,
"scriptDurationMs": 147.8,
"eventListeners": 6,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.664864864864875,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "subgraph-idle",
"durationMs": 2032.9649999999901,
"styleRecalcs": 10,
"styleRecalcDurationMs": 4.144,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 424.89099999999996,
"heapDeltaBytes": -23405040,
"heapUsedBytes": 57446304,
"domNodes": -244,
"jsHeapTotalBytes": 262144,
"scriptDurationMs": 7.140000000000001,
"eventListeners": -210,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666393442622944,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "subgraph-idle",
"durationMs": 2041.66500000008,
"styleRecalcs": 10,
"styleRecalcDurationMs": 3.9640000000000004,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 448.43499999999995,
"heapDeltaBytes": -10843668,
"heapUsedBytes": 69680720,
"domNodes": -244,
"jsHeapTotalBytes": -262144,
"scriptDurationMs": 7.382,
"eventListeners": -188,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.665853658536584,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "subgraph-mouse-sweep",
"durationMs": 1725.7609999999204,
"styleRecalcs": 75,
"styleRecalcDurationMs": 17.746,
"layouts": 16,
"layoutDurationMs": 6.001,
"taskDurationMs": 762.227,
"heapDeltaBytes": -21408544,
"heapUsedBytes": 59218852,
"domNodes": -244,
"jsHeapTotalBytes": 0,
"scriptDurationMs": 110.78,
"eventListeners": -188,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.6673076923077,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "subgraph-mouse-sweep",
"durationMs": 1717.1019999999544,
"styleRecalcs": 76,
"styleRecalcDurationMs": 18.554000000000002,
"layouts": 16,
"layoutDurationMs": 6.101999999999999,
"taskDurationMs": 730.482,
"heapDeltaBytes": 14541956,
"heapUsedBytes": 68072824,
"domNodes": 0,
"jsHeapTotalBytes": 0,
"scriptDurationMs": 117.40599999999999,
"eventListeners": 0,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666990291262135,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "subgraph-transition-enter",
"durationMs": 1384.5090000000937,
"styleRecalcs": 17,
"styleRecalcDurationMs": 29.318000000000005,
"layouts": 5,
"layoutDurationMs": 13.048,
"taskDurationMs": 857.8810000000001,
"heapDeltaBytes": 23241948,
"heapUsedBytes": 104636180,
"domNodes": 13667,
"jsHeapTotalBytes": 262144,
"scriptDurationMs": 29.799000000000007,
"eventListeners": 2383,
"totalBlockingTimeMs": 138,
"frameDurationMs": 19.718309859154928,
"p95FrameDurationMs": 16.80000000000109
},
{
"name": "viewport-pan-sweep",
"durationMs": 8654.47299999994,
"styleRecalcs": 249,
"styleRecalcDurationMs": 32.952999999999996,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 5919.711,
"heapDeltaBytes": -36328984,
"heapUsedBytes": 82811160,
"domNodes": -228,
"jsHeapTotalBytes": -167936,
"scriptDurationMs": 2816.125,
"eventListeners": -164,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.69825918762089,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "viewport-pan-sweep",
"durationMs": 9247.128999999972,
"styleRecalcs": 250,
"styleRecalcDurationMs": 33.499,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 6189.608,
"heapDeltaBytes": -35540204,
"heapUsedBytes": 83320368,
"domNodes": -228,
"jsHeapTotalBytes": 94208,
"scriptDurationMs": 3044.0669999999996,
"eventListeners": -164,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.696202531645568,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "vue-large-graph-idle",
"durationMs": 16289.404999999988,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 15421.373000000003,
"heapDeltaBytes": -49363140,
"heapUsedBytes": 175821056,
"domNodes": -3045,
"jsHeapTotalBytes": 6209536,
"scriptDurationMs": 241.94100000000003,
"eventListeners": -14915,
"totalBlockingTimeMs": 0,
"frameDurationMs": 28.228373702422147,
"p95FrameDurationMs": 50.100000000000364
},
{
"name": "vue-large-graph-idle",
"durationMs": 17350.03000000006,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 16862.276,
"heapDeltaBytes": 24460128,
"heapUsedBytes": 196707216,
"domNodes": -8049,
"jsHeapTotalBytes": -9961472,
"scriptDurationMs": 281.968,
"eventListeners": -14923,
"totalBlockingTimeMs": 0,
"frameDurationMs": 31.37653429602888,
"p95FrameDurationMs": 66.60000000000036
},
{
"name": "vue-large-graph-pan",
"durationMs": 20260.09099999999,
"styleRecalcs": 176,
"styleRecalcDurationMs": 16.814999999999998,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 19926.310999999998,
"heapDeltaBytes": -45081860,
"heapUsedBytes": 179311220,
"domNodes": -3045,
"jsHeapTotalBytes": 7352320,
"scriptDurationMs": 906.905,
"eventListeners": -14915,
"totalBlockingTimeMs": 47,
"frameDurationMs": 37.18495412844037,
"p95FrameDurationMs": 83.30000000000291
},
{
"name": "vue-large-graph-pan",
"durationMs": 20733.81500000005,
"styleRecalcs": 148,
"styleRecalcDurationMs": 17.405000000000005,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 20524.842999999997,
"heapDeltaBytes": -22072620,
"heapUsedBytes": 190793848,
"domNodes": -3042,
"jsHeapTotalBytes": 13561856,
"scriptDurationMs": 906.738,
"eventListeners": -14905,
"totalBlockingTimeMs": 66,
"frameDurationMs": 40.134042553191485,
"p95FrameDurationMs": 83.30000000000291
},
{
"name": "vue-node-resize-workload",
"durationMs": 5952.940000000012,
"styleRecalcs": 20,
"styleRecalcDurationMs": 81.02900000000002,
"layouts": 20,
"layoutDurationMs": 22.56100000000001,
"taskDurationMs": 5848.1140000000005,
"heapDeltaBytes": -12236080,
"heapUsedBytes": 216470460,
"domNodes": 0,
"jsHeapTotalBytes": 786432,
"scriptDurationMs": 107.006,
"eventListeners": 0,
"totalBlockingTimeMs": 363,
"frameDurationMs": 32.87127071823204,
"p95FrameDurationMs": 66.70000000000073
},
{
"name": "vue-node-resize-workload",
"durationMs": 6205.917999999997,
"styleRecalcs": 20,
"styleRecalcDurationMs": 82.05099999999999,
"layouts": 20,
"layoutDurationMs": 24.505,
"taskDurationMs": 6140.103,
"heapDeltaBytes": -5780948,
"heapUsedBytes": 205229864,
"domNodes": 0,
"jsHeapTotalBytes": 262144,
"scriptDurationMs": 114.355,
"eventListeners": 0,
"totalBlockingTimeMs": 457,
"frameDurationMs": 38.85187500000001,
"p95FrameDurationMs": 66.70000000000073
},
{
"name": "vue-zoom-out-idle",
"durationMs": 8339.398999999958,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 7956.808000000001,
"heapDeltaBytes": 17271752,
"heapUsedBytes": 186210948,
"domNodes": 0,
"jsHeapTotalBytes": -19136512,
"scriptDurationMs": 122.48499999999996,
"eventListeners": 0,
"totalBlockingTimeMs": 0,
"frameDurationMs": 29.445229681978798,
"p95FrameDurationMs": 50.10000000000218
},
{
"name": "vue-zoom-out-idle",
"durationMs": 6668.795000000046,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 6418.029,
"heapDeltaBytes": -32313396,
"heapUsedBytes": 199385016,
"domNodes": -3045,
"jsHeapTotalBytes": 11579392,
"scriptDurationMs": 118.80000000000001,
"eventListeners": -14915,
"totalBlockingTimeMs": 0,
"frameDurationMs": 23.089236111111113,
"p95FrameDurationMs": 50
},
{
"name": "workflow-execution",
"durationMs": 149.9549999999772,
"styleRecalcs": 9,
"styleRecalcDurationMs": 15.433,
"layouts": 4,
"layoutDurationMs": 2.323,
"taskDurationMs": 115.175,
"heapDeltaBytes": -16683940,
"heapUsedBytes": 80096992,
"domNodes": 115,
"jsHeapTotalBytes": 3932160,
"scriptDurationMs": 11.757,
"eventListeners": 17,
"totalBlockingTimeMs": 0,
"frameDurationMs": 18.737499999999955,
"p95FrameDurationMs": 33.19999999999982
},
{
"name": "workflow-execution",
"durationMs": 485.8190000002196,
"styleRecalcs": 20,
"styleRecalcDurationMs": 21.416999999999998,
"layouts": 4,
"layoutDurationMs": 2.176,
"taskDurationMs": 146.63299999999998,
"heapDeltaBytes": -14714904,
"heapUsedBytes": 82010376,
"domNodes": 126,
"jsHeapTotalBytes": 3932160,
"scriptDurationMs": 14.213000000000001,
"eventListeners": 81,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.665517241379316,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "agent-composer-empty-conversation-typing",
"durationMs": 1009.4120000001112,
"styleRecalcs": 78,
"styleRecalcDurationMs": 111.961,
"layouts": 76,
"layoutDurationMs": 23.52,
"taskDurationMs": 985.431,
"heapDeltaBytes": 19109456,
"heapUsedBytes": 88549536,
"domNodes": 76,
"jsHeapTotalBytes": 524288,
"scriptDurationMs": 412.005,
"eventListeners": 876,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66557377049181,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "agent-composer-empty-conversation-typing",
"durationMs": 1075.5269999999655,
"styleRecalcs": 78,
"styleRecalcDurationMs": 121.657,
"layouts": 76,
"layoutDurationMs": 26.458,
"taskDurationMs": 1052.723,
"heapDeltaBytes": 19606256,
"heapUsedBytes": 91241500,
"domNodes": 76,
"jsHeapTotalBytes": 524288,
"scriptDurationMs": 446.447,
"eventListeners": 876,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666153846153836,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "agent-composer-long-conversation-typing",
"durationMs": 1417.457000000013,
"styleRecalcs": 78,
"styleRecalcDurationMs": 249.618,
"layouts": 76,
"layoutDurationMs": 26.172,
"taskDurationMs": 1399.142,
"heapDeltaBytes": 8586424,
"heapUsedBytes": 120586364,
"domNodes": 76,
"jsHeapTotalBytes": 0,
"scriptDurationMs": 478.29499999999996,
"eventListeners": 876,
"totalBlockingTimeMs": 0,
"frameDurationMs": 17.707500000000003,
"p95FrameDurationMs": 33.29999999999927
},
{
"name": "agent-composer-long-conversation-typing",
"durationMs": 1442.4259999998412,
"styleRecalcs": 78,
"styleRecalcDurationMs": 248.351,
"layouts": 76,
"layoutDurationMs": 26.16,
"taskDurationMs": 1428.772,
"heapDeltaBytes": 546776,
"heapUsedBytes": 123716888,
"domNodes": -7945,
"jsHeapTotalBytes": -3448832,
"scriptDurationMs": 481.471,
"eventListeners": -1262,
"totalBlockingTimeMs": 0,
"frameDurationMs": 17.682926829268293,
"p95FrameDurationMs": 16.80000000000109
}
]
}🔬 E2E Coverage
Top 10 files by uncovered lines
|
…et sweep on first CRDT mint Adds failing (test.fail / it.fails) coverage pinning the bug: a workflow's first-ever agent turn triggers the backend's lazy CRDT doc mint, which broadcasts a doc_reset (actor: system:mint) to the already-subscribed follower with no accompanying doc_update. useAgentCrdtFollower's onDocReset calls AgentCrdtProjection.clearForReset unconditionally for any doc_reset, with no carve-out for this benign, content-free first-mint reset, so it sweeps already-rendered template nodes off the canvas. - browser_tests/tests/agent/agentFirstMintResetSweepsTemplate.spec.ts: e2e repro reusing agentPanelFixture/HostDoc/VueNodeHelpers patterns from the existing agent-CRDT specs. Loads a two-node template locally (no CRDT doc ever bound), drives the first agent turn through a system:mint doc_reset, and asserts (test.fail) the nodes stay visible. - src/workbench/extensions/agent/crdt/useAgentCrdtFollower.test.ts: adds a focused it.fails() case asserting a system:mint doc_reset should not call clearForReset, pinning the same gap at the composable level. No fix included; repro-only per this channel's workflow policy. Claude-Session: https://claude.ai/code/session_018MwRoaxpVReK7UMkaC5NxA
46e8287 to
6311428
Compare
Playwright videos for new testsDownload the recorded videos and HTML report Recorded projects: cloud Recorded test titles:
|
Codecov Report✅ All modified and coverable lines are covered by tests. @@ Coverage Diff @@
## main #18403 +/- ##
==========================================
+ Coverage 84.14% 84.99% +0.84%
==========================================
Files 3226 2333 -893
Lines 155836 133130 -22706
Branches 40278 34956 -5322
==========================================
- Hits 131131 113156 -17975
+ Misses 22977 19620 -3357
+ Partials 1728 354 -1374
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 896 files with indirect coverage changes 🚀 New features to boost your workflow:
|
A doc_reset/follower_replaced frame with actor system:mint means the backend just lazily created a brand-new CRDT doc for a workflow that had no prior CRDT-tracked content (cloud's ensureDoc). There is nothing for the follower to lose, so AgentCrdtProjection.clearForReset was sweeping already-rendered local content for no reason, causing a visible flicker. onDocReset and onFollowerReplaced in useAgentCrdtFollower.ts now skip the clearForReset call when the reset frame's actor is system:mint (the literal docFrameClient.ts's isValidActor already recognizes, promoted to an exported SYSTEM_MINT_ACTOR constant so both call sites and the actor-grammar check share it). Every other reset actor still sweeps as before. Flips the two repro tests (unit + e2e) from expected-fail to normal passing assertions now that the fix is in place.
Fallow flagged onDocReset (cyclomatic 10, CRAP 31.6) as a new finding introduced by b541f29's actor === SYSTEM_MINT_ACTOR skip-check. Pulled the event-detail parsing ternary into parseDocResetDetail, the RemoteMutationContext construction into buildDocResetContext, and the mint-actor-guarded clearForReset call into sweepProjectionUnlessMintActor. onDocReset now just sequences these calls; its own branch count drops from 10 to 4. onFollowerReplaced has the same actor check but sits at cyclomatic 8, under Fallow's gate, so it is left as-is.
This comment has been minimized.
This comment has been minimized.
…nt actor sweepProjectionUnlessMintActor skipped clearForReset whenever a doc_reset or follower_replaced event's actor was system:mint, regardless of whether the projection already held nodes for that workflow. The backend also mints mid-turn on a lineage break for a workflow that already has rendered content, attributing that reset to the same actor, so the skip was suppressing a sweep that needed to happen and leaving stale nodes on the canvas (agentCanvasBlanksDuringRunTurn.spec.ts). Narrow the skip to require the projection to currently have zero nodes for the workflow, via a new AgentCrdtProjection.hasNodes accessor backed by EcsFollowerAdapter's per-session node map. A true first-mint reset (agentFirstMintResetSweepsTemplate.spec.ts) still skips the sweep since nothing was ever tracked by the CRDT doc; a mid-turn mint reset on a workflow with existing doc content now sweeps as before.
There was a problem hiding this comment.
🔍 Cursor Review — Consolidated panel
Triggered by @christian-byrne.
Found 8 finding(s).
| Severity | Count |
|---|---|
| 🟠 High | 1 |
| 🟡 Medium | 4 |
| 🟢 Low | 2 |
| ⚪ Nit | 1 |
Panel: 8/8 reviewers contributed findings.
| } | ||
| projection.clearForReset(detail.workflowId, context) | ||
| sweepProjectionUnlessMintActor(detail.workflowId, detail.actor, detail.seq) | ||
| sender.abortAll() |
There was a problem hiding this comment.
🟢 Low — The mint carve-out suppresses only the projection clear; a first-mint reset still runs sender.abortAll(), fires events.onReset, and forces connected.value = false plus a resubscribe. If the user has in-flight local mutations when the first agent turn mints the doc, those sends are aborted by a frame this change declares lossless — confirm aborted ops are re-queued after resubscribe, or extend the skip to the remaining side effects.
Raised by 1 of 8 reviewers (kimi-k3-max edge-case).
There was a problem hiding this comment.
Not fixing this — it's out of scope for this PR.
sender.abortAll() runs on every doc_reset unconditionally, regardless of whether the sweep is skipped — that's pre-existing behavior this PR doesn't touch or introduce, and it's deliberate per OpSender.abortAll's own doc comment: "A doc_reset replaced the document these ops were minted against; the human-authored draft that caused it already carries their effect, so re-addressing them to the new lineage would apply them twice." The human's local canvas edit is applied optimistically before it's queued for wire delivery, so nothing about the local edit is lost when its send is aborted — only the wire sync of it is dropped, and it settles as 'unconfirmed'/'undeliverable' through the existing onBatchSettled notification path (same as any other lineage break), not silently.
Extending the skip to cover this would mean changing op-delivery/abort semantics for the general doc_reset case, not just the first-mint carve-out this PR is about, and risks the double-apply the existing comment warns against. Given the mint-skip fix here is specifically about not sweeping the canvas on a benign first mint, I think this is best tracked as its own investigation (whether aborted human ops should be automatically re-queued after any resubscribe, not just a mint one) rather than folded into this fix. Happy to file that as a follow-up if you'd like.
Generated by Claude Code
…its e2e regression test Cursor review findings on this PR flagged that useAgentCrdtFollower.ts made two independent, inconsistent skip decisions for the same lineage break: onDocReset checked actor + hasNodes (precise, but computed while the follower doc still held its pre-drop content), while onFollowerReplaced independently checked only the bare actor string, AFTER LayoutFollowerBridge had already dropped and replaced the doc with an empty one -- so any hasNodes-style check made there would always see zero nodes, and the two dispatch sites (subscribe() vs onDocReset) don't agree on what fields a follower_replaced detail carries. Consolidate to one decision, made once in onDocReset while the pre-drop doc is still readable, and reused by onFollowerReplaced for the immediately following follower_replaced from the same reset. A follower_replaced with no matching pending decision (LayoutFollowerBridge.subscribe's own dispatch on a deliberate workflow switch) still always sweeps, as before. This also removes the gate's dependency on the unenforced actor-shape contract between the two dispatch sites, since onFollowerReplaced no longer reads actor at all. Also corroborate the skip with the server's own seq (the lazy-mint broadcast is pinned at seq 1 per the backend's TestLazyMintBroadcastsDocResetToEarlyFollowers), so a reset that merely carries the advisory system:mint actor string no longer skips a sweep it shouldn't just because the local doc happens to be momentarily empty. Left the existing clearForReset/clearSemanticGraph full-graph clear as the fallback for every non-skip reset; scoping it to CRDT-projected entities only would be a materially larger refactor than this fix warrants now that the skip condition itself (actor + local hasNodes + server seq) is precise. Extracted SYSTEM_MINT_ACTOR into its own mintActor.ts module (re-used by docFrameClient.ts) so useAgentCrdtFollower.test.ts's docFrameClient mock no longer has to hand-copy the literal -- the composable now imports the real constant from a module the test never mocks. (importOriginal()/ vi.importActual() would have done the same thing more directly, but this repo's comfy/no-import-actual lint rule forbids both.) agentFirstMintResetSweepsTemplate.spec.ts: - Guard the mock ws.onMessage handler's JSON.parse so a malformed frame can't silently kill the subscribe ack and turn the test into a vacuous pass. - Replace the socket-open poll with a wait for the actual doc_subscribe frame for this workflow before sending the mint reset, so the reset can't race ahead of the subscription it needs to land on. - Replace the screenshot-as-timing-signal before the post-reset assertions with a wait for the resubscribe's doc_subscribe frame, a deterministic proof the reset was fully processed (LayoutFollowerBridge always drops-and-resubscribes on doc_reset regardless of the skip decision). useAgentCrdtFollower.test.ts: updated the reset/replace lifecycle test for the consolidated single-clear decision, added a test for a follower_replaced with no preceding doc_reset (still always clears), and a test for a system:mint reset at a non-1 seq (still clears despite zero local nodes).
The previous commit removed docFrameClient.ts's now-unused re-export of SYSTEM_MINT_ACTOR (Fallow flagged it as dead code), but left a comment here claiming that re-export still existed.
… tab app.loadGraphData(json, true, true) with no workflow argument always mints a brand new temporary tab (activateLoadedWorkflow's null branch never reuses the current one), so the direct loadGraphData call in this spec created a second "Unsaved Workflow (2)" tab holding the template nodes while the original empty "Unsaved Workflow" tab from app boot stayed open in the background. agentPanel.selectWorkflow() (default name "Unsaved Workflow", exact match) then switched to that first, empty tab -- clearing the just-rendered template nodes well before the CRDT follower ever binds or the mint doc_reset is sent. That is the assertion CI actually fails on (browser_tests/tests/agent/agentFirstMintResetSweepsTemplate.spec.ts:243, right after subscribeTracker.waitForCount(1), before doc_reset), not the post-reset assertion the mint-skip logic guards. Pass the boot-time active workflow into loadGraphData's 4th argument so the template load reuses that single tab, matching what agentPanel.selectWorkflow()'s default target actually opens.
christian-byrne
left a comment
There was a problem hiding this comment.
This is failing lint check
…MintResetSweepsTemplate
The prior fix (workflow.activeWorkflow ?? undefined as the 4th
loadGraphData arg) had no effect: bootAgentApp/waitForCloudApp only wait
for window.app.extensionManager to exist, not for GraphCanvas.vue's
onMounted -> useWorkflowPersistenceV2().initializeWorkflow() to finish
minting the boot-time "Unsaved Workflow" tab. The evaluate() callback ran
before that mint set workflowStore.activeWorkflow, so activeWorkflow was
still null and `?? undefined` collapsed to the exact same undefined the
original bug report was about -- still routing through
activateLoadedWorkflow's null-workflow branch and minting a duplicate
"Unsaved Workflow (2)" tab, which selectWorkflow('Unsaved Workflow') then
missed.
Wait for workflow.activeWorkflow to actually be populated before reading
it, closing the boot race so the template load reuses the real boot tab
instead of minting a second one.
…ker' into repro/agent-crdt-mint-reset-flicker
|
@christian-byrne Not a real lint failure in the diff. This branch was 63 commits behind main, and main's PR #18495 restructured the Merged main in (340869c), confirmed lint, typecheck, the CRDT unit tests, and Fallow all pass locally, and pushed. Generated by Claude Code |
…nstead of sweeping it A doc_reset no longer clears the canvas. It arms the projection so the new lineage's first frame, which carries its whole state, applies in replace mode: shared node ids are updated in place and live nodes and links the new document lacks are removed in the same change-tracker step. The backend's lazy first mint (system:mint) therefore no longer blanks a freshly opened template until the catch-up lands. Absorbs the reproductions from #18403 (first-mint sweep), #18116 (redo after undoing an agent edit), #18404 (delete_node and clear turns) and #18089 (widget typing versus a remote frame, pinned as a known defect). Amp-Thread-ID: https://ampcode.com/threads/T-01a0d248-f130-743a-a0a7-d90e3334772b
christian-byrne
left a comment
There was a problem hiding this comment.
Reviewed against current main (0f8c42c035) and against #18700 at 540a2b8d70. The bug is real and I traced it to the bottom; the concern is the mechanism and where it lives, not the diagnosis.
The bug, confirmed from source
AgentCrdtProjection.clearForReset() is adapter.clearForReset() plus reconcileLiveGraph(). The store half reaches graphMutations' clearSemanticGraph → nodeDataStore.clearOwner(scope), and clearOwner deletes every id in bucket.idsByOwner.get(owningGraphId) — there is no filter for "the agent put this here". The orphan sweep in reconcileLiveGraph then removes the live litegraph nodes that no longer have store state. So a doc_reset on a workflow whose CRDT doc holds nothing genuinely wipes the user's local template nodes off the canvas. Exactly as described.
That also means the safety argument for skipping is stronger than the PR states: when the doc has zero nodes, a sweep can only delete untracked local content. There is nothing CRDT-derived on the canvas for it to correctly remove.
Which leads to the main finding.
1. The seq === 1 conjunct is the one part that keeps a canvas-wipe path open
The skip is actor === SYSTEM_MINT_ACTOR && !projection.hasNodes(workflowId) && seq === 1.
hasNodes reads session.nodes, which is nodesMap(follower.doc) — a live view on the follower's Y.Doc. So !hasNodes is a direct statement that this doc has no content, and per the paragraph above it is by itself sufficient to make the sweep a pure loss. Adding seq === 1 does not make the decision safer; it makes it narrower, and the case it re-admits is a wipe: a system:mint reset arriving at seq > 1 on a zero-node doc still clears, and still has nothing but local content to clear.
The test a system:mint doc_reset at a non-1 seq still clears even when the doc has zero nodes pins that wipe as intended behaviour. The comment justifies it as "a mid-turn re-mint that happens to arrive while the doc is momentarily empty still doesn't qualify" — but if the doc is empty, the sweep destroys only untracked local nodes in that case too, which is the very failure this PR exists to stop.
So: what concrete state does seq === 1 protect that !hasNodes does not? If the answer is "none", dropping it makes the predicate both simpler and strictly safer, and the seq-7 test inverts to assert the skip. If there is a state, it belongs in that comment, because the conjunct currently reads as belt-and-braces while actually widening the blast radius.
2. Dropping the second clearForReset is a separate, unstated behaviour change
pendingResetSweepDecision is recorded whether or not the sweep was skipped, and onFollowerReplaced then suppresses its own clearForReset in both cases. Before this PR a doc_reset produced two clears (one with the doc-reset:<seq> context, one with follower-replaced:<id>); now it produces one.
I believe that is safe — both ran against the same session before projection.bind, and clearSemanticGraph is idempotent over the stores — but it is a change beyond the title's scope, and the edit to the existing test removes the only assertion covering the follower-replaced: context. Worth naming in the PR body so it is a decision rather than a side effect.
3. The handshake depends on two remote invariants; both hold, one is worth not depending on
Checked both:
LayoutFollowerBridge.onDocResetdoes dispatchdoc_reset→dropDocForNewLineage()→resubscribe()→follower_replaced, synchronously and unconditionally (layoutFollowerBridge.ts:369-377), so the decision is always consumed.isCurrentWorkflowand theonFollowerReplacedgate are the same predicate (isTargetActive.value && id === subscribedWorkflowId.value), so they cannot disagree between two synchronous dispatches.
Because of that, the leak I went looking for is not reachable today. But if either ever stops holding, a stranded pendingResetSweepDecision silently suppresses the next legitimate lineage sweep for that workflow — stale nodes from the old lineage on the canvas, which is the same failure class in the other direction. Clearing it at the top of onDocReset costs a line and removes the dependency.
4. Two things worth keeping as-is
- Extracting
SYSTEM_MINT_ACTORintomintActor.tspurely so a test that module-mocksdocFrameClient.tswholesale still exercises the real constant is the right call, and the comment saying so should survive any rework. - The browser spec waits on a counted second
doc_subscriberather than a screenshot or a timing proxy, and explains why that count is the deterministic post-reset signal. That is the part of this PR with the longest useful life.
Disposition: this is the one of the four I would not land, and the rewrite is the reason
Not "it lives in crdt/" — I diffed it. The counts in the list that parked this PR are wrong: it overlaps 6 of 7 files with #18700, not 2 of 7.
What that overlap actually contains:
crdt/ecsFollowerAdapter.ts, wherehasNodesis added, isremovedby #18700 (+0/−745). The predicate has nowhere to live after the refactor.browser_tests/tests/agent/agentFirstMintResetSweepsTemplate.spec.tsisaddedby #18700 as well — same path, sameWORKFLOW_ID/THREAD_ID/MESSAGE_ID, same two-MarkdownNotetemplate graph, condensed to 225 lines against a newloadIntoBootWorkflowfixture. So the acceptance pin for this behaviour is already on the refactor branch.- #18700 fixes it differently and without a heuristic. Its own header on that spec: "A reset now only arms the next frame to replace the graph, so the template nodes stay put." No actor check, no seq check, no
hasNodes.
So the user-visible property this PR protects is already carried, with its test, by the branch that deletes the file this PR's mechanism hangs on — while the mechanism itself is a fresh carve-out on the reconcile pass, deciding what was meant by inspecting end state. program/freeze-informal.md is explicit that landing another reconcile variant in this area is the thing the freeze exists to prevent, and this PR is already on that document's own extract-then-park list.
Recommendation: park or close this against #18700 rather than merge it, and treat the extraction as already done — the spec is on that branch. If the fix is needed on main before #18700 lands (the flicker is live at 5% exposure, which is a fair argument), it needs an exceptions row with a named owner and a stated post-refactor disposition, the same as #18404 and #18766 got — and findings 1 and 2 should be settled first, because 1 currently ships a remaining wipe path.
|
Pushed
Also updated the PR body with a note making explicit that collapsing Replied in-thread to all three review comments individually. Unit tests for Generated by Claude Code |
…-decision clear hasNodes is already a non-stale snapshot of CRDT-tracked content at the moment of doc_reset, so seq === 1 only narrowed the skip and could re-admit a wipe case. Also clear pendingResetSweepDecision defensively at the top of onDocReset so a hypothetical double doc_reset can't leave a stale suppression for follower_replaced to consume.
0adaee0 to
ba5d55c
Compare
…-reset-flicker # Conflicts: # src/workbench/extensions/agent/crdt/useAgentCrdtFollower.ts
…-reset-flicker # Conflicts: # src/workbench/extensions/agent/crdt/useAgentCrdtFollower.ts
|
The check This is judged a flake: the test failed all 4 attempts (original + 3 retries) with 4 different failure modes each time (assertion timeout, then app-not-ready/browser-closed, then wrong node count, then locator timeout), which is the classic flaky-test signature rather than a consistent failure. It's also in a completely disjoint area (tab/draft restoration) from this PR's diff, which only touches files under Re-running the job once to confirm. Generated by Claude Code |
|
Closing this PR as superseded by #18700, which merged main's own The one test case from this PR not already covered by main was ported to #19522. Generated by Claude Code |
…fy-Org#19522) PR Comfy-Org#18403 is being closed in favor of Comfy-Org#18700, whose `projection.replaceOnNextFrame()` mechanism fixes the same benign first-mint CRDT reset flicker more generally (any `doc_reset`, not just `system:mint`). I compared every test case Comfy-Org#18403 added, against its state right before the branch's last merge-from-main (commit `f6fcac1a76`), to what exists on `main` today: - `browser_tests/tests/agent/agentFirstMintResetSweepsTemplate.spec.ts` — main's version (via the add/add conflict resolution) is the same single repro test, just using the newer `loadIntoBootWorkflow` fixture helper. No coverage lost. - `src/workbench/extensions/agent/crdt/useAgentCrdtFollower.test.ts` — Comfy-Org#18403 added ~4 cases exercising the actor/seq/`hasNodes()`-based skip logic (`system:mint` seq 1 doesn't clear, mid-turn mint does clear, non-1-seq mint still skips when the doc has zero nodes, and a bare `follower_replaced` always clears). `Comfy-Org#18700` deleted that entire decision (`hasNodes`, `clearForReset`, the `system:mint` carve-out) and now calls `projection.replaceOnNextFrame()` unconditionally for every reset, deferring the actual graph swap until real frame data arrives. Three of the four cases only tested that now-deleted, actor/seq-specific branching and can't be meaningfully ported — asserting "does not clear for `system:mint`" would just be false against current code, and the general "reset defers replacement, doesn't clear immediately" behavior they were guarding is already covered by `arms a lineage replacement only for an explicit reset...` plus the `agentCrdtProjection.integration.test.ts` case `replaces the graph with the new lineage only when its first frame arrives after a reset`. The fourth case — a `follower_replaced` with **no preceding `doc_reset`** (a deliberate workflow switch) still independently rebinding/clearing — turned out to be a real gap: every current test that dispatches `follower_replaced` does so right after a `doc_reset`, so the bare-switch path was untested in isolation even though main's `onFollowerReplaced` handles it unconditionally. This PR ports that one case, adapted to the current `projectionState`/`replaceOnNextFrame` mocks. Ran `pnpm vitest run src/workbench/extensions/agent/crdt/` locally: 56 files, 738 tests (737 passed, 1 pre-existing expected-fail), including the new case. Lint/typecheck ran clean via the repo's pre-commit hook. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_018MwRoaxpVReK7UMkaC5NxA --- _Generated by [Claude Code](https://claude.ai/code/session_018MwRoaxpVReK7UMkaC5NxA)_ Co-authored-by: Claude <noreply@anthropic.com>
Requested by Christian Byrne · Slack thread
Summary
Fixes a confirmed bug: opening a template workflow that has never had an agent session bound to it, then sending any agent turn (even a read-only one), made the canvas visually disappear and reappear a fraction of a second later. This PR now includes the fix, plus the two tests that pinned the bug, flipped from expected-fail to normal passing assertions.
Changes
useAgentCrdtFollower.ts'sonDocResetandonFollowerReplacednow skip the canvas-clearing sweep when the incoming reset frame's actor issystem:mint. The two repro tests — a Playwright e2e spec and a focused Vitest unit test — now assert the correct (non-sweeping) behavior directly, no longer markedtest.fail()/it.fails().Before
A user opens a template with nodes already visible on the canvas. They open the in-app agent and send it any message — even something read-only like "what does this workflow do?" The instant the agent's first turn starts, the whole canvas would go blank, then all the nodes would snap back roughly 0.3–0.5s later.
After
The same first turn on a never-bound template leaves the canvas undisturbed throughout; nothing flickers because a first-mint reset (no prior CRDT-tracked content to lose) no longer triggers the sweep.
Why
A workflow's very first agent turn makes the backend lazily create ("mint") that workflow's CRDT document and broadcast a
doc_resetto any follower that had already subscribed, with no accompanying content update — correct backend behavior, attributed to actorsystem:mint. The frontend code that handlesdoc_reset/follower_replacedwas clearing the live graph unconditionally, with no exception for this specific, content-free first-mint case, so it wiped nodes that were never CRDT-tracked to begin with.How
src/workbench/extensions/agent/crdt/docFrameClient.ts: promoted the'system:mint'literal (already recognized byisValidActor's actor grammar) to an exportedSYSTEM_MINT_ACTORconstant, so the fix and the wire-format check share one source of truth instead of two independent string literals.src/workbench/extensions/agent/crdt/useAgentCrdtFollower.ts:onDocResetandonFollowerReplacedeach now skip theirprojection.clearForReset(...)call when the reset frame'sactorisSYSTEM_MINT_ACTOR. Every other actor (a real lineage break) still sweeps exactly as before — bookkeeping (updatesApplied,confirmedDeletes, rebinding) is unchanged either way.src/workbench/extensions/agent/crdt/useAgentCrdtFollower.test.ts: theit.failscase asserting asystem:mintdoc_resetshould not callclearForResetis now a normal, passingit.browser_tests/tests/agent/agentFirstMintResetSweepsTemplate.spec.ts: removedtest.fail(); the spec now asserts the two template nodes genuinely stay visible across thesystem:mintreset frame, keeping the same screenshot capture as visual proof.Supporting evidence for reviewers
src/workbench/extensions/agent/crdt/agentCrdtProjection.ts:55-59—clearForResetstill sweeps the live graph when called; the fix is in whether it gets called, at the twouseAgentCrdtFollower.tscall sites.Comfy-Org/cloud, referenced for context, not modified here):services/agent/internal/loop/tabs.go:380-444(focusWorkflow),services/agent/internal/loop/crdt.go:2094-2096and:2191-2228(ensureDoc's lazy mint, actorsystem:mint), andservices/agent/internal/loop/crdt_premint_follower_test.go:15-55(TestLazyMintBroadcastsDocResetToEarlyFollowers, which pins that this reset carries no accompanyingdoc_update).Local verification
pnpm exec vue-tsc --noEmit(full repo typecheck) — clean.pnpm typecheck:browser— clean.pnpm exec eslint/pnpm exec oxlinton all changed files — clean.pnpm exec oxfmt --checkon all changed files — clean.pnpm exec vitest run src/workbench/extensions/agent/crdt/— 794 passed, 6 expected-fail (all pre-existing, unrelated to this change), 0 unexpected, 0 unexpected-fail.pnpm exec playwright test --list --project=cloud agentFirstMintResetSweepsTemplate— the spec is discovered and correctly routed into thecloudproject.Review Focus
useAgentCrdtFollower.tscall sites (rather than insideAgentCrdtProjection.clearForResetitself) is the right layer for this carve-out.doc_resetwithactor: 'system:mint', nodoc_update) faithfully matches the real early-follower mint broadcast.Screenshots (if applicable)
The e2e spec captures a screenshot (
template-after-mint-reset.png) right after thedoc_resetframe, as visual proof of the (non-)flicker once run in CI.Follow-up: review feedback addressed (commit 0adaee0)
seq === 1conjunct from the mint-reset skip condition.hasNodesis read synchronously before the pre-drop CRDT doc is replaced, so it is already a non-stale snapshot of tracked node count at the moment of the reset — theseqcheck only narrowed the skip and could re-admit a wipe case it wasn't needed for. Inverted the pinned unit test accordingly.pendingResetSweepDecision = nullat the top ofonDocReset, before it computes a new decision, as cheap robustness against a hypothetical future doubledoc_reset.clearForResetcalls (one fromdoc_reset, one from the immediately-followingfollower_replaced) into one shared decision (pendingResetSweepDecision). This is deliberate:doc_resetandfollower_replacedfire synchronously back-to-back for the same reset, so ifonFollowerReplaceddidn't reuse theonDocResetskip decision, it would immediately re-run its own unconditional sweep and undo the skip a moment later — reintroducing the exact flicker this PR fixes.🤖 Generated with Claude Code
https://claude.ai/code/session_018MwRoaxpVReK7UMkaC5NxA
Generated by Claude Code