Repository navigation
fix(agent): reconcile a hydrated streaming turn from REST after a refresh - #18154
Conversation
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. 🧰 Additional context used📚 Code guidelines (4)No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository: Comfy-Org/ComfyUI_frontend/.coderabbit.yaml Review profile: ASSERTIVE Plan: Team Run ID: 📒 Files selected for processing (4)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 4 remain after this review. Your free on-demand review promotion remains active until October 9, 2026 at 6:00 PM UTC. 📝 WalkthroughWalkthroughAgent session recovery now retains locally streamed replies when terminal history has no transcript parts and avoids deleting a replacement recovery job during cleanup. Tests cover recovery, page refresh, and remote-config setup. ChangesAgent Turn Recovery
Remote Config Test Setup
Priority: ⬇️ Low Estimated code review effort: 2 (Simple) | ~12 minutes Change: Bug fix Suggested reviewers: Merge Risk: ⚪ Minimal · up to This change keeps streamed replies visible after a refresh and avoids cancelling a replacement recovery job. No merge-blocking risk was identified. 🚥 Pre-merge checks | ✅ 7✅ Passed checks (7 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
🎭 Playwright: ✅ 2187 passed, 0 failed📊 Browser Reports
🎨 Storybook: ✅ Built — View Storybook📦 Bundle: 10.1 MB gzip 🔴 +2.04 MBDetailsSummary
Category Glance App Entry Points — 3.89 kB (baseline 3.64 kB) • 🔴 +251 BMain entry bundles and manifests
Status: 1 added / 1 removed Graph Workspace — 1.47 MB (baseline 1.25 MB) • 🔴 +220 kBGraph editor runtime, canvas, workflow orchestration
Status: 2 added / 1 removed / 1 shrank Views & Navigation — 135 kB (baseline 112 kB) • 🔴 +23.1 kBTop-level views, pages, and routed surfaces
Status: 17 added / 15 removed / 1 shrank Panels & Settings — 646 kB (baseline 551 kB) • 🔴 +94.8 kBConfiguration panels, inspectors, and settings screens
Status: 28 added / 26 removed User & Accounts — 53.6 kB (baseline 29.1 kB) • 🔴 +24.5 kBAuthentication, profile, and account management bundles
Status: 15 added / 10 removed Editors & Dialogs — 126 kB (baseline 121 kB) • 🔴 +4.87 kBModals, dialogs, drawers, and in-app editors
Status: 8 added / 6 removed UI Components — 184 kB (baseline 64.7 kB) • 🔴 +119 kBReusable component library chunks
Status: 18 added / 14 removed Data & Services — 4.13 MB (baseline 3.37 MB) • 🔴 +764 kBStores, services, APIs, and repositories
Status: 14 added / 17 removed Utilities & Hooks — 586 kB (baseline 357 kB) • 🔴 +228 kBHelpers, composables, and utility bundles
Status: 38 added / 35 removed Vendor & Third-Party — 17.2 MB (baseline 15.7 MB) • 🔴 +1.51 MBExternal libraries and shared vendor chunks
Status: 18 added / 16 removed Other — 18.3 MB (baseline 12.4 MB) • 🔴 +5.92 MBBundles that do not match a named category
Status: 194 added / 164 removed / 110 shrank / 1 unchanged ⚡ Performance Report
Show regressions
All metrics
Historical variance (last 15 runs)
Trend (last 15 commits on main)
Raw data{
"timestamp": "2026-10-02T00:46:55.469Z",
"gitSha": "15d340d9252d937ea7e33b768d08e9515e394109",
"branch": "fix/agent-reconcile-hydrated-streaming-turn",
"measurements": [
{
"name": "canvas-idle",
"durationMs": 2011.2149999999929,
"styleRecalcs": 11,
"styleRecalcDurationMs": 3.996999999999999,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 409.126,
"heapDeltaBytes": 348208,
"heapUsedBytes": 67133532,
"domNodes": 0,
"jsHeapTotalBytes": 0,
"scriptDurationMs": 8.027,
"eventListeners": 0,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666115702479342,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "canvas-idle",
"durationMs": 2012.0769999999766,
"styleRecalcs": 7,
"styleRecalcDurationMs": 2.8470000000000004,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 382.46399999999994,
"heapDeltaBytes": 22305808,
"heapUsedBytes": 76084932,
"domNodes": 0,
"jsHeapTotalBytes": 0,
"scriptDurationMs": 7.565000000000002,
"eventListeners": 0,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.665289256198346,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "canvas-mouse-sweep",
"durationMs": 1811.4039999999818,
"styleRecalcs": 76,
"styleRecalcDurationMs": 16.476,
"layouts": 12,
"layoutDurationMs": 4.0089999999999995,
"taskDurationMs": 793.499,
"heapDeltaBytes": -2993732,
"heapUsedBytes": 63763120,
"domNodes": 0,
"jsHeapTotalBytes": 262144,
"scriptDurationMs": 167.7,
"eventListeners": 0,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.665137614678898,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "canvas-mouse-sweep",
"durationMs": 1755.0099999999702,
"styleRecalcs": 75,
"styleRecalcDurationMs": 16.474,
"layouts": 12,
"layoutDurationMs": 4.038,
"taskDurationMs": 758.7080000000001,
"heapDeltaBytes": -2527056,
"heapUsedBytes": 64301540,
"domNodes": 0,
"jsHeapTotalBytes": 524288,
"scriptDurationMs": 155.513,
"eventListeners": 0,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.665714285714284,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "canvas-zoom-sweep",
"durationMs": 1726.6469999999572,
"styleRecalcs": 31,
"styleRecalcDurationMs": 10.019999999999998,
"layouts": 6,
"layoutDurationMs": 1.256,
"taskDurationMs": 320.906,
"heapDeltaBytes": -1383232,
"heapUsedBytes": 57971060,
"domNodes": 53,
"jsHeapTotalBytes": 0,
"scriptDurationMs": 10.360000000000001,
"eventListeners": 15,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666346153846156,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "canvas-zoom-sweep",
"durationMs": 1684.1349999999693,
"styleRecalcs": 31,
"styleRecalcDurationMs": 8.82,
"layouts": 6,
"layoutDurationMs": 1.2470000000000003,
"taskDurationMs": 322.919,
"heapDeltaBytes": 25250472,
"heapUsedBytes": 78867728,
"domNodes": -178,
"jsHeapTotalBytes": 0,
"scriptDurationMs": 10.22,
"eventListeners": 15,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "dom-widget-clipping",
"durationMs": 675.0640000000203,
"styleRecalcs": 9,
"styleRecalcDurationMs": 2.5500000000000003,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 429.0630000000001,
"heapDeltaBytes": 13911080,
"heapUsedBytes": 67654380,
"domNodes": 0,
"jsHeapTotalBytes": 0,
"scriptDurationMs": 161.92100000000002,
"eventListeners": 0,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.667500000000018,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "dom-widget-clipping",
"durationMs": 695.7830000000058,
"styleRecalcs": 12,
"styleRecalcDurationMs": 3.4850000000000003,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 437.99,
"heapDeltaBytes": -7953568,
"heapUsedBytes": 59797136,
"domNodes": 0,
"jsHeapTotalBytes": 0,
"scriptDurationMs": 162.302,
"eventListeners": 0,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66585365853659,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "dom-widget-order-dense-n200-w200-i120",
"durationMs": 1162.2820000000047,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 814.888,
"heapDeltaBytes": 14407184,
"heapUsedBytes": 91931448,
"domNodes": 0,
"jsHeapTotalBytes": 5668864,
"scriptDurationMs": 67.221,
"eventListeners": 0,
"totalBlockingTimeMs": 535,
"frameDurationMs": 34.31176470588234,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "dom-widget-order-dense-n200-w200-i120",
"durationMs": 1144.9140000000853,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 789.326,
"heapDeltaBytes": 14682012,
"heapUsedBytes": 92107452,
"domNodes": 0,
"jsHeapTotalBytes": 6717440,
"scriptDurationMs": 63.806000000000004,
"eventListeners": 0,
"totalBlockingTimeMs": 514,
"frameDurationMs": 33.8264705882353,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "dom-widget-order-sparse-n1000-w20-i120",
"durationMs": 846.5469999999868,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 463.9250000000001,
"heapDeltaBytes": 17590700,
"heapUsedBytes": 104470056,
"domNodes": 0,
"jsHeapTotalBytes": 790528,
"scriptDurationMs": 164.064,
"eventListeners": 0,
"totalBlockingTimeMs": 220,
"frameDurationMs": 24.9970588235294,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "dom-widget-order-sparse-n1000-w20-i120",
"durationMs": 842.6479999999401,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 461.5469999999999,
"heapDeltaBytes": 17177180,
"heapUsedBytes": 96009724,
"domNodes": 0,
"jsHeapTotalBytes": 1839104,
"scriptDurationMs": 164.09099999999998,
"eventListeners": 0,
"totalBlockingTimeMs": 225,
"frameDurationMs": 25,
"p95FrameDurationMs": 16.80000000000109
},
{
"name": "extension-clean-combined-draw",
"durationMs": 10951.887999999997,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 9958.212000000001,
"heapDeltaBytes": -7360052,
"heapUsedBytes": 73742120,
"domNodes": 0,
"jsHeapTotalBytes": -6029312,
"scriptDurationMs": 8170.612999999999,
"eventListeners": 0,
"totalBlockingTimeMs": 1368,
"frameDurationMs": 32.39526627218935,
"p95FrameDurationMs": 66.69999999999982
},
{
"name": "extension-clean-combined-draw",
"durationMs": 9430.416000000037,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 8579.892999999998,
"heapDeltaBytes": 10416020,
"heapUsedBytes": 91814152,
"domNodes": 0,
"jsHeapTotalBytes": -17563648,
"scriptDurationMs": 6942.193,
"eventListeners": 0,
"totalBlockingTimeMs": 539,
"frameDurationMs": 32.028231292517006,
"p95FrameDurationMs": 50.100000000000364
},
{
"name": "extension-rgthree-prototype-draw",
"durationMs": 10194.762000000026,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 9340.867999999999,
"heapDeltaBytes": -14797028,
"heapUsedBytes": 68425540,
"domNodes": -142,
"jsHeapTotalBytes": -6426624,
"scriptDurationMs": 7667.435,
"eventListeners": -78,
"totalBlockingTimeMs": 771,
"frameDurationMs": 32.32666666666667,
"p95FrameDurationMs": 50.100000000000364
},
{
"name": "extension-rgthree-prototype-draw",
"durationMs": 9486.573000000022,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 8660.097,
"heapDeltaBytes": 4574904,
"heapUsedBytes": 80816732,
"domNodes": -142,
"jsHeapTotalBytes": -8523776,
"scriptDurationMs": 7081.298,
"eventListeners": -78,
"totalBlockingTimeMs": 672,
"frameDurationMs": 32.25476190476191,
"p95FrameDurationMs": 50.100000000000364
},
{
"name": "large-graph-idle",
"durationMs": 2044.6599999999648,
"styleRecalcs": 6,
"styleRecalcDurationMs": 2.1510000000000002,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 543.5989999999999,
"heapDeltaBytes": -39726608,
"heapUsedBytes": 82958488,
"domNodes": -328,
"jsHeapTotalBytes": -1933312,
"scriptDurationMs": 31.005000000000006,
"eventListeners": -164,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.6655737704918,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "large-graph-idle",
"durationMs": 2057.8120000000126,
"styleRecalcs": 6,
"styleRecalcDurationMs": 2.443999999999998,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 568.09,
"heapDeltaBytes": -40200448,
"heapUsedBytes": 82842740,
"domNodes": -352,
"jsHeapTotalBytes": -1933312,
"scriptDurationMs": 37.074,
"eventListeners": -164,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.665853658536584,
"p95FrameDurationMs": 16.699999999999818
},
{
"name": "large-graph-pan",
"durationMs": 2309.9620000000414,
"styleRecalcs": 70,
"styleRecalcDurationMs": 10.642000000000003,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 1623.522,
"heapDeltaBytes": 24923144,
"heapUsedBytes": 87786180,
"domNodes": -328,
"jsHeapTotalBytes": 225280,
"scriptDurationMs": 816.852,
"eventListeners": -164,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "large-graph-pan",
"durationMs": 2289.4129999999677,
"styleRecalcs": 69,
"styleRecalcDurationMs": 10.269,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 1608.6049999999998,
"heapDeltaBytes": -533696,
"heapUsedBytes": 87323564,
"domNodes": 0,
"jsHeapTotalBytes": 1572864,
"scriptDurationMs": 826.329,
"eventListeners": 0,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.665693430656933,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "large-graph-zoom",
"durationMs": 3572.2000000000094,
"styleRecalcs": 64,
"styleRecalcDurationMs": 10.475999999999999,
"layouts": 60,
"layoutDurationMs": 13.054,
"taskDurationMs": 1636.3480000000004,
"heapDeltaBytes": 4898604,
"heapUsedBytes": 68829188,
"domNodes": -328,
"jsHeapTotalBytes": 0,
"scriptDurationMs": 750.566,
"eventListeners": 0,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66635514018692,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "large-graph-zoom",
"durationMs": 3538.7660000000096,
"styleRecalcs": 66,
"styleRecalcDurationMs": 12.135999999999997,
"layouts": 60,
"layoutDurationMs": 13.715,
"taskDurationMs": 1669.523,
"heapDeltaBytes": 12039812,
"heapUsedBytes": 89529820,
"domNodes": 0,
"jsHeapTotalBytes": 262144,
"scriptDurationMs": 776.686,
"eventListeners": 0,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66603773584906,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "legacy-node-drag",
"durationMs": 3067.624999999964,
"styleRecalcs": 47,
"styleRecalcDurationMs": 6.800000000000001,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 1875.0980000000002,
"heapDeltaBytes": 26632916,
"heapUsedBytes": 93452876,
"domNodes": 0,
"jsHeapTotalBytes": 1466368,
"scriptDurationMs": 951.738,
"eventListeners": 180,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.756830601092897,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "legacy-node-drag",
"durationMs": 3052.731999999992,
"styleRecalcs": 44,
"styleRecalcDurationMs": 5.988,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 1876.098,
"heapDeltaBytes": 18523092,
"heapUsedBytes": 82897156,
"domNodes": -167,
"jsHeapTotalBytes": 417792,
"scriptDurationMs": 948.915,
"eventListeners": 180,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.758011049723756,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "minimap-idle",
"durationMs": 2036.4039999999477,
"styleRecalcs": 6,
"styleRecalcDurationMs": 4.990999999999999,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 549.06,
"heapDeltaBytes": -41554160,
"heapUsedBytes": 83220604,
"domNodes": -328,
"jsHeapTotalBytes": -2981888,
"scriptDurationMs": 29.455999999999996,
"eventListeners": -164,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666393442622944,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "minimap-idle",
"durationMs": 2019.072000000051,
"styleRecalcs": 5,
"styleRecalcDurationMs": 1.978999999999998,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 512.529,
"heapDeltaBytes": 20686260,
"heapUsedBytes": 83466960,
"domNodes": -328,
"jsHeapTotalBytes": 0,
"scriptDurationMs": 28.488,
"eventListeners": -164,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666942148760327,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "subgraph-dom-widget-clipping",
"durationMs": 594.9239999999918,
"styleRecalcs": 47,
"styleRecalcDurationMs": 5.9300000000000015,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 407.86799999999994,
"heapDeltaBytes": -40349980,
"heapUsedBytes": 63577644,
"domNodes": -248,
"jsHeapTotalBytes": -2621440,
"scriptDurationMs": 139.898,
"eventListeners": -200,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.663888888888877,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "subgraph-dom-widget-clipping",
"durationMs": 614.0080000000125,
"styleRecalcs": 47,
"styleRecalcDurationMs": 8.430000000000001,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 405.30000000000007,
"heapDeltaBytes": -11752488,
"heapUsedBytes": 57279800,
"domNodes": 0,
"jsHeapTotalBytes": 262144,
"scriptDurationMs": 143.88500000000002,
"eventListeners": 6,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66486486486485,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "subgraph-idle",
"durationMs": 2008.5529999999494,
"styleRecalcs": 11,
"styleRecalcDurationMs": 3.800999999999999,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 413.156,
"heapDeltaBytes": 839172,
"heapUsedBytes": 70748108,
"domNodes": 0,
"jsHeapTotalBytes": 0,
"scriptDurationMs": 7.995999999999996,
"eventListeners": 0,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666115702479342,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "subgraph-idle",
"durationMs": 2019.3709999999783,
"styleRecalcs": 10,
"styleRecalcDurationMs": 3.987000000000001,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 397.829,
"heapDeltaBytes": 490428,
"heapUsedBytes": 69933416,
"domNodes": 0,
"jsHeapTotalBytes": 0,
"scriptDurationMs": 7.117000000000002,
"eventListeners": 0,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666115702479342,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "subgraph-mouse-sweep",
"durationMs": 1708.407999999963,
"styleRecalcs": 78,
"styleRecalcDurationMs": 18.188000000000002,
"layouts": 16,
"layoutDurationMs": 6.016,
"taskDurationMs": 738.8459999999999,
"heapDeltaBytes": 14900952,
"heapUsedBytes": 68971340,
"domNodes": -249,
"jsHeapTotalBytes": 0,
"scriptDurationMs": 109.157,
"eventListeners": -206,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "subgraph-mouse-sweep",
"durationMs": 1694.1860000000588,
"styleRecalcs": 76,
"styleRecalcDurationMs": 17.886,
"layouts": 16,
"layoutDurationMs": 5.58,
"taskDurationMs": 724.9989999999999,
"heapDeltaBytes": -6149220,
"heapUsedBytes": 62310120,
"domNodes": 0,
"jsHeapTotalBytes": 262144,
"scriptDurationMs": 110.88699999999999,
"eventListeners": 0,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.6656862745098,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "subgraph-transition-enter",
"durationMs": 1367.7339999999276,
"styleRecalcs": 18,
"styleRecalcDurationMs": 29.375,
"layouts": 5,
"layoutDurationMs": 12.758,
"taskDurationMs": 871.9140000000003,
"heapDeltaBytes": 24026584,
"heapUsedBytes": 110115388,
"domNodes": 13747,
"jsHeapTotalBytes": 2883584,
"scriptDurationMs": 27.210999999999984,
"eventListeners": 2383,
"totalBlockingTimeMs": 129,
"frameDurationMs": 19.21111111111111,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "viewport-pan-sweep",
"durationMs": 8855.616999999995,
"styleRecalcs": 251,
"styleRecalcDurationMs": 33.678,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 5971.38,
"heapDeltaBytes": -22114024,
"heapUsedBytes": 64116232,
"domNodes": -142,
"jsHeapTotalBytes": -7438336,
"scriptDurationMs": 2904.684,
"eventListeners": -78,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.69735349716446,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "viewport-pan-sweep",
"durationMs": 8555.916999999909,
"styleRecalcs": 249,
"styleRecalcDurationMs": 32.652,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 5860.076,
"heapDeltaBytes": -35408980,
"heapUsedBytes": 86902476,
"domNodes": -348,
"jsHeapTotalBytes": -3837952,
"scriptDurationMs": 2820.4469999999997,
"eventListeners": -164,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.6986328125,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "vue-large-graph-idle",
"durationMs": 16743.483000000084,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 16106.453000000001,
"heapDeltaBytes": -37398068,
"heapUsedBytes": 187578528,
"domNodes": -3045,
"jsHeapTotalBytes": 3932160,
"scriptDurationMs": 285.103,
"eventListeners": -14915,
"totalBlockingTimeMs": 0,
"frameDurationMs": 28.50528109028961,
"p95FrameDurationMs": 50.100000000000364
},
{
"name": "vue-large-graph-idle",
"durationMs": 16639.615999999933,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 15928.913000000002,
"heapDeltaBytes": -25732356,
"heapUsedBytes": 182738800,
"domNodes": -3045,
"jsHeapTotalBytes": 7360512,
"scriptDurationMs": 255.097,
"eventListeners": -14915,
"totalBlockingTimeMs": 0,
"frameDurationMs": 28.41194539249147,
"p95FrameDurationMs": 50.099999999998545
},
{
"name": "vue-large-graph-pan",
"durationMs": 20433.18499999998,
"styleRecalcs": 175,
"styleRecalcDurationMs": 17.563999999999997,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 19972.093999999997,
"heapDeltaBytes": -31598028,
"heapUsedBytes": 169895744,
"domNodes": -3045,
"jsHeapTotalBytes": 6049792,
"scriptDurationMs": 871.903,
"eventListeners": -14915,
"totalBlockingTimeMs": 16,
"frameDurationMs": 36.918264014466544,
"p95FrameDurationMs": 83.30000000000109
},
{
"name": "vue-large-graph-pan",
"durationMs": 20722.697999999924,
"styleRecalcs": 168,
"styleRecalcDurationMs": 18.29800000000001,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 20360.354,
"heapDeltaBytes": -31289552,
"heapUsedBytes": 168122560,
"domNodes": -3045,
"jsHeapTotalBytes": 8122368,
"scriptDurationMs": 909.7610000000002,
"eventListeners": -14915,
"totalBlockingTimeMs": 6,
"frameDurationMs": 38.111213235294116,
"p95FrameDurationMs": 83.29999999999927
},
{
"name": "vue-node-resize-workload",
"durationMs": 6004.133000000024,
"styleRecalcs": 20,
"styleRecalcDurationMs": 81.094,
"layouts": 20,
"layoutDurationMs": 23.416000000000007,
"taskDurationMs": 5889.493,
"heapDeltaBytes": 14294280,
"heapUsedBytes": 220701796,
"domNodes": 0,
"jsHeapTotalBytes": 524288,
"scriptDurationMs": 103.231,
"eventListeners": 0,
"totalBlockingTimeMs": 0,
"frameDurationMs": 33.61117318435753,
"p95FrameDurationMs": 66.70000000000073
},
{
"name": "vue-node-resize-workload",
"durationMs": 6096.992,
"styleRecalcs": 20,
"styleRecalcDurationMs": 81.85400000000001,
"layouts": 20,
"layoutDurationMs": 24.362999999999996,
"taskDurationMs": 5973.584000000001,
"heapDeltaBytes": 1051252,
"heapUsedBytes": 226187668,
"domNodes": 0,
"jsHeapTotalBytes": 1048576,
"scriptDurationMs": 104.945,
"eventListeners": 0,
"totalBlockingTimeMs": 0,
"frameDurationMs": 34.46158192090396,
"p95FrameDurationMs": 66.70000000000073
},
{
"name": "vue-zoom-out-idle",
"durationMs": 8519.580999999904,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 8163.017999999999,
"heapDeltaBytes": -37548020,
"heapUsedBytes": 180931176,
"domNodes": -3045,
"jsHeapTotalBytes": 4333568,
"scriptDurationMs": 129.99999999999994,
"eventListeners": -14914,
"totalBlockingTimeMs": 0,
"frameDurationMs": 28.77128378378378,
"p95FrameDurationMs": 50.10000000000218
},
{
"name": "vue-zoom-out-idle",
"durationMs": 8559.779999999933,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 8268.588999999998,
"heapDeltaBytes": -12746800,
"heapUsedBytes": 188572852,
"domNodes": -3045,
"jsHeapTotalBytes": 6483968,
"scriptDurationMs": 127.49299999999997,
"eventListeners": -14915,
"totalBlockingTimeMs": 0,
"frameDurationMs": 28.88378378378378,
"p95FrameDurationMs": 50.10000000000218
},
{
"name": "workflow-execution",
"durationMs": 480.8339999999589,
"styleRecalcs": 23,
"styleRecalcDurationMs": 21.497,
"layouts": 7,
"layoutDurationMs": 4.003,
"taskDurationMs": 136.13299999999998,
"heapDeltaBytes": 6012672,
"heapUsedBytes": 71665956,
"domNodes": 131,
"jsHeapTotalBytes": 0,
"scriptDurationMs": 18.66000000000001,
"eventListeners": 65,
"totalBlockingTimeMs": 0,
"frameDurationMs": 17.260714285714293,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "workflow-execution",
"durationMs": 487.81799999994746,
"styleRecalcs": 22,
"styleRecalcDurationMs": 17.433,
"layouts": 3,
"layoutDurationMs": 1.222,
"taskDurationMs": 132.59799999999998,
"heapDeltaBytes": 5849896,
"heapUsedBytes": 59132408,
"domNodes": -105,
"jsHeapTotalBytes": 0,
"scriptDurationMs": 10.603000000000002,
"eventListeners": -74,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.665517241379316,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "agent-composer-empty-conversation-typing",
"durationMs": 987.8949999999804,
"styleRecalcs": 78,
"styleRecalcDurationMs": 108.952,
"layouts": 76,
"layoutDurationMs": 26.343999999999998,
"taskDurationMs": 959.114,
"heapDeltaBytes": 18755912,
"heapUsedBytes": 89365828,
"domNodes": 76,
"jsHeapTotalBytes": 262144,
"scriptDurationMs": 406.695,
"eventListeners": 876,
"totalBlockingTimeMs": 0,
"frameDurationMs": 17.239655172413787,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "agent-composer-empty-conversation-typing",
"durationMs": 809.7810000000436,
"styleRecalcs": 78,
"styleRecalcDurationMs": 100.964,
"layouts": 76,
"layoutDurationMs": 24.36,
"taskDurationMs": 775.875,
"heapDeltaBytes": 17015800,
"heapUsedBytes": 84122916,
"domNodes": 76,
"jsHeapTotalBytes": 0,
"scriptDurationMs": 318.34000000000003,
"eventListeners": 876,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.665306122448968,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "agent-composer-long-conversation-typing",
"durationMs": 1346.5980000000854,
"styleRecalcs": 78,
"styleRecalcDurationMs": 252.23499999999999,
"layouts": 76,
"layoutDurationMs": 27.927,
"taskDurationMs": 1332.9180000000001,
"heapDeltaBytes": 8415268,
"heapUsedBytes": 113659200,
"domNodes": 76,
"jsHeapTotalBytes": 262144,
"scriptDurationMs": 449.713,
"eventListeners": 876,
"totalBlockingTimeMs": 0,
"frameDurationMs": 17.29746835443038,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "agent-composer-long-conversation-typing",
"durationMs": 1378.4239999999954,
"styleRecalcs": 78,
"styleRecalcDurationMs": 255.41000000000003,
"layouts": 76,
"layoutDurationMs": 28.273,
"taskDurationMs": 1358.4070000000002,
"heapDeltaBytes": -19098280,
"heapUsedBytes": 109107928,
"domNodes": 76,
"jsHeapTotalBytes": 524288,
"scriptDurationMs": 466.254,
"eventListeners": 876,
"totalBlockingTimeMs": 0,
"frameDurationMs": 17.73589743589743,
"p95FrameDurationMs": 33.29999999999927
}
]
}🔬 E2E Coverage
Top 10 files by uncovered lines
🌾 Fallow: ✅ PassedFallow audits the diff for duplication, complexity and dead code. It gates on new findings only, so when the audit completes, a red is something this PR introduced or moved — never inherited backlog. A red can also mean the audit itself did not finish; the details below say which happened. No new findings in the changed files. Reproduce locally# the base the gate compared against
npx fallow audit --root . --quiet --format json \
--changed-since 2bbba14425d6959a2f5c0180bb9833705041662b
Full docs: ADR-DEVEX-LINT-0015 🧩 Custom Nodes Ecosystem Matrix: ✅ PassedExecutes the frontend JS of every registry pack that ships any, against this change, in both renderers. The eight
On a pin-bump PR, a red gate means the ecosystem moved — not that your diff broke something. That is what the bump PR is for. Outside a pin bump or a cold rebuild of the unpinned tail, a red means the diff. Note the corpus size and the executed count are different numbers, and the verdict is against the executed count: roughly 3,100 of ~5,100 packs ship no extension-shaped JS and are skipped. Reproduce locally# build one shard's fixture, then run it
python3 scripts/registry-census/build_matrix.py --shard 1/4
MATRIX_RENDERER=vue MATRIX_VUE=1 \
npx vitest run --config vitest.matrix.config.mts
Full docs: scripts/registry-census/README.md |
Codecov Report✅ All modified and coverable lines are covered by tests. @@ Coverage Diff @@
## main #18154 +/- ##
==========================================
+ Coverage 84.74% 85.49% +0.74%
==========================================
Files 3412 2397 -1015
Lines 163766 137028 -26738
Branches 44655 36991 -7664
==========================================
- Hits 138790 117148 -21642
+ Misses 23029 19514 -3515
+ Partials 1947 366 -1581
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 1019 files with indirect coverage changes 🚀 New features to boost your workflow:
|
2fcce35 to
657ec75
Compare
Comfy-Org#18157) ## Summary - Fixes the `AgentPanelRoot.test.ts` composer flake (`Exlain this appp`): happy-dom 20.9.0 dropped MutationObserver records after GC, so ProseMirror missed keystrokes. - Bumps the workspace catalog `happy-dom` from 20.9.0 to 20.14.5, which carries the upstream fix. - Adapts three test doubles to the newer environment; no assertions weakened. - No Playwright regression test: this PR changes no application code. It only bumps the `happy-dom` devDependency (the Vitest DOM environment) and adjusts test doubles under `src/**/*.test.ts` and `src/utils/__tests__/`; the bug lives in the unit-test environment and cannot be reproduced in a real browser, so an end-to-end test cannot cover it. Related to the agent stream drop bug tracked in Linear as [PM-1199 (agent stream drops mid-turn)](https://linear.app/comfyorg/issue/PM-1199/fix-agent-stream-drops-mid-turn-with-no-refresh-leaving-no-working) only in that it blocked green CI for the fix PRs ([Comfy-Org#18152 (agent turn survives socket drop)](Comfy-Org#18152), [Comfy-Org#18154 (reconcile hydrated streaming turn)](Comfy-Org#18154)). <details><summary>Full context for agent readers</summary> ### Root cause In happy-dom 20.9.0, `MutationObserverListener` held its callback only in a `WeakRef`. Once the callback was collected, `reportMutation` silently dropped records. ProseMirror's `DOMObserver` relies on MutationObserver to see the DOM mutation from a typed character; when a record was dropped, the editor state fell behind the DOM and later characters were inserted at a stale offset. The symptom in [`src/workbench/extensions/agent/AgentPanelRoot.test.ts`](https://github.com/Comfy-Org/ComfyUI_frontend/blob/main/src/workbench/extensions/agent/AgentPanelRoot.test.ts) ("defers the tour in App Mode") was the composer text `Exlain this appp` instead of `Explain this app`. The failure was GC-timing dependent, so it reproduced in roughly 7 of 12 isolated runs and more often in the full suite. Upstream: happy-dom issue [Comfy-Org#2264 (MutationObserver callback garbage collected)](capricorn86/happy-dom#2264), fixed by holding a strong `#listenerCallback` reference (duplicate report in [happy-dom issue Comfy-Org#2255 (MutationObserver stops firing)](capricorn86/happy-dom#2255)). A deterministic scratch test that forced GC with `--expose-gc` failed on 20.9.0 and passed on 20.14.5; it is not committed because it needs the `--expose-gc` node flag, which the vitest config does not pass. ### Test adaptations (environment changes, not weakened assertions) 1. `src/composables/video/useVideoFilmstrip.test.ts`: happy-dom 20.14 now defines `createImageBitmap` and `OffscreenCanvas`, which routed the canvas-fallback cases down the bitmap path against the `MockVideoElement`. A `beforeEach` stubs both to `undefined`; the bitmap-path tests already install their own mocks inside the test body and so override it. 2. `src/lib/litegraph/src/cursorCache.test.ts`: `CSSStyleDeclaration` is now a Proxy that rejects `defineProperty` on `cursor`. The mock element now defines a plain `style` object with a `cursor` accessor. Production `createCursorCache` is unchanged. 3. `src/utils/__tests__/litegraphTestUtils.ts`: happy-dom images now report `width > 0`, so `drawBackCanvas` reaches `ctx.createPattern`. Both mock 2D context factories now provide `createPattern: vi.fn(() => null)`. This fixed `LGraphCanvas.drawConnections.test.ts` and `LGraphCanvas.invalidation.test.ts`. ### Verification - Flake loop, `AgentPanelRoot.test.ts -t "defers the tour in App Mode"`: 12/12 pass on 20.14.5 (7/12 failed on 20.9.0). - Full `pnpm test:unit`: 1610 files, 22182 passed, 14 expected fail, 7 skipped, exit 0. - Catalog consumers via `pnpm exec vitest run` in each dir: `packages/account-core` 907/907, `packages/account-ui` 120/120, `apps/billing-web` 125/125, `apps/website` 5179/5179. - `pnpm typecheck`, `pnpm lint`, `pnpm knip`, `pnpm format` all exit 0. ### Decisions to veto - Monorepo-wide catalog bump rather than a root-only override. All catalog consumers were run and pass; a root-only pin would leave the same GC bug live in the other packages. - No permanent GC regression test, because it needs `--expose-gc`. If reviewers want one, it could live behind a dedicated vitest project with `poolOptions.forks.execArgv`. - 20.14.5 chosen as the current latest at time of writing; any release at or after the fix commit `576a8bc` would do. </details>
DrJKL
left a comment
There was a problem hiding this comment.
Verdict: follow-up requested
I found two material follow-ups and two minor issues. None is a P0/P1 runtime blocker, so I am leaving a COMMENT review rather than requesting changes.
Findings without an inline anchor
- [P2] The linked cloud follow-up does not bound orphan recovery to five minutes. Its current REST description says a row must first exceed a 30-minute stale cutoff, then the sweep runs every five minutes, for about 35 minutes worst case. Comfy-Org/cloud#9906 is also still open. Please correct the PR description and make merge/deployment of that follow-up an explicit prerequisite if automatic orphan recovery is required for this release.
- [P3] The PR description says the focused suite passed 120/120, but the exact-head focused run discovers 88 tests and passes 88/88. I independently ran the other named checks: full lint, typecheck, full format check, and knip all pass. Please correct the stale test count.
Existing feedback
There were no prior review comments to confirm or contest. CodeRabbit skipped this stacked-base PR.
Checked and cleared
- Fallow's public-contract question is clear:
AgentPanelRoot.vueis the only production consumer, this diff changes no parameter or returned-field shape, and full typecheck passes. - Fallow's unused
SessionNoticeexport is marked pre-existing and the diff does not touch it. - Fallow's complexity findings for
sendMessage,onRaw,hydrateFromServer, andpostTurnare marked pre-existing. This diff adds one call tohydrateFromServerbut no branch there. - Fallow's 15 dependency-placement findings are all marked pre-existing and point to unchanged
package.json:@pinia/testing,@tailwindcss/vite,jsonc-parser,markdown-table,mixpanel-browser,monocart-coverage-reports,openai,picocolors,pretty-bytes,unplugin-icons,unplugin-vue-components,uuid,yaml,zip-dir, andzod-to-json-schema. - I traced hydration timing, steady 16-second polling, duplicate recovery suppression, thread deletion, session replacement, thread switching, cancellation followed by terminal state, socket completion, REST completion/error, stale responses, and timer teardown. I found no additional incremental behavior defect.
Coverage and verification
Standard depth. I reviewed the incremental diff against fix/agent-turn-survives-socket-drop, not main. Correctness, maintainability, idiomaticity, tests, and documentation lanes all ran. The review covered blast radius and history, retry idempotence, shared state, boundary handling, root-cause behavior, deletion-first maintainability, reader load, TypeScript type discipline, unit-test quality, mock boundaries, setup ownership, proof of behavior, and technical prose.
Checks at 657ec756001f27c82547777a5013a7a331f2eab9: focused unit suite 88/88; typecheck passed; full lint passed with existing warnings and no errors; full format check passed; knip passed; diff check passed; Fallow completed with no introduced structural finding. GitHub's checks for this head are green or intentionally skipped.
For the race-test finding, I replaced the post-fetch liveness check with a generation-only check. All 88 focused tests still passed, proving the suite does not distinguish session replacement from a same-session socket completion while the GET is pending.
The production deployment state of cloud#9906 was not exercised. Its current REST metadata says it is open and describes the 30-minute cutoff plus five-minute interval.
Inherited from the stacked base, and not duplicated as a finding here: recoveringTurns is keyed only by message ID while store liveness uses (threadId, messageId). That belongs to the #18152 base review unless message IDs are not globally unique.
657ec75 to
1f312b8
Compare
1f312b8 to
f4f65e8
Compare
9a24aca to
74491fd
Compare
f4f65e8 to
36d5019
Compare
DrJKL
left a comment
There was a problem hiding this comment.
Verdict: changes requested
I found one blocking recovery-ownership race in the refresh/remount path. A surviving turn can appear as both active and background after hydration, and this reconciliation pass starts two jobs for the same (threadId, messageId). The second controller overwrites the first, so stop() cannot abort the hidden request and either job can delete the other's map ownership. I reproduced this at the reviewed head: two recovery requests started and the captured abort states after stop() were [false, true]. The inline comment describes the smallest fix and regression case.
The four findings from my prior review are addressed: the cloud sweep timing is now described as roughly 35 minutes after deployment, RecoverySchedule is nonempty, the post-fetch liveness regression catches the done/404 race, and the focused count was updated at that revision. The composite thread/message key is inherited from the updated #18152 base and is not duplicated here.
The PR description still needs these corrections:
hydrateThreadis named twice, but the implementation ishydrateFromServer.fetchApi's 60-second response-header timeout bounds one request; an error emits one notice and polling continues.- Switching threads preserves the old turn in
backgroundTurns, so it does not by itself stop polling. - The current exact-head focused result is 108/108, not 106/106. I could not locate exact-head evidence for the stated agent-subtree totals or exact mutation output, so those precise claims should be removed or refreshed.
I reviewed only the incremental stack from 74491fd2308e5a0ac3f59efb7772d7967df4a261 to 36d5019789819e563e0c6b0c5a6e0689fcc42a8a. Focused tests passed 108/108; typecheck, changed-file ESLint, type-aware oxlint, format check, knip, and diff checks passed. Oxlint reported only existing warnings. An older broad agent-subtree run had one transient Composer failure that passed 4/4 alone; I did not reproduce it at the current head. GitHub currently reports the PR mergeable but checks are still running.
36d5019 to
c77bc04
Compare
DrJKL
left a comment
There was a problem hiding this comment.
Verdict: follow-up requested
The remount blocker is fixed. reconcileTurn now claims the composite key before its first await, and cleanup removes the entry only when it still owns that controller. I ran g22 against the immediate parent production code and got the expected red result, [false, false] instead of [false]. The same test passes at this head with one recovery signal, and stop() aborts it.
Findings without an inline anchor
The five PR-body corrections from my last review were not made, and the refreshed base added one more stale claim:
- [P2] The body says
fetchApi's 60-second response-header timeout stops recovery. It bounds one GET. A timeout becomes an error outcome, emits one notice, and polling continues while the turn remains live. - [P3]
hydrateThreadis named twice, but the implementation ishydrateFromServer. - [P3] The exact-head focused result is 109/109, not 106/106.
- [P3] I still could not locate exact-head logs for the stated agent-subtree totals or the exact g18 mutation result and unaffected tests. Please remove or qualify those precise claims, or retain the command output.
- [P3] The body says the recovery key is
${threadId}/${messageId}. The current base usesJSON.stringify([threadId, messageId]), and g20 specifically protects IDs that collide under slash concatenation.
Prior findings
- The duplicate-job and unowned-request blocker is fixed and red/green proven.
- The earlier post-fetch liveness test, nonempty recovery schedule, cloud sweep timing, and composite identity findings remain addressed.
- The incorrect thread-switch stop condition remains in the PR body and the changed production docblock. I left one inline comment for that shared claim.
Checked and cleared
- I traced hydration, reconnect, duplicate active/background identities, socket completion during REST work, late terminal and 404 responses, repeated errors, session replacement,
stop(), timer repetition, and composite-key collisions. I found no remaining runtime defect in this stack. - The atomic guard, controller-identity cleanup, nonempty schedule, JSON tuple key, and g22 are the smallest code needed for the ownership invariant. I found no maintainability issue.
- Exact-head Fallow marks the
hydrateFromServercomplexity itemintroduced: false. This stack adds one straight-line call there and no branch, so I did not treat that existing complexity as a finding. - TypeScript, cancellation, and test-double usage are idiomatic. g22 exercises the real composable/store path with typed transport and clock doubles.
- The ecosystem matrix was still running at review time. Completed exact-head checks showed no relevant failure, so I did not infer a code defect from the earlier withheld status.
Coverage and verification
Standard follow-up depth. Correctness, maintainability, idiomaticity, tests, and documentation lanes ran against the incremental stack from 3cca890c6c2b1b32b49b15dda2ea6fef4384acd5 to aa5632d68d32e82e61c241154942cb1967e1d36f.
Local exact-head results: focused tests 109/109; typecheck, changed-file ESLint, type-aware oxlint, format check, knip, diff check, and Fallow passed. Oxlint reported only unrelated existing warnings. g22 failed against aa5632d^ with two live recovery signals and passed against the current head with one owned signal. GitHub reported the PR mergeable, with other checks still running.
aa5632d to
c906fda
Compare
DrJKL
left a comment
There was a problem hiding this comment.
Verdict: follow-up requested
The six factual PR-body corrections are now accurate, and the earlier runtime findings remain fixed. I found one remaining documentation mismatch in the production comment: the REST client's 60-second timer covers response headers, not JSON body consumption, so it does not bound an entire recovery check. This is documentation-only and not a runtime blocker; the inline comment gives the narrow correction.
I reviewed only the incremental stack from 597aa9bbc90310d7188a76758bd3d209d24f3acb to c906fda64c4221246278594ce79fff618d0d309d. The stack remains contingent on #18152 landing first. Exact-head results: focused tests 109/109; agent subtree 111 files, 1754 passed plus 1 expected failure; typecheck, changed-file ESLint, type-aware oxlint, format, knip, diff check, and Fallow passed. Replacing the post-fetch liveness guard reproduced the documented g18 failure alone: 1 failed, 108 passed, with null instead of th-1. I also reconfirmed the remount ownership fix, nonempty schedule, tuple recovery key, cancellation, thread-switch behavior, and open-ended cadence. GitHub had 71 successful, 16 skipped, and five still-running or queued checks at posting; no completed check was failing.
dante01yoon
left a comment
There was a problem hiding this comment.
Re-read the four DrJKL threads first; all four look resolved at this head. The nonempty-tuple RecoverySchedule, the recoveringTurns.has(key) claim with the ownership-checked finally, the corrected stop-condition docblock (thread switch stashes rather than ends), and the narrowed response-header-timeout wording are all present in useAgentSession.ts. I re-derived the schedules against the tests and they line up: hydrate polls at t = 1, 3, 7, 15, 31, 47 s (g14) and reconnect at t = 0, 1, 3, 7, 15, 31, 47, 63, 79, 95 s (g17, g16's 6 -> 7).
On the two things flagged for this PR:
- Ordering / idempotency looks right to me.
liveTurns()yields[active, ...background], both entries of the remount pair sharerecoveryKey, andreconcileTurnclaims the key synchronously before its firstawait, so only one job runs (g22). A late socket delta after a REST settle is dropped:ingestfindstransport === nulland no matching background entry, andagentEventTransport.ingestreturns early oncesettledis set, so there is no resurrection or double-append. - Server-owned state looks right too.
settleTurn->finishWithPersistedTextreplaces the text parts with the server's persisted text rather than merging the socket partial into it, so the persisted row wins (g12).
One blocking concern below, on the loop bound.
1d92c93 to
54cf533
Compare
DrJKL
left a comment
There was a problem hiding this comment.
Verdict: ready to approve
All four items from my previous review are fixed, and I found nothing new. I reviewed live head d8121e4ad0; the dispatch named a6dcf7f2d4. Two more commits came after that one:
77e882884bmergesmainand touches none of this PR's three recovery files.d8121e4ad0fixes aTS2322infreeUsePlacement.test.ts. That error came frommain(#19712) and broke typecheck onmainitself. I confirmed it fails on2bbba14425alone. With the fix,pnpm typecheckpasses locally and the CIlint-pr / typecheckjob is green.
Overlap: d8121e4ad0 is byte-identical to #19839, so whichever lands first makes the other a no-op without a conflict. If #19839 merges first, this PR no longer needs that file.
Review record
Round 1, review at 657ec75600
- [P3] An empty
RecoverySchedulewas possible. Fixed with a nonempty tuple; author reply. - [P2] The
done-before-GET test did not cover done-versus-fetch ordering. Fixed with a deferred-fetch test; author reply. - [P2] The PR body misstated the cloud orphan bound (about 35 minutes, not 5). Corrected in the body.
- [P3] The PR body misstated the focused test count. Corrected.
Round 2, CHANGES_REQUESTED at 36d5019789
- [P1] A remount could start two recovery jobs for one key. Fixed in
aa5632dwith an atomic claim and ownership-checked cleanup, then red/green proven; author reply. - [P3] Several PR-body facts were wrong: the
hydrateThreadname, timeout scope, thread-switch behavior, and test totals. Corrected.
Round 3, review at aa5632d68d
- [P2] A thread switch stashes the turn instead of ending its recovery. Docblock fixed in
c906fda; author reply. - [P3] The recovery-key format and evidence claims in the PR body were wrong. Corrected.
Round 4, review at c906fda64c
- [P3] The timeout comment needed to say it covers response headers only. Narrowed; author reply.
- dante01yoon's unbounded error path was bounded in
54cf533.
Round 5, review at fdd8fc1634
- [P3] The recovery docblock was too long, author reply. The one-caller
abandonTurnRecoverywrapper was unnecessary, author reply. The browser test needed named steps, author reply. All three were fixed in749b6c9d57. - [P3] The PR body misdescribed the deadline symptom and test counts. Corrected.
Rounds 6–8, reviews at 749b6c9d57, a76d69efce, and ac6d2af2be
- Fallow's complexity gate on
recoverTurnwas fixed ina76d69efce. - The workspace-scoped fixture storage key was fixed in
ac6d2af2be.
Round 9, inline comments at ac6d2af2be
- The 120-second describe timeout was removed in
724802f850; reply. - The redundant
vi.useFakeTimers()was removed in724802f850; reply. - The redundant
finally { vi.useRealTimers() }was removed in724802f850; reply. - The chained once-only mocks were simplified in
724802f850; reply. - The opaque
(g12)test-name prefix was fixed in724802f850. It came back as(g5c)in round 11 and was fixed again (below).
Round 10, ten automated findings at d27a15afef (dismissed approval)
- Three were fixed: the whole-response timeout (reply), pending-ask replay (reply), and stopped-turn readiness (reply).
- Seven were rejected with backend-contract evidence in their threads.
- That stack was later rebuilt on
main, which already contains this recovery behavior through #18152 and #19053.
Round 11, review at d7a2145343
- [P3] The recovery-ownership guard had no test. Fixed in
bb5181f55c: a new case hangs the first recovery fetch, runsstop()andstart(), and checks that a laterstop()aborts the successor's signal. I verified it is red without the guard (expected false to be true) and green with it. Author reply. - Nit: the opaque
(g5c)test-name prefix. Dropped inf0963ef152; author reply. - Nit: the test edited its fixture after building it. Now declared in one expression in
fe19d22d66; author reply. - Nit: a redundant comment that claimed a backend timing. Deleted in
a6dcf7f2d4; author reply. - Nit (body only): the PR title still describes the old, broader scope. Still open; non-blocking.
- Overlap: backport #19697 (cloud/1.54) still needs these two fixes if it lands separately.
Round 12, this review at d8121e4ad0
- No new findings. The inherited
freeUsePlacement.test.tstypecheck failure is fixed here, identically to #19839.
Checks at d8121e4ad0
useAgentSession.test.tsandfreeUsePlacement.test.ts: 206 passed.- The ownership test is red without the guard and green with it. The empty-row test was red on
mainand green on head in round 11. pnpm typecheckandpnpm typecheck:browserpassed.- Changed-file ESLint, type-aware Oxlint, and oxfmt
--checkpassed on all four files. playwright test --listcollects 1 cloud test.- Hosted CI at review time:
lint-pr / typecheckandlint-and-formatpassed; the four cloud Playwright shards were still running. They passed (4 × 136) atd7a2145343, and the browser spec has not changed since.
|
|
|
|
## Summary Hardens the REST recovery path added by #18154: - successful empty terminal rows preserve locally streamed content but finalize any still-running local parts; - failed or interrupted empty rows discard partial local success content instead of presenting it as complete. Related: PM-1776, PM-1682, PM-1199. ## Validation - focused unit suites: 288 passed - app typecheck and changed-file lint/format pass - targeted regressions cover a locally running tool and an empty failed row
… from REST after a refresh (#19845) ## Summary Backports #18154 so a refreshed or remounted Agent session immediately reconciles a persisted streaming turn instead of waiting for a socket transition. It also preserves locally streamed parts when the terminal persisted row is empty and covers the refresh journey in Playwright. The automated backport conflicted only with a test file absent from this release branch; that unrelated file remains absent. Related: PM-1776, PM-1682, PM-1199. ## Validation - focused useAgentSession unit suite passes on the release families - browser TypeScript check passes - source PR full CI and Playwright passed
…from REST after a refresh (#19848) ## Summary Backports #18154 so a refreshed or remounted Agent session immediately reconciles a persisted streaming turn instead of waiting for a socket transition. It also preserves locally streamed parts when the terminal persisted row is empty and covers the refresh journey in Playwright. The automated backport conflicted only with a test file absent from this release branch; that unrelated file remains absent. Related: PM-1776, PM-1682, PM-1199. ## Validation - focused useAgentSession unit suite passes on the release families - browser TypeScript check passes - source PR full CI and Playwright passed
…from REST after a refresh (#19846) ## Summary Backports #18154 so a refreshed or remounted Agent session immediately reconciles a persisted streaming turn instead of waiting for a socket transition. It also preserves locally streamed parts when the terminal persisted row is empty and covers the refresh journey in Playwright. The automated backport conflicted only with a test file absent from this release branch; that unrelated file remains absent. Related: PM-1776, PM-1682, PM-1199. ## Validation - focused useAgentSession unit suite passes on the release families - browser TypeScript check passes - source PR full CI and Playwright passed
… from REST after a refresh (#19847) ## Summary Backports #18154 so a refreshed or remounted Agent session immediately reconciles a persisted streaming turn instead of waiting for a socket transition. It also preserves locally streamed parts when the terminal persisted row is empty and covers the refresh journey in Playwright. The automated backport conflicted only with a test file absent from this release branch; that unrelated file remains absent. Related: PM-1776, PM-1682, PM-1199. ## Validation - focused useAgentSession unit suite passes on the release families - browser TypeScript check passes - source PR full CI and Playwright passed
…swered one Carries the remaining four commits of this branch onto the rebased `fix/agent-reconcile-hydrated-streaming-turn` base, where they would not replay: each was written against the recovery loop as it stood before #18152 landed and #18154 was rebased, so every one of them re-conflicted on the same files. What they add is unchanged: - `deliveredAsks` ledger, so a poll whose snapshot predates the answer cannot redraw a card the user is done with. - `handleAskEvent` drops an `agent_ask` whose `askId` is already on the message, since the server writes the ask row before publishing the frame and the two can arrive in either order. - Inbound asks route through `deliverAsk`, which only ledgers a frame once its card is actually on screen. - The report separates a frame the socket really lost (`error`, after a grace window for a late broadcast) from one a hydrate merely raced (`warning`), tagged with `recovery_cause`. Adapted where the base had moved on: the cause rides as a `RecoveryCause` rather than a second delay schedule, because the base now has one schedule; `(g31)`/`(g35)` assert the same hydrate-vs-reconnect outcomes against that single schedule; and the report carries the `surface` the current `reportError` contract requires. Unit: 2555 passed across src/workbench/extensions/agent. Typecheck, lint and oxfmt clean.
…swered one Carries the remaining four commits of this branch onto the rebased `fix/agent-reconcile-hydrated-streaming-turn` base, where they would not replay: each was written against the recovery loop as it stood before #18152 landed and #18154 was rebased, so every one of them re-conflicted on the same files. What they add is unchanged: - `deliveredAsks` ledger, so a poll whose snapshot predates the answer cannot redraw a card the user is done with. - `handleAskEvent` drops an `agent_ask` whose `askId` is already on the message, since the server writes the ask row before publishing the frame and the two can arrive in either order. - Inbound asks route through `deliverAsk`, which only ledgers a frame once its card is actually on screen. - The report separates a frame the socket really lost (`error`, after a grace window for a late broadcast) from one a hydrate merely raced (`warning`), tagged with `recovery_cause`. Adapted where the base had moved on: the cause rides as a `RecoveryCause` rather than a second delay schedule, because the base now has one schedule; `(g31)`/`(g35)` assert the same hydrate-vs-reconnect outcomes against that single schedule; and the report carries the `surface` the current `reportError` contract requires. Unit: 2555 passed across src/workbench/extensions/agent. Typecheck, lint and oxfmt clean.
…1998) (#19901) ## Summary A `409 TURN_IN_PROGRESS` on send was a dead end; it now re-attaches to the turn that is holding the thread, so the user gets a Stop control instead of a raw server string. FE-1998. ## Changes - **What**: `useAgentSession` reads the 409 conflict body the agent service has sent since [cloud#8275](Comfy-Org/cloud#8275) (`type: "TURN_IN_PROGRESS"`, `active_message_id`, `turn_id`) and re-reads the thread on it. The re-read adopts the still-running assistant row as the active turn, which is what puts **Stop** where Send was; when that turn settles the composer unlocks on its own. The notice copy changes from the raw server message to `agent.sendTurnInProgress`. - **Dependencies**: none. ### Why the refusal was terminal The server's single-active-turn signal is a `status='streaming'` assistant row, durable in Postgres and deliberately surviving a worker restart (`services/agent/server/agent_handler.go`, `ThreadActiveTurn` → `rejectTurnInProgress`). So the thread stays locked until that row goes terminal, and nothing the user could reach from the panel cleared it: no stop control, no retry, and no way to tell a working turn from a dead one. ## Review Focus **Scope — this is the 409 route that composer gating does not close.** A turn *this* client can see already renders Stop and never offers Send, so it cannot reach the guard; #19697/#18152 and #18154 closed the reload and socket-drop routes. What remains is a turn started from a second tab, window or device: this client has no local signal, offers Send, and is refused. That is what the new spec exercises, and it is the only shape that can reach the refusal path at all now. **The re-read is bounded, on `reconcileSnapshotTurn`'s reasoning.** `performSend` awaits it and the composer sits in `sending` until it returns, so an unbounded await would let a slow workflow restore hold the one control the user needs. If the bound wins before the transcript lands, the reattachment is invalidated and the late snapshot is discarded. If the transcript has already landed and only workflow restore is still outstanding, the active turn remains adopted and the send reports that reattachment. **It goes through `hydrateFromServer`, not a bare `getMessages` + `hydrate`.** That is the one path which arms the hydration mailbox, so WS frames for the running turn that land during the GET are replayed rather than dropped. A second re-attach path would drift from it. **The discriminator is load-bearing** and has its own negative test: a 409 from another endpoint, or one whose body this client cannot parse, stays an ordinary send failure and triggers no re-read. **Fixture fidelity (please look at this).** `agentTurnLockFixture` answered a refused post with the 409's *message only*, so no spec could distinguish a client that reads the conflict ids from one that ignores them — the comment claimed the body was verbatim from `agent_handler.go` and it was not. It now sends the whole body. The generated `AgentError` type describes only `error`, because the OpenAPI schema does not cover this endpoint's conflict body; the fixture types the body as `AgentError & z.infer<typeof zTurnInProgressError>`, reusing the client's runtime schema for the conflict fields. *Filed as an upstream hypothesis for the ingest schema* rather than fixed here. ## Testing Black-box, red on the parent and green here: ``` browser_tests/tests/agent/agentSendRefusedByRunningTurn.spec.ts ``` On `origin/main` it fails at `expect(turnLock.stopButton).toBeVisible()` with "element(s) not found" — the dead end itself. It also drives the escape hatch end to end: Stop unlocks the composer and the retry is accepted with no second refusal and no page reload, which is this ticket's stated acceptance criterion. Unit: ``` useAgentSession.test.ts › re-attaches to the running turn when a send is refused with TURN_IN_PROGRESS useAgentSession.test.ts › does not let a timed-out re-attachment replace a newer turn useAgentSession.test.ts › records no failed send when the re-read finds the refused thread deleted useAgentSession.test.ts › leaves an undiscriminated 409 on an existing thread as a plain failure useAgentSession.test.ts › applies a pending stop to an active turn adopted after a refused send useAgentSession.test.ts › clears a pending stop when the send fails before adopting a turn ``` The first is also red on the parent (`expected false to be true` on `isStreaming`). Run locally against `origin/main` at `dd630e6c04`: - `useAgentSession` / `agentConversationStore` / `agentTranscript` / `agentRestClient` — 413 passed - the four sibling turn-lock specs that share the fixture (`agentTurnSurvivesRefresh`, `agentTurnSurvivesSocketDrop`, `agentTurnSurvivesPanelMinimize`, `agentEscapeStopsClickedTurn`) — 15 passed - `typecheck:app`, `typecheck:browser`, `oxlint`, `eslint`, `locale:check`, and the `fallow` pre-push audit gate — clean ## Production context Measured 2026-10-02 (read-only): `comfy.agent.turn_rejected{reason:in_progress}` ran at **19.9% of `agent_turn_started`** over a four-hour window, and **30.0% of threads** contained at least one ten-minute-plus window in which the next send is answered 409. That figure is dominated by the reload route this PR does *not* cover, and should fall sharply once the fix already on `cloud/1.54`/`cloud/1.55` reaches the production stable arm — re-measure before citing it as this change's justification. --------- Co-authored-by: GitHub Action <action@github.com> Co-authored-by: Alexander Brown <drjkl@comfy.org>
What changed
The broader hydrated-turn recovery now already exists on
mainthrough #18152 (socket-drop recovery) and #19053 (panel-remount restoration). This PR was rebuilt on currentmainto retain only the still-additive hardening and black-box refresh coverage.Verification
useAgentSession.test.ts: 201 passed, including the new empty-terminal-row regression.Fixes the refresh half of PM-1199 (an in-flight agent turn could remain locked after refresh).