Repository navigation
fix(agent): don't let CRDT reconcile clobber a fresher live widget value - #18361
Conversation
…565/PM-1268) Drops the it.fails wrapper on the PM-1303/PM-1310 "hypothesis C" regression test in ecsFollowerAdapter.promptReconcile.test.ts. A catch-up reconcile (reconcileNode/reconcileNodeFields -> applyWidgetValues) still replays every widget from the doc snapshot unconditionally, so it clobbers a prompt the user just typed with the doc's stale, pre-edit value. This commit makes the existing regression genuinely fail in CI; the fix follows in the next commit. Claude-Session: https://claude.ai/code/session_01BikjqCAiAR4ezQorLJxxfv
Widgets whose live value last changed without a RemoteMutationContext (a human edit, or any write that bypassed setValue's context param) are now tracked as "locally dirty" in widgetValueStore.ts. A plain node's reconcileNode -> applyWidgetValues (graphMutations.ts) skips writing a dirty widget instead of blindly replaying the doc's stale snapshot over it, then clears the mark: the skip is one-shot protection against the snapshot that predated the edit, not a standing block on ever picking up a later, genuinely newer remote value. An explicit single-widget setWidget op is unaffected, since it never goes through applyWidgetValues. The guard is deliberately left off reconcileNodeFields (used only for subgraph hosts): a host's promoted widgets are wired by SubgraphNode's own projection (promotedWidgetStoreProjection.ts), which writes them directly (no RemoteMutationContext) as a routine, structural part of attaching the host - not a human edit - so the same "no context" signal would misfire there and was confirmed to regress the agentSubgraphFollower host-widget suite in testing. Extracts the addNode/reconcileNode/replaceNode branch of commit() into its own commitUpsertNode() helper to keep commit()'s cyclomatic complexity down, and adds direct unit-test coverage of the new guard branches in graphMutations.test.ts (the one-shot skip-then-trust-again behavior, and reconcileNodeFields's deliberate non-guarding). Also adds a second regression case (Jo Zhang's report, PM-1524): editing an existing node's prompt directly, with no generation and no progress-text widget in the picture, hits the same clobber. Fixes PM-1565 (child of PM-1268); this is the PM-1303/PM-1310 "hypothesis C" mechanism. Claude-Session: https://claude.ai/code/session_01BikjqCAiAR4ezQorLJxxfv
|
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 |
🌾 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. Fallow gates on new findings in changed files only, so everything below was introduced or moved by this PR (14 changed files).
Pre-existing findings are baselined in Reproduce locally# the base the gate compared against
npx fallow audit --root . --quiet --format json \
--changed-since f34a7bf24a988127b06efd08a0a92861d9f18b6c
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 🎭 Playwright: ✅ 2092 passed, 0 failed · 1 flaky📊 Browser Reports
📦 Bundle: 9.96 MB gzip 🔴 +1.14 kBDetailsSummary
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 — 123 kB (baseline 123 kB) • ⚪ 0 BReusable component library chunks
Status: 7 added / 7 removed / 9 unchanged Data & Services — 3.91 MB (baseline 3.91 MB) • 🔴 +3.87 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-22T10:57:22.614Z",
"gitSha": "c3bd47cfb44d59dc6ac23943036c806bb538987b",
"branch": "fix/agent-crdt-reconcile-clobbers-live-widget-v2",
"measurements": [
{
"name": "canvas-idle",
"durationMs": 1992.5289999999904,
"styleRecalcs": 10,
"styleRecalcDurationMs": 8.389,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 476.22900000000004,
"heapDeltaBytes": 10696852,
"heapUsedBytes": 78025836,
"domNodes": -260,
"jsHeapTotalBytes": 4972544,
"scriptDurationMs": 10.287,
"eventListeners": -152,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "canvas-idle",
"durationMs": 2024.2159999999103,
"styleRecalcs": 10,
"styleRecalcDurationMs": 8.437,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 465.68300000000005,
"heapDeltaBytes": 8453676,
"heapUsedBytes": 75830680,
"domNodes": -259,
"jsHeapTotalBytes": 4448256,
"scriptDurationMs": 11.067,
"eventListeners": -152,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "canvas-mouse-sweep",
"durationMs": 1742.840000000001,
"styleRecalcs": 46,
"styleRecalcDurationMs": 14.770999999999999,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 769.563,
"heapDeltaBytes": 11802916,
"heapUsedBytes": 78858768,
"domNodes": -261,
"jsHeapTotalBytes": 6283264,
"scriptDurationMs": 142.318,
"eventListeners": -152,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "canvas-mouse-sweep",
"durationMs": 1741.4800000000241,
"styleRecalcs": 45,
"styleRecalcDurationMs": 14.504999999999999,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 786.173,
"heapDeltaBytes": -4978836,
"heapUsedBytes": 62580684,
"domNodes": -259,
"jsHeapTotalBytes": 7331840,
"scriptDurationMs": 142.95,
"eventListeners": -174,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "canvas-zoom-sweep",
"durationMs": 1739.9699999999712,
"styleRecalcs": 32,
"styleRecalcDurationMs": 15.441999999999998,
"layouts": 6,
"layoutDurationMs": 1.3110000000000002,
"taskDurationMs": 350.765,
"heapDeltaBytes": 3175860,
"heapUsedBytes": 70663700,
"domNodes": 78,
"jsHeapTotalBytes": 6029312,
"scriptDurationMs": 13.881,
"eventListeners": 15,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.699999999999818
},
{
"name": "canvas-zoom-sweep",
"durationMs": 1691.6529999999739,
"styleRecalcs": 28,
"styleRecalcDurationMs": 15.796999999999999,
"layouts": 6,
"layoutDurationMs": 1.365,
"taskDurationMs": 345.562,
"heapDeltaBytes": 2134340,
"heapUsedBytes": 64643632,
"domNodes": 76,
"jsHeapTotalBytes": 4718592,
"scriptDurationMs": 13.002000000000002,
"eventListeners": 15,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.699999999999818
},
{
"name": "dom-widget-clipping",
"durationMs": 663.3160000000089,
"styleRecalcs": 13,
"styleRecalcDurationMs": 10.238999999999999,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 437.812,
"heapDeltaBytes": 18946672,
"heapUsedBytes": 86292220,
"domNodes": 22,
"jsHeapTotalBytes": 5505024,
"scriptDurationMs": 154.875,
"eventListeners": 0,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "dom-widget-clipping",
"durationMs": 662.6999999999725,
"styleRecalcs": 11,
"styleRecalcDurationMs": 7.875,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 425.856,
"heapDeltaBytes": 18803644,
"heapUsedBytes": 80169020,
"domNodes": 18,
"jsHeapTotalBytes": 5242880,
"scriptDurationMs": 151.077,
"eventListeners": 0,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "dom-widget-order-dense-n200-w200-i120",
"durationMs": 1207.9160000000115,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 891.5550000000001,
"heapDeltaBytes": -17498600,
"heapUsedBytes": 72509400,
"domNodes": -295,
"jsHeapTotalBytes": 20840448,
"scriptDurationMs": 66.03399999999999,
"eventListeners": -217,
"totalBlockingTimeMs": 540,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "dom-widget-order-dense-n200-w200-i120",
"durationMs": 1122.6680000000897,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 781.457,
"heapDeltaBytes": 39000296,
"heapUsedBytes": 103610664,
"domNodes": -295,
"jsHeapTotalBytes": 18509824,
"scriptDurationMs": 59.553999999999995,
"eventListeners": -195,
"totalBlockingTimeMs": 496,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "dom-widget-order-sparse-n1000-w20-i120",
"durationMs": 758.7790000000041,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 387.5790000000001,
"heapDeltaBytes": 14879596,
"heapUsedBytes": 91273928,
"domNodes": 0,
"jsHeapTotalBytes": 0,
"scriptDurationMs": 124.26599999999999,
"eventListeners": 0,
"totalBlockingTimeMs": 150,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "dom-widget-order-sparse-n1000-w20-i120",
"durationMs": 762.958000000026,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 368.538,
"heapDeltaBytes": 14929156,
"heapUsedBytes": 89921012,
"domNodes": 0,
"jsHeapTotalBytes": 0,
"scriptDurationMs": 123.23700000000001,
"eventListeners": 0,
"totalBlockingTimeMs": 153,
"frameDurationMs": 16.660000000000007,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "extension-clean-combined-draw",
"durationMs": 9025.742999999977,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 7877.167,
"heapDeltaBytes": -9400268,
"heapUsedBytes": 73258280,
"domNodes": -14,
"jsHeapTotalBytes": 5242880,
"scriptDurationMs": 6101.0689999999995,
"eventListeners": 0,
"totalBlockingTimeMs": 181,
"frameDurationMs": 18.890000000000025,
"p95FrameDurationMs": 33.400000000001455
},
{
"name": "extension-clean-combined-draw",
"durationMs": 9631.316999999966,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 8458.384,
"heapDeltaBytes": -13674644,
"heapUsedBytes": 68231780,
"domNodes": -14,
"jsHeapTotalBytes": 4194304,
"scriptDurationMs": 6660.932,
"eventListeners": 0,
"totalBlockingTimeMs": 104,
"frameDurationMs": 17.776666666666642,
"p95FrameDurationMs": 33.399999999999636
},
{
"name": "extension-rgthree-prototype-draw",
"durationMs": 9237.662,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 8314.996,
"heapDeltaBytes": 5083528,
"heapUsedBytes": 87592052,
"domNodes": -16,
"jsHeapTotalBytes": 11534336,
"scriptDurationMs": 6494.407000000001,
"eventListeners": 0,
"totalBlockingTimeMs": 153,
"frameDurationMs": 17.776666666666642,
"p95FrameDurationMs": 33.29999999999927
},
{
"name": "extension-rgthree-prototype-draw",
"durationMs": 9059.36100000008,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 8003.767,
"heapDeltaBytes": 1741592,
"heapUsedBytes": 84397376,
"domNodes": -14,
"jsHeapTotalBytes": 5242880,
"scriptDurationMs": 6257.291,
"eventListeners": 0,
"totalBlockingTimeMs": 73,
"frameDurationMs": 17.776666666666642,
"p95FrameDurationMs": 33.29999999999927
},
{
"name": "large-graph-idle",
"durationMs": 2033.425999999963,
"styleRecalcs": 8,
"styleRecalcDurationMs": 11.782,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 575.622,
"heapDeltaBytes": -4297292,
"heapUsedBytes": 83121612,
"domNodes": -242,
"jsHeapTotalBytes": -1019904,
"scriptDurationMs": 39.50299999999999,
"eventListeners": -152,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "large-graph-idle",
"durationMs": 2034.2269999999871,
"styleRecalcs": 9,
"styleRecalcDurationMs": 6.3119999999999985,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 577.541,
"heapDeltaBytes": -3297416,
"heapUsedBytes": 83895164,
"domNodes": -241,
"jsHeapTotalBytes": -1282048,
"scriptDurationMs": 35.77300000000001,
"eventListeners": -152,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.699999999999818
},
{
"name": "large-graph-pan",
"durationMs": 2345.091000000025,
"styleRecalcs": 66,
"styleRecalcDurationMs": 12.796999999999995,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 1611.9080000000001,
"heapDeltaBytes": 19782464,
"heapUsedBytes": 84016412,
"domNodes": -249,
"jsHeapTotalBytes": 1536000,
"scriptDurationMs": 800.7559999999999,
"eventListeners": -174,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "large-graph-pan",
"durationMs": 2299.3169999999736,
"styleRecalcs": 68,
"styleRecalcDurationMs": 15.348999999999998,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 1583.052,
"heapDeltaBytes": -12305588,
"heapUsedBytes": 76062740,
"domNodes": -250,
"jsHeapTotalBytes": 1826816,
"scriptDurationMs": 788.1069999999999,
"eventListeners": -174,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "large-graph-zoom",
"durationMs": 3712.2569999999655,
"styleRecalcs": 62,
"styleRecalcDurationMs": 13.888000000000002,
"layouts": 60,
"layoutDurationMs": 15.979000000000001,
"taskDurationMs": 1683.801,
"heapDeltaBytes": 8435220,
"heapUsedBytes": 74784976,
"domNodes": -252,
"jsHeapTotalBytes": 0,
"scriptDurationMs": 753.414,
"eventListeners": 0,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666636,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "large-graph-zoom",
"durationMs": 3716.058999999973,
"styleRecalcs": 68,
"styleRecalcDurationMs": 20.099000000000004,
"layouts": 60,
"layoutDurationMs": 16.185000000000002,
"taskDurationMs": 1738.6699999999998,
"heapDeltaBytes": 11229816,
"heapUsedBytes": 82002044,
"domNodes": 20,
"jsHeapTotalBytes": 0,
"scriptDurationMs": 778.932,
"eventListeners": 0,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "legacy-node-drag",
"durationMs": 3141.215000000045,
"styleRecalcs": 45,
"styleRecalcDurationMs": 9.154999999999996,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 1893.67,
"heapDeltaBytes": 26359948,
"heapUsedBytes": 92202304,
"domNodes": -246,
"jsHeapTotalBytes": 1204224,
"scriptDurationMs": 931.0909999999999,
"eventListeners": 180,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666696,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "legacy-node-drag",
"durationMs": 3105.318000000011,
"styleRecalcs": 44,
"styleRecalcDurationMs": 8.399000000000001,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 1868.7849999999999,
"heapDeltaBytes": 22124484,
"heapUsedBytes": 88435364,
"domNodes": -249,
"jsHeapTotalBytes": 679936,
"scriptDurationMs": 934.315,
"eventListeners": 180,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "minimap-idle",
"durationMs": 2025.1800000000912,
"styleRecalcs": 7,
"styleRecalcDurationMs": 5.884,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 574.7200000000001,
"heapDeltaBytes": -5093640,
"heapUsedBytes": 84008792,
"domNodes": -246,
"jsHeapTotalBytes": -233472,
"scriptDurationMs": 36.62800000000001,
"eventListeners": -152,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "minimap-idle",
"durationMs": 2058.0469999999877,
"styleRecalcs": 9,
"styleRecalcDurationMs": 7.806,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 590.4939999999999,
"heapDeltaBytes": -8488480,
"heapUsedBytes": 79210280,
"domNodes": -249,
"jsHeapTotalBytes": 28672,
"scriptDurationMs": 34.19599999999999,
"eventListeners": -174,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "subgraph-dom-widget-clipping",
"durationMs": 591.664000000037,
"styleRecalcs": 48,
"styleRecalcDurationMs": 10.820000000000002,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 393.997,
"heapDeltaBytes": 14078708,
"heapUsedBytes": 83599140,
"domNodes": 22,
"jsHeapTotalBytes": 4980736,
"scriptDurationMs": 138.751,
"eventListeners": 6,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "subgraph-dom-widget-clipping",
"durationMs": 556.3429999999698,
"styleRecalcs": 48,
"styleRecalcDurationMs": 10.254999999999999,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 377.48900000000003,
"heapDeltaBytes": 13999308,
"heapUsedBytes": 83921640,
"domNodes": 22,
"jsHeapTotalBytes": 5505024,
"scriptDurationMs": 131.39199999999997,
"eventListeners": 6,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333335,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "subgraph-idle",
"durationMs": 2019.7650000000067,
"styleRecalcs": 12,
"styleRecalcDurationMs": 7.798000000000001,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 467.117,
"heapDeltaBytes": -14669884,
"heapUsedBytes": 55167148,
"domNodes": -273,
"jsHeapTotalBytes": 4972544,
"scriptDurationMs": 10.036999999999997,
"eventListeners": -198,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.699999999999818
},
{
"name": "subgraph-idle",
"durationMs": 2023.1210000000601,
"styleRecalcs": 11,
"styleRecalcDurationMs": 8.163000000000002,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 467.987,
"heapDeltaBytes": -6087176,
"heapUsedBytes": 63451488,
"domNodes": -276,
"jsHeapTotalBytes": 5758976,
"scriptDurationMs": 9.973000000000003,
"eventListeners": -220,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.699999999999818
},
{
"name": "subgraph-mouse-sweep",
"durationMs": 1708.7099999999964,
"styleRecalcs": 45,
"styleRecalcDurationMs": 14.678999999999998,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 738.5550000000001,
"heapDeltaBytes": -6863660,
"heapUsedBytes": 62905308,
"domNodes": -276,
"jsHeapTotalBytes": 5758976,
"scriptDurationMs": 99.755,
"eventListeners": -220,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "subgraph-mouse-sweep",
"durationMs": 1708.077000000003,
"styleRecalcs": 45,
"styleRecalcDurationMs": 14.689,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 764.1170000000001,
"heapDeltaBytes": -2359804,
"heapUsedBytes": 60737684,
"domNodes": -277,
"jsHeapTotalBytes": 4972544,
"scriptDurationMs": 103.465,
"eventListeners": -230,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "subgraph-transition-enter",
"durationMs": 1366.9049999999743,
"styleRecalcs": 17,
"styleRecalcDurationMs": 25.702999999999996,
"layouts": 5,
"layoutDurationMs": 10.38,
"taskDurationMs": 865.8910000000002,
"heapDeltaBytes": -6200560,
"heapUsedBytes": 81743972,
"domNodes": 13667,
"jsHeapTotalBytes": 11272192,
"scriptDurationMs": 32.789,
"eventListeners": 2383,
"totalBlockingTimeMs": 132,
"frameDurationMs": 16.666666666666696,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "viewport-pan-sweep",
"durationMs": 8492.106999999976,
"styleRecalcs": 250,
"styleRecalcDurationMs": 43.973000000000006,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 5760.675,
"heapDeltaBytes": 18298424,
"heapUsedBytes": 82086296,
"domNodes": -240,
"jsHeapTotalBytes": 225280,
"scriptDurationMs": 2724.2540000000004,
"eventListeners": -152,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "viewport-pan-sweep",
"durationMs": 8455.964000000109,
"styleRecalcs": 251,
"styleRecalcDurationMs": 45.43600000000001,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 5615.733,
"heapDeltaBytes": -5874080,
"heapUsedBytes": 80594272,
"domNodes": -239,
"jsHeapTotalBytes": 253952,
"scriptDurationMs": 2603.0679999999998,
"eventListeners": -152,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.80000000000109
},
{
"name": "vue-large-graph-idle",
"durationMs": 14547.911999999997,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 14283.428,
"heapDeltaBytes": -58443760,
"heapUsedBytes": 182367864,
"domNodes": -8061,
"jsHeapTotalBytes": -19861504,
"scriptDurationMs": 281.32,
"eventListeners": -14928,
"totalBlockingTimeMs": 0,
"frameDurationMs": 17.776666666666642,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "vue-large-graph-idle",
"durationMs": 14686.956999999893,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 14464.961,
"heapDeltaBytes": -49338956,
"heapUsedBytes": 176349156,
"domNodes": -8061,
"jsHeapTotalBytes": -14688256,
"scriptDurationMs": 232.31999999999996,
"eventListeners": -14928,
"totalBlockingTimeMs": 0,
"frameDurationMs": 17.223333333333358,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "vue-large-graph-pan",
"durationMs": 17953.99299999997,
"styleRecalcs": 127,
"styleRecalcDurationMs": 19.85099999999998,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 17807.737,
"heapDeltaBytes": -62809392,
"heapUsedBytes": 178221704,
"domNodes": -8062,
"jsHeapTotalBytes": -19075072,
"scriptDurationMs": 859.9010000000001,
"eventListeners": -14928,
"totalBlockingTimeMs": 15,
"frameDurationMs": 17.223333333333237,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "vue-large-graph-pan",
"durationMs": 17814.5209999999,
"styleRecalcs": 134,
"styleRecalcDurationMs": 22.84699999999998,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 17697.327999999998,
"heapDeltaBytes": -24219352,
"heapUsedBytes": 189207088,
"domNodes": -8061,
"jsHeapTotalBytes": -10612736,
"scriptDurationMs": 865.228,
"eventListeners": -14928,
"totalBlockingTimeMs": 23,
"frameDurationMs": 17.780000000000047,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "vue-node-resize-workload",
"durationMs": 5320.57599999996,
"styleRecalcs": 20,
"styleRecalcDurationMs": 72.138,
"layouts": 20,
"layoutDurationMs": 26.77800000000001,
"taskDurationMs": 5257.86,
"heapDeltaBytes": -24998836,
"heapUsedBytes": 192984268,
"domNodes": -8061,
"jsHeapTotalBytes": 13099008,
"scriptDurationMs": 105.979,
"eventListeners": -14928,
"totalBlockingTimeMs": 305,
"frameDurationMs": 17.223333333333358,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "vue-node-resize-workload",
"durationMs": 5411.504000000036,
"styleRecalcs": 20,
"styleRecalcDurationMs": 68.98599999999999,
"layouts": 20,
"layoutDurationMs": 25.401000000000007,
"taskDurationMs": 5366.351999999999,
"heapDeltaBytes": -25195824,
"heapUsedBytes": 194039484,
"domNodes": -8061,
"jsHeapTotalBytes": 13885440,
"scriptDurationMs": 103.345,
"eventListeners": -14928,
"totalBlockingTimeMs": 242,
"frameDurationMs": 18.333333333333332,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "vue-zoom-out-idle",
"durationMs": 7198.305000000005,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 7087.442000000001,
"heapDeltaBytes": -30557588,
"heapUsedBytes": 163402088,
"domNodes": 0,
"jsHeapTotalBytes": -29884416,
"scriptDurationMs": 137.43800000000007,
"eventListeners": 0,
"totalBlockingTimeMs": 0,
"frameDurationMs": 17.223333333333237,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "vue-zoom-out-idle",
"durationMs": 7313.535999999999,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 7230.4760000000015,
"heapDeltaBytes": -14942712,
"heapUsedBytes": 164349920,
"domNodes": 0,
"jsHeapTotalBytes": -23068672,
"scriptDurationMs": 139.74400000000003,
"eventListeners": 0,
"totalBlockingTimeMs": 0,
"frameDurationMs": 17.779999999999927,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "workflow-execution",
"durationMs": 113.57999999995627,
"styleRecalcs": 8,
"styleRecalcDurationMs": 16.581,
"layouts": 3,
"layoutDurationMs": 1.526,
"taskDurationMs": 81.83400000000002,
"heapDeltaBytes": 3144196,
"heapUsedBytes": 68544880,
"domNodes": 131,
"jsHeapTotalBytes": 0,
"scriptDurationMs": 8.276999999999997,
"eventListeners": 17,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.799999999999727
},
{
"name": "workflow-execution",
"durationMs": 115.39400000003752,
"styleRecalcs": 8,
"styleRecalcDurationMs": 15.91,
"layouts": 4,
"layoutDurationMs": 2.1670000000000003,
"taskDurationMs": 80.70300000000003,
"heapDeltaBytes": 3017016,
"heapUsedBytes": 68583568,
"domNodes": 128,
"jsHeapTotalBytes": 262144,
"scriptDurationMs": 5.946999999999999,
"eventListeners": 17,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66666666666665,
"p95FrameDurationMs": 16.700000000000728
}
]
}🔬 E2E Coverage
Top 10 files by uncovered lines
|
Extracts the named/positional branches of applyWidgetValues (graphMutations.ts) into applyNamedWidgetValues/applyPositionalWidgetValues. applyWidgetValues itself was flagged as a new complexity finding (cyclomatic 10, CRAP 31.6, just over the 30.0 gate) after the previous commit; splitting the two loops out drops it back under the threshold without changing behavior. Verified locally with the CI bot's reproduce command: npx fallow audit --root . --quiet --format json --changed-since <base-sha> now reports verdict "pass" with complexity_introduced: 0. Claude-Session: https://claude.ai/code/session_01BikjqCAiAR4ezQorLJxxfv
Codecov Report❌ Patch coverage is
@@ Coverage Diff @@
## main #18361 +/- ##
==========================================
+ Coverage 83.34% 84.34% +0.99%
==========================================
Files 2985 2283 -702
Lines 147092 129940 -17152
Branches 39921 35113 -4808
==========================================
- Hits 122596 109593 -13003
+ Misses 23214 20052 -3162
+ Partials 1282 295 -987
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 710 files with indirect coverage changes 🚀 New features to boost your workflow:
|
This comment has been minimized.
This comment has been minimized.
… guard The one-shot locally-dirty guard added for PM-1565 only knows a write is "structural, not human" via a RemoteMutationContext. Two real replay paths write a widget's value directly with no context at all, so the guard misread them as local edits and then wrongly skipped the next legitimate catch-up reconcile: - agentNodeMaterializer's node.configure() catch-up, which can legitimately re-apply a stale positional snapshot before immediately correcting it. - A workflow load's LGraphNode.configure() (e.g. switching back to a tab) re-applying that tab's own locally-saved, pre-edit snapshot onto a widget already aliased to newer canonical state set while the tab was unbound. Adds a reentrant local-dirty-tracking suppression bracket to widgetValueStore (withLocalDirtyTrackingSuppressed for a synchronous callback, begin/end for pairing across an async boundary) and wires it into both replay paths: reconcileAgentAdapters, and agentPanel's existing beforeLoadGraph/afterConfigureGraph hooks (which already bracket mint-port echo suppression for the same window). Claude-Session: https://claude.ai/code/session_01BikjqCAiAR4ezQorLJxxfv
christian-byrne
left a comment
There was a problem hiding this comment.
Two release-blocking state-lifetime defects remain.
Full context for agent readers
The one-shot marker is consumed before the document necessarily reflects the local value, so a later full reconcile can replay the same stale snapshot. Separately, graph-load failure leaves the store-wide suppression depth positive because the success-only hook owns cleanup. Both can silently lose later user edits. Exact failure sequences and minimal corrections are anchored inline.
…, suppression can't leak Two release-blocking defects from review (Christian Byrne, PR #18361): 1. skipStaleReconcile cleared the locally-dirty marker on the first skipped reconcile, assuming only one stale full reconcile could happen before the genuinely newer value lands. It cannot: an unbound local edit that never minted, followed by a rejected duplicate-add echo re-arming full reconciliation, can deliver the same stale snapshot a second time, and the one-shot guard would let that second frame clobber the edit. The guard now only lets a reconcile through when its own candidate value already matches the widget's current one (the document has caught up, and that write - carrying a context - clears the mark itself); otherwise it keeps skipping and keeps the mark. An explicit single-widget setWidget op is unaffected, since it never goes through this guard. Dropped the now-dead clearLocallyDirty in favor of this. 2. agentPanel's beforeLoadGraph/afterConfigureGraph pairing left the local-dirty-tracking suppression counter leaked open forever if a graph load's configure() failed, or if any hook between beforeLoadGraph and afterConfigureGraph threw before either close hook ran. Every later context-less user edit would then be silently treated as structural and never marked dirty - reintroducing the original clobber bug for the rest of the session. Replaced the pair of raw begin/end calls with one idempotent open/close owner (a local flag) wired into beforeLoadGraph, afterConfigureGraph, and onGraphLoadError, so at most one suppression is ever outstanding regardless of how the load ends, and whichever close hook fires first fully releases it. Added regression tests: two stale full reconciles before the legitimate value lands (graphMutations.test.ts), and a failed load followed by a successful one proving ordinary dirty tracking resumes (agentPanel.test.ts). Claude-Session: https://claude.ai/code/session_01BikjqCAiAR4ezQorLJxxfv
…ves overlapping/early-failed loads Two release-blocking defects from review (Christian Byrne, PR #18361): 1. skipStaleReconcile compared the reconcile candidate against the widget's current value with Object.is. parseWidgetValues runs a fresh structuredClone over every object-typed candidate, so an object-valued widget's doc-parsed value is never the same instance as the widget's stored value, even once the document genuinely reflects it. Reference equality could then never see the two as equal, so the guard could never conclude the document had caught up, and the dirty mark would never clear except via an explicit setWidget. Switched to es-toolkit/compat's isEqual (already used elsewhere in this codebase for the same purpose), which handles primitives and objects alike. 2. agentPanel's widgetDirtySuppressionOpen was a single boolean, which assumed at most one load's suppression window is ever open. Two loads can genuinely overlap (e.g. two rapid tab switches): load A's beforeLoadGraph opens it, load B's beforeLoadGraph no-ops (already open), and whichever of A or B finishes first closes it while the other is still mid-configure, exposing that load's own structural writes as falsely dirty. Separately, any failure between beforeLoadGraph and rootGraph.configure (a malformed subgraph definition, a beforeConfigureGraph extension hook throwing, or a node-replacement load failure) reached neither afterConfigureGraph nor onGraphLoadError, leaking the suppression open forever. Replaced the boolean with a depth counter: beforeLoadGraph increments and opens the store's suppression only on the 0->1 transition; a completion decrements and closes it only once back at 0. To make sure every load's completion actually decrements, app.ts's loadGraphData now wraps the pre-configure steps (loadSubgraphs, beforeConfigureGraph, nodeReplacementStore.load, missing-node collection) in a try/catch that routes through the same onGraphLoadError notification the existing configure() catch uses, via a new shared reportGraphLoadFailure helper. Added regression tests: named and positional object-widget values through the reconcile guard (graphMutations.test.ts); two overlapping loads whose completions land in either order (agentPanel.test.ts); and a pre-configure extension-hook failure that now resolves false and notifies onGraphLoadError instead of leaking the suppression (app.test.ts). Claude-Session: https://claude.ai/code/session_01BikjqCAiAR4ezQorLJxxfv
# Conflicts: # src/workbench/extensions/agent/crdt/graphMutations.ts
…a failure path beforeLoadGraph opens the suppression, but the try/catch that closed it via onGraphLoadError only started at loadSubgraphs, well after several statements that can throw: the asset-scan reset, clean(), clone(), validateWorkflow(), and the reroute-migration check. Any of those failing left the suppression depth counter positive forever, so every later context-less user edit kept getting misread as structural and never marked dirty. Wrap the entire body between beforeLoadGraph and rootGraph.configure succeeding in one try/catch so every failure path routes through onGraphLoadError. Adds a regression test proving a validateWorkflow rejection specifically resolves false, notifies onGraphLoadError (not afterConfigureGraph), and that a subsequent load still completes normally. Claude-Session: https://claude.ai/code/session_01BikjqCAiAR4ezQorLJxxfv
b39fb0d to
6de9802
Compare
|
Exact head qualified for necessary source integration.
Full context for agent readersHead This admin merge uses Christian's existing necessary-source integration grant after substantive review and exact-tree compatibility verification. It does not claim a separate approval, restored runtime acceptance, deployment, or exposure. |
… during CRDT reconcile (#18423) Backport of [source PR 18361](#18361) to `cloud/1.54`. ## Summary Preserves a fresher live widget value when a stale CRDT catch-up reconcile arrives, and reliably closes local-dirty suppression after graph-load success or failure. ## Cloud adaptation - Applies local-dirty tracking to the release branch's separate widget-state and widget-render-state maps. - Preserves named, positional, repeated-stale-reconcile, object-value, explicit-write, deletion, and structural-replay regressions. - Wraps the release branch's full target-native pre-configure lifecycle so validation, extension, replacement-load, and related failures notify `onGraphLoadError` and resolve `false`. - Preserves the release branch's `clean !== false` behavior, asset resets, validation, reroute migration, subgraph loading, node replacement, missing-node collection, graph configuration, scaling, and final navigation-hash repair. - Omits the source branch's pre-existing Yjs projection integration test because its `AgentCrdtProjection` and `FollowerDoc` harness does not exist on `cloud/1.54`; the backported direct named and positional mutation regressions exercise the same stale-value guard on this target. ## Verification - Full unit suite: 21,421 passed, 6 expected failures, 7 skipped across 1,552 files. - Focused affected suites: 234 passed, 1 expected failure, 1 skipped. - Typecheck passed. - Normal commit hooks passed formatting, type-aware Oxlint, ESLint, and typecheck. - Normal pre-push Knip passed. - Working tree is clean, and the commit's parent is the current `cloud/1.54` target at publication time. This carrier does not claim deployment, runtime acceptance, or restored authenticated reload acceptance. Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com>
|
|
|
|
…ric ids (#18559) <!-- ccr-slack-attribution --> _Requested by **Christian Byrne** · [Slack thread](https://comfy-organization.slack.com/archives/C0BGH348Z0C/p1790058330774449?thread_ts=1790058330.774449&cid=C0BGH348Z0C)_ ## Summary Manual backport of the merged main fix (#18458): `insert_workflow` nodes no longer materialize without their links, on `core/1.54`. <details> <summary>Full context for agent readers</summary> ## Changes - Pins `@comfyorg/comfy-multi-player` to published npm version `0.3.4` (was `0.3.2`), which mints numeric link IDs for `insert_workflow` (Comfy-Org/comfy-multi-player#245). - Removes the now-obsolete `allowBuilds` codeload tarball entry from `pnpm-workspace.yaml` and adds `0.3.4` to `minimumReleaseAgeExclude`. - Adds a `core/1.54`-native regression test to the existing `ecsFollowerAdapter.integration.test.ts` proving a three-node inserted workflow batch stores canonical numeric link IDs and both links project onto the canvas. - Regenerated `pnpm-lock.yaml` via `pnpm install` (integrity hash for `0.3.4` matches the one already reviewed in #18549/#18552). ## Review focus This intentionally omits the main-branch-only `ecsFollowerAdapter.ts`/`resolveLinkId`/`resolveLinkMapKey`/`parseLinkId` hardening from #18458. That hardening depends on `parseLinkId`, which was introduced by the unrelated #18361 and is not present on `core/1.54`. It is not required to fix this bug: `core/1.54`'s `readSemanticLink` already accepts a genuine numeric link ID via its existing `Number(tuple[0])` / `Number.isInteger` check, so once `comfy-multi-player` mints real numeric IDs (0.3.4), the bug is fixed by the dependency bump alone. This mirrors the approach #18549 already took for `cloud/1.54` (see that PR's own "Review focus" section), which hit and resolved the identical conflict. Backport of #18458. Companion PRs doing the same dependency-pin cleanup: #18549 (`cloud/1.54`, already covers that branch) and #18552 (`main`). Verified locally: targeted regression test passes (16/16 in `ecsFollowerAdapter.integration.test.ts`), `pnpm typecheck` clean, `pnpm exec eslint`/`pnpm oxlint` on changed files clean. </details> Claude-Session: https://claude.ai/code/session_01UqyourCBfi97xzpBx2W7oY --- _Generated by [Claude Code](https://claude.ai/code/session_01UqyourCBfi97xzpBx2W7oY)_ --------- Co-authored-by: Claude <noreply@anthropic.com> Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com>
…during CRDT reconcile (#18536) Backports the [reported stale prompt reconciliation bug](https://linear.app/comfyorg/issue/PM-1524) fix to `core/1.54`. - Preserves fresher live widget values during CRDT catch-up. - Reuses the qualified `cloud/1.54` adaptation. - Local unit and type checks are green. <details><summary>Full context for agent readers</summary> Backport of [source PR 18361](#18361) via the target-adapted [Cloud carrier PR 18423](#18423). `core/1.54` contains the Agent panel and CRDT reconciliation path, and lacked this fix. The carrier preserves named and positional widget reconciliation, repeated stale replay handling, object-valued acknowledgements, explicit writes, deletions, structural replay, and graph-load success/failure cleanup. The only content difference from the merged Cloud carrier is the target branch's current import ordering in `graphMutations.test.ts`. Verification at head: - full unit suite: 21,375 passed, 7 expected failures, 7 skipped - focused affected suites: 235 passed, 1 expected failure, 1 skipped - `pnpm typecheck`: passed - oxfmt, type-aware Oxlint, and ESLint on changed files: no errors - `git diff --check`: passed This PR does not claim deployment or served-environment acceptance. </details> Co-authored-by: Amp <amp@ampcode.com>
|
|
|
|
…y-Org#18089) ## Summary Reproduces a defect where typing quickly into a text widget (e.g. a CLIP Text Encode "text" widget) can lose keystrokes when the agent's CRDT follower resyncs a widget mid-edit. **Update:** main has since merged Comfy-Org#18361, which fixed the `reconcileNode` (full-reconcile) path of this bug. That half of this PR's `graphMutations.test.ts` repro is now a passing `it()` on main (merged into this branch as-is). The plain `setWidget` op path is explicitly left unfixed by Comfy-Org#18361, so this PR's remaining scope is just that `it.fails` repro plus the Playwright e2e case below. ## Changes - **What**: `graphMutations.ts`'s `applyWidgetValues`/`setWidgetValue` overwrite a widget's stored value from the CRDT doc payload unconditionally — on both the full-reconcile path and the plain per-widget `setWidget` op. There is no per-field check for whether the live value is locally newer than the doc's copy, and the widget's DOM `<textarea>` (`WidgetGrid.vue` / `WidgetTextarea.vue`) binds straight to that store with no focus guard either. So any doc frame that happens to touch a widget's entry (a stale echo, a reconnect resync, or an unrelated full reconcile) can stomp a value the user is actively typing. - `src/workbench/extensions/agent/crdt/graphMutations.test.ts`: one remaining `it.fails` Vitest case proving the unconditional overwrite through the plain `setWidget` op — the missing guard lives in `setWidgetValue` itself. (The sibling case through `reconcileNode` is now fixed on main by Comfy-Org#18361 and passes.) - `browser_tests/tests/agent/agentWidgetTypingReconcile.spec.ts`: a `test.fail()` Playwright case using the agent-integration-replay harness. It replays a real recorded agent run that creates a prompt node and sets its text, then types into that same widget via real per-keystroke dispatch (`pressSequentially`, not `.fill()`) while one more doc frame resyncs the widget mid-keystroke, and asserts the full typed string survives. - `browser_tests/fixtures/agentConversationFixture.ts`: adds a small `resyncWidget(nodeId, widget)` helper to the shared replay harness that sends one more real `doc_update` (through the actual CRDT doc, not a fake) resyncing a widget to its current value — used to make the race deterministic instead of depending on incidental timing. - **Tests**: this PR *is* the test coverage (no production fix included yet for the `setWidget` path, by design — these are `test.fail()`/`it.fails()` repros). ## Review Focus - The Vitest cases were verified in a `vitest run` of the full file: the `reconcileNode` case now passes (fixed on main), the `setWidget` case still fails as expected (`it.fails`). The Playwright e2e case could **not** be executed in the sandbox this was authored in (no way to launch a matching Chromium build there) — please run it in CI/locally before relying on it; if it doesn't fail as written, that's worth a second look rather than assuming it's correct. - I was not able to pin down the exact production trigger that re-arms a full CRDT reconcile at the moment a widget resync lands (two candidates exist in the code: a rejected mutation batch arming reconcile for the next frame, or a follower rebind after a workflow-lineage change) — the e2e repro sidesteps this by sending an explicit resync frame via the new harness helper rather than depending on either trigger occurring naturally. - A real fix for the remaining `setWidget` path likely needs either a focus guard (skip/defer overwriting a widget's value while it has DOM focus) or a per-field "is the local edit newer" check in `setWidgetValue`. ## Screenshots (if applicable) The Playwright test attaches a screenshot of the widget after the race and a text diff of typed-vs-final value as test artifacts (not included here since the test wasn't run in this environment). --------- Co-authored-by: Claude <noreply@anthropic.com> Co-authored-by: GitHub Action <action@github.com> Co-authored-by: bymyself <cbyrne@comfy.org>
- export zComfyApiWorkflow from workflowSchema.ts (already exported on main) - fix @/platform/remote/comfyui/types import paths to @/schemas/apiSchema (that module doesn't exist on core/1.54) - wire up linkPresentationStore in graphMutations.ts and drop the guardLocalEdits arg (local-edit guard feature from unbackported #18361 isn't on this branch) - drop unused reconcileAutogrowInputs export (its only caller is in an unbackported PR's diff to agentNodeMaterializer.ts)
…s multiple autogrow groups (#18512) <!-- ccr-slack-attribution --> _Requested by **Christian Byrne** · [Slack thread](https://comfy-organization.slack.com/archives/C0BGH348Z0C/p1790128455751879?thread_ts=1789965317.152049&cid=C0BGH348Z0C)_ ## Summary Manual backport of #18275 to `core/1.54`, following the same pattern proven for the `cloud/1.54` backport (#18479). **STACKED ON #18509 — do not merge this before #18509 merges.** This branch is based on `backport-17221-to-core-1.54` (#18509's head), not on `origin/core/1.54` directly, because `core/1.54` proper still resolves agent CRDT inputs positionally and lacks the name-based input-targeting architecture from #17221 that #18275 builds directly on top of (`mergeInputSlotsByName`/`hasNonGrowthInputSetChange` in `graphMutations.ts`). Once #18509 merges into `core/1.54`, this PR's base should be retargeted/rebased onto `core/1.54` before merging. ## Conflict resolution notes - `browser_tests/fixtures/agentConversationFixture.ts`: dropped. Doesn't exist on this branch (added by still-unbackported #17875); nothing here imports it, including the new `agentCrdtMultiAutogrowRealign.spec.ts` (only comment references, no real import). - `src/lib/litegraph/src/LGraphCanvas.ts` (`selectItems`): kept this branch's existing body. The only diff was an unrelated `Array.from` → spread refactor from #17048's `ownsSelectable` filter, which isn't on this branch (`ownsSelectable` doesn't exist anywhere in `src/`). - `src/core/graph/widgets/dynamicWidgets.ts`, `AgentPanelRoot.vue`: additive conflicts, took the incoming side. Dropped an incoming `useSettingStore` import in `AgentPanelRoot.vue` (belongs to unbackported #17730, unused here). - `src/workbench/extensions/agent/crdt/graphMutations.ts`: took the new by-name `connect`/`commitUpsertNode` handlers wholesale (the actual fix). Uncovered missing dependency: `linkPresentationStore` (from unbackported #17875). Ported `src/types/linkPresentation.ts` and `src/stores/linkPresentationStore.ts` (+ unit test) from `main`, and wired `const linkPresentationStore = useLinkPresentationStore()`. - `graphMutations.test.ts`: same missing-dependency shape; `useLinkPresentationStore` import ended up unused in the test file, removed it. ## Additional gaps beyond the cloud/1.54 backport's notes (found and verified, not just copied) - `browser_tests/fixtures/agentFollowerHostSocket.ts` was missing (needed by the new `MultiAutogrowRealignHarness.ts`). Ported verbatim from `main`, which required exporting `DOC_PROTOCOL_VERSION` from `docFrameClient.ts` (it was a local `const`). - `commitUpsertNode`'s call to `applyWidgetValues` used a 5th `guardLocalEdits` argument that only exists on `main` via unbackported PR #18361 (the "local-edit guard" feature, already on `cloud/1.54` via #18423 but not on `core/1.54`). Dropped the extra argument to match this branch's existing 4-parameter `applyWidgetValues` — this guard is unrelated to #18275's actual fix (named-link realignment), so dropping it doesn't affect this PR's mechanism; it just means core/1.54 doesn't yet get #18361's separate improvement. - `zAutogrowOptions` import in `graphMutations.ts`: verified this already resolves fine — `@/schemas/nodeDefSchema` re-exports `@comfyorg/object-info-parser`, which already defines it. Not a gap. - `zComfyApiWorkflow` in `workflowSchema.ts` (used by the new `MultiAutogrowRealignHarness.ts`): wasn't exported on this branch (only `ComfyApiWorkflow` the type was). Exported it, matching how `main` already exports it. - `MultiAutogrowRealignHarness.ts` / `savedWorkflowPersistence.ts` imported `PromptResponse`/`UserDataFullInfo` from `@/platform/remote/comfyui/types`, a module that doesn't exist on this older branch. Both types live in `@/schemas/apiSchema` here; fixed the import paths. - `reconcileAutogrowInputs` (new additive export in `dynamicWidgets.ts`) has no caller on this branch — its only call site on `main` is in `agentNodeMaterializer.ts`, added by a separate, unbackported PR (not #18275's own diff, and not #17221's either). Dropped it as dead code rather than smuggling in that unrelated PR's wiring. ## Verification - `pnpm typecheck` — clean - `pnpm exec eslint` on all changed files — clean - `pnpm exec oxfmt --check` on all changed files — clean, all correctly formatted - `pnpm knip` — clean - `pnpm vitest run` on `graphMutations.test.ts`, `dynamicWidgets.test.ts`, `linkStore.test.ts`, `nodeDataStore.test.ts`, `linkPresentationStore.test.ts`, `crdtSession.test.ts`, `agentNodeMaterializer.multiAutogrow.test.ts` — 7 files, 198 passed / 1 expected fail - `pnpm exec playwright test --list` — collects cleanly, no `@e2e/fixtures` resolution errors (2237 tests / 367 files total, including the 2 new specs in `agentCrdtMultiAutogrowRealign.spec.ts`) --------- Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XqLXka9Jsg8EMTYmsnZjjv 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01XqLXka9Jsg8EMTYmsnZjjv --- _Generated by [Claude Code](https://claude.ai/code/session_01XqLXka9Jsg8EMTYmsnZjjv)_ --------- Co-authored-by: Ryan Di <ryan.weihao.di@gmail.com> Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com> Co-authored-by: bymyself <cbyrne@comfy.org> Co-authored-by: Amp <amp@ampcode.com> Co-authored-by: Claude <noreply@anthropic.com>
|
Release follow-up: direct cherry-picks conflict because the release branches have since diverged, but a source comparison confirms core/cloud 1.54 and 1.55 already contain the local-dirty widget guard and the guarded |
Requested by Christian Byrne · Slack thread
Supersedes #18347, whose branch history could not be corrected in place (removing a
Co-Authored-Bytrailer and reducing complexity both required rewriting already-pushed commits, which needs a force-push this session cannot perform). This PR has the same content on a clean, freshly-pushed branch. #18347 is being closed in favor of this one.Before
An agent (or a person) edits a node's prompt widget — for example a Flux.2 Image node's
textfield — and the canvas correctly shows the new prompt for a moment. Then, without any further action from the user, the box silently reverts to an old prompt from earlier in the session. Refreshing the page does not fix it, because the stale value lives in the same shared CRDT document that gets re-read on load.After
Editing a widget's live value, whether typed by a person or set by the agent, now survives the very next "catch-up" reconcile even when that reconcile's doc snapshot predates the edit. The widget keeps showing what was actually typed until a real remote write for that same widget lands.
How it works
ComfyUI_frontend's agent panel mirrors the shared workflow document into the canvas through an ECS-style CRDT follower (
ecsFollowerAdapter.ts/graphMutations.ts). A full reconcile runs on the first frame of a session and after any frame whose batch failed to commit — both are ordinary, frequent occurrences (opening a tab, an unrelated generation-progress heartbeat arriving right after a race). That reconcile'sapplyWidgetValuesreplayed every widget from the doc snapshot onto the live node unconditionally, with no check for whether the live value had already moved on. If the snapshot predated a just-typed prompt, the reconcile silently overwrote it.The fix adds a per-widget "locally dirty" marker in
widgetValueStore.ts: any value change that lands without aRemoteMutationContext(a human edit, or any write that bypasses the CRDT commit pipeline) marks that widget dirty; the next context-carrying write for that widget clears it.graphMutations.ts'sapplyWidgetValues, called from the plain-nodereconcileNodepath, now skips writing a widget that is marked dirty instead of blindly replaying the doc's value over it, then clears the mark — a one-shot protection against the one stale catch-up reconcile, not a standing block on ever picking up a later, genuinely newer remote value. An explicit, single-widgetsetWidgetop (an intentional remote write) is untouched, since it never goes throughapplyWidgetValues.The guard is deliberately not applied to
reconcileNodeFields(used only for subgraph hosts): a host's promoted widgets are wired bySubgraphNode's own projection (promotedWidgetStoreProjection.ts), which writes them directly with noRemoteMutationContextas a routine, structural part of attaching the host, not a human edit. Applying the same guard there was confirmed (via testing) to regress theagentSubgraphFollowerhost-widget suite, since host widgets never get any other kind of write to clear the mark.The
addNode/reconcileNode/replaceNodebranch ofgraphMutations.ts'scommit()was extracted into its owncommitUpsertNode()helper to keepcommit()'s complexity down, and direct unit tests were added ingraphMutations.test.tscovering the guard's one-shot skip-then-trust-again behavior andreconcileNodeFields's deliberate non-guarding.This is the PM-1303/PM-1310 "hypothesis C" mechanism: a pre-existing regression test (
ecsFollowerAdapter.promptReconcile.test.ts) already reproduced it end-to-end against a real Yjs doc and a real litegraph node, markedit.failsuntil now. A second case (Jo Zhang's report, PM-1524 — editing an existing node's prompt directly, no generation in flight) was added alongside it.Refs PM-1565 and its parent PM-1268.
Red-Green Verification
test: prove CRDT reconcile clobbers a fresher live widget valueit.fails, proving the regression test genuinely fails onmaintodayfix: don't let CRDT reconcile clobber a fresher live widget value🤖 Generated with Claude Code
https://claude.ai/code/session_01BikjqCAiAR4ezQorLJxxfv
Generated by Claude Code