Repository navigation
feat: restore tool-call work summary on reload and chat switch - #18282
Conversation
|
Important Review skippedBot user detected. To trigger a single review, invoke the ⚙️ Run configurationConfiguration used: Repository: Comfy-Org/ComfyUI_frontend/.coderabbit.yaml Review profile: ASSERTIVE Plan: Advanced Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Comment |
🎨 Storybook: ✅ Built — View Storybook🎭 Playwright: ✅ 2120 passed, 0 failed📊 Browser Reports
🌾 Fallow: ✅ PassedFallow audits the diff for duplication, complexity and dead code. It gates on new findings only, so when the audit completes, a red is something this PR introduced or moved — never inherited backlog. A red can also mean the audit itself did not finish; the details below say which happened. No new findings in the changed files. Reproduce locally# the base the gate compared against
npx fallow audit --root . --quiet --format json \
--changed-since d435893c86999e759eabbfc32c0608baf36470ad
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 📦 Bundle: 9.98 MB gzip ⚪ 0 BDetailsSummary
Category Glance App Entry Points — 3.87 kB (baseline 3.87 kB) • ⚪ 0 BMain entry bundles and manifests Status: 1 unchanged Graph Workspace — 1.44 MB (baseline 1.44 MB) • ⚪ 0 BGraph editor runtime, canvas, workflow orchestration Status: 3 unchanged Views & Navigation — 132 kB (baseline 132 kB) • ⚪ 0 BTop-level views, pages, and routed surfaces Status: 18 unchanged Panels & Settings — 639 kB (baseline 639 kB) • ⚪ 0 BConfiguration panels, inspectors, and settings screens Status: 28 unchanged User & Accounts — 37.9 kB (baseline 37.9 kB) • ⚪ 0 BAuthentication, profile, and account management bundles Status: 11 unchanged Editors & Dialogs — 126 kB (baseline 126 kB) • ⚪ 0 BModals, dialogs, drawers, and in-app editors Status: 8 unchanged UI Components — 124 kB (baseline 124 kB) • ⚪ 0 BReusable component library chunks Status: 16 unchanged Data & Services — 3.93 MB (baseline 3.93 MB) • ⚪ 0 BStores, services, APIs, and repositories Status: 16 unchanged Utilities & Hooks — 577 kB (baseline 577 kB) • ⚪ 0 BHelpers, composables, and utility bundles Status: 38 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: 302 unchanged ⚡ Performance Report
Show regressions
All metrics
Historical variance (last 15 runs)
Trend (last 15 commits on main)
Raw data{
"timestamp": "2026-09-23T05:23:39.816Z",
"gitSha": "34b45c242e6210879ad15dc4c4a605539198aa53",
"branch": "feat/fe-1305-render-toolcall-history-on-reload",
"measurements": [
{
"name": "canvas-idle",
"durationMs": 2002.5360000000774,
"styleRecalcs": 13,
"styleRecalcDurationMs": 8.846,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 373.5320000000001,
"heapDeltaBytes": 8674344,
"heapUsedBytes": 76314940,
"domNodes": -256,
"jsHeapTotalBytes": 4710400,
"scriptDurationMs": 8.241,
"eventListeners": -152,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "canvas-idle",
"durationMs": 2009.5400000000154,
"styleRecalcs": 11,
"styleRecalcDurationMs": 6.892,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 368.26200000000006,
"heapDeltaBytes": 4551996,
"heapUsedBytes": 66800176,
"domNodes": -259,
"jsHeapTotalBytes": 4448256,
"scriptDurationMs": 8.546999999999999,
"eventListeners": -152,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333335,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "canvas-mouse-sweep",
"durationMs": 1689.9640000000318,
"styleRecalcs": 46,
"styleRecalcDurationMs": 12.432000000000002,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 673.838,
"heapDeltaBytes": -3284324,
"heapUsedBytes": 59163280,
"domNodes": -259,
"jsHeapTotalBytes": 4186112,
"scriptDurationMs": 122.81,
"eventListeners": -174,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "canvas-mouse-sweep",
"durationMs": 1711.9639999999663,
"styleRecalcs": 46,
"styleRecalcDurationMs": 13.083,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 682.6940000000001,
"heapDeltaBytes": -2719272,
"heapUsedBytes": 59094992,
"domNodes": -261,
"jsHeapTotalBytes": 4972544,
"scriptDurationMs": 127.30899999999998,
"eventListeners": -174,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333335,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "canvas-zoom-sweep",
"durationMs": 1708.853999999974,
"styleRecalcs": 30,
"styleRecalcDurationMs": 11.387,
"layouts": 6,
"layoutDurationMs": 0.911,
"taskDurationMs": 271.1290000000001,
"heapDeltaBytes": 2239584,
"heapUsedBytes": 64518336,
"domNodes": 77,
"jsHeapTotalBytes": 4718592,
"scriptDurationMs": 11.052000000000001,
"eventListeners": 15,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "canvas-zoom-sweep",
"durationMs": 1691.7310000000043,
"styleRecalcs": 28,
"styleRecalcDurationMs": 12.893000000000002,
"layouts": 6,
"layoutDurationMs": 0.9239999999999999,
"taskDurationMs": 283.535,
"heapDeltaBytes": 3162168,
"heapUsedBytes": 70648668,
"domNodes": 76,
"jsHeapTotalBytes": 5767168,
"scriptDurationMs": 10.824999999999998,
"eventListeners": 15,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "dom-widget-clipping",
"durationMs": 547.1279999999297,
"styleRecalcs": 12,
"styleRecalcDurationMs": 7.61,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 373.72400000000005,
"heapDeltaBytes": 18623248,
"heapUsedBytes": 86134364,
"domNodes": 20,
"jsHeapTotalBytes": 4718592,
"scriptDurationMs": 134.29,
"eventListeners": 0,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666682,
"p95FrameDurationMs": 16.700000000000273
},
{
"name": "dom-widget-clipping",
"durationMs": 567.4400000000333,
"styleRecalcs": 13,
"styleRecalcDurationMs": 7.836999999999999,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 384.91299999999995,
"heapDeltaBytes": 18951048,
"heapUsedBytes": 86393616,
"domNodes": 21,
"jsHeapTotalBytes": 5767168,
"scriptDurationMs": 141.683,
"eventListeners": 0,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "dom-widget-order-dense-n200-w200-i120",
"durationMs": 1136.131999999975,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 817.4339999999999,
"heapDeltaBytes": -18458436,
"heapUsedBytes": 72673824,
"domNodes": -295,
"jsHeapTotalBytes": 23461888,
"scriptDurationMs": 58.53900000000001,
"eventListeners": -217,
"totalBlockingTimeMs": 503,
"frameDurationMs": 16.66999999999998,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "dom-widget-order-dense-n200-w200-i120",
"durationMs": 1052.5769999999284,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 707.6490000000001,
"heapDeltaBytes": -13533172,
"heapUsedBytes": 72764088,
"domNodes": -291,
"jsHeapTotalBytes": 19529728,
"scriptDurationMs": 48.21300000000001,
"eventListeners": -217,
"totalBlockingTimeMs": 396,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "dom-widget-order-sparse-n1000-w20-i120",
"durationMs": 764.3829999999525,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 382.5470000000002,
"heapDeltaBytes": 14407480,
"heapUsedBytes": 89713044,
"domNodes": 0,
"jsHeapTotalBytes": 0,
"scriptDurationMs": 119.51899999999999,
"eventListeners": 0,
"totalBlockingTimeMs": 158,
"frameDurationMs": 16.670000000000012,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "dom-widget-order-sparse-n1000-w20-i120",
"durationMs": 762.444999999957,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 370.92400000000004,
"heapDeltaBytes": 13832148,
"heapUsedBytes": 90484472,
"domNodes": 0,
"jsHeapTotalBytes": 0,
"scriptDurationMs": 117.89899999999997,
"eventListeners": 0,
"totalBlockingTimeMs": 160,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "extension-clean-combined-draw",
"durationMs": 7449.096999999938,
"styleRecalcs": 1,
"styleRecalcDurationMs": 0.09900000000000186,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 6607.236999999999,
"heapDeltaBytes": -9236420,
"heapUsedBytes": 72721160,
"domNodes": -18,
"jsHeapTotalBytes": 4980736,
"scriptDurationMs": 5244.798000000001,
"eventListeners": 0,
"totalBlockingTimeMs": 48,
"frameDurationMs": 18.333333333333332,
"p95FrameDurationMs": 33.29999999999927
},
{
"name": "extension-clean-combined-draw",
"durationMs": 7179.335000000037,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 6362.650000000001,
"heapDeltaBytes": 282228,
"heapUsedBytes": 82543864,
"domNodes": -16,
"jsHeapTotalBytes": 6815744,
"scriptDurationMs": 5300.453,
"eventListeners": 0,
"totalBlockingTimeMs": 29,
"frameDurationMs": 17.780000000000047,
"p95FrameDurationMs": 33.30000000000109
},
{
"name": "extension-rgthree-prototype-draw",
"durationMs": 7290.771999999947,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 6420.576,
"heapDeltaBytes": -14117568,
"heapUsedBytes": 68132892,
"domNodes": -16,
"jsHeapTotalBytes": 5505024,
"scriptDurationMs": 5135.225,
"eventListeners": 0,
"totalBlockingTimeMs": 100,
"frameDurationMs": 17.776666666666642,
"p95FrameDurationMs": 33.29999999999927
},
{
"name": "extension-rgthree-prototype-draw",
"durationMs": 7044.2749999999705,
"styleRecalcs": 1,
"styleRecalcDurationMs": 0.1030000000000024,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 6210.017,
"heapDeltaBytes": -316968,
"heapUsedBytes": 81561224,
"domNodes": -14,
"jsHeapTotalBytes": 5242880,
"scriptDurationMs": 4888.543000000001,
"eventListeners": 0,
"totalBlockingTimeMs": 37,
"frameDurationMs": 17.776666666666642,
"p95FrameDurationMs": 33.29999999999927
},
{
"name": "large-graph-idle",
"durationMs": 2007.7139999999645,
"styleRecalcs": 9,
"styleRecalcDurationMs": 6.5420000000000025,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 494.2949999999999,
"heapDeltaBytes": 20636708,
"heapUsedBytes": 84349068,
"domNodes": -237,
"jsHeapTotalBytes": 0,
"scriptDurationMs": 32.41999999999999,
"eventListeners": -152,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "large-graph-idle",
"durationMs": 2023.0470000000196,
"styleRecalcs": 10,
"styleRecalcDurationMs": 9.509,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 529.7539999999999,
"heapDeltaBytes": -8969580,
"heapUsedBytes": 78258556,
"domNodes": -247,
"jsHeapTotalBytes": 1077248,
"scriptDurationMs": 32.591,
"eventListeners": -174,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66999999999998,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "large-graph-pan",
"durationMs": 2182.464999999979,
"styleRecalcs": 71,
"styleRecalcDurationMs": 14.736,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 1409.1399999999999,
"heapDeltaBytes": -4313952,
"heapUsedBytes": 83728492,
"domNodes": -237,
"jsHeapTotalBytes": 2613248,
"scriptDurationMs": 683.62,
"eventListeners": -174,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "large-graph-pan",
"durationMs": 2189.7149999999783,
"styleRecalcs": 69,
"styleRecalcDurationMs": 12.850999999999997,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 1368.268,
"heapDeltaBytes": -13199468,
"heapUsedBytes": 74810452,
"domNodes": -246,
"jsHeapTotalBytes": 778240,
"scriptDurationMs": 670.369,
"eventListeners": -174,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.699999999999818
},
{
"name": "large-graph-zoom",
"durationMs": 3233.3489999999756,
"styleRecalcs": 65,
"styleRecalcDurationMs": 13.046999999999999,
"layouts": 60,
"layoutDurationMs": 12.984,
"taskDurationMs": 1501.8429999999998,
"heapDeltaBytes": -15899348,
"heapUsedBytes": 74408400,
"domNodes": -252,
"jsHeapTotalBytes": -495616,
"scriptDurationMs": 682.948,
"eventListeners": -174,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "large-graph-zoom",
"durationMs": 3236.6069999999354,
"styleRecalcs": 66,
"styleRecalcDurationMs": 14.925,
"layouts": 60,
"layoutDurationMs": 13.189000000000002,
"taskDurationMs": 1470.6729999999998,
"heapDeltaBytes": -16123728,
"heapUsedBytes": 73802852,
"domNodes": -246,
"jsHeapTotalBytes": -495616,
"scriptDurationMs": 649.462,
"eventListeners": -174,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "legacy-node-drag",
"durationMs": 2389.124999999922,
"styleRecalcs": 45,
"styleRecalcDurationMs": 7.750999999999998,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 1598.871,
"heapDeltaBytes": 17521380,
"heapUsedBytes": 83321348,
"domNodes": 10,
"jsHeapTotalBytes": 1204224,
"scriptDurationMs": 802.444,
"eventListeners": 180,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.670000000000012,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "legacy-node-drag",
"durationMs": 2320.0090000000273,
"styleRecalcs": 47,
"styleRecalcDurationMs": 12.146,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 1639.364,
"heapDeltaBytes": -1617276,
"heapUsedBytes": 82663880,
"domNodes": -249,
"jsHeapTotalBytes": 409600,
"scriptDurationMs": 802.7009999999999,
"eventListeners": 6,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "minimap-idle",
"durationMs": 2025.4639999999426,
"styleRecalcs": 8,
"styleRecalcDurationMs": 5.892999999999999,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 458.8119999999999,
"heapDeltaBytes": -4510096,
"heapUsedBytes": 84260416,
"domNodes": -244,
"jsHeapTotalBytes": -1019904,
"scriptDurationMs": 28.406999999999996,
"eventListeners": -152,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "minimap-idle",
"durationMs": 2035.667999999987,
"styleRecalcs": 9,
"styleRecalcDurationMs": 8.667000000000002,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 514.155,
"heapDeltaBytes": -7052292,
"heapUsedBytes": 82345304,
"domNodes": -243,
"jsHeapTotalBytes": 28672,
"scriptDurationMs": 29.923000000000005,
"eventListeners": -174,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "subgraph-dom-widget-clipping",
"durationMs": 521.6719999999668,
"styleRecalcs": 49,
"styleRecalcDurationMs": 10.819999999999999,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 323.658,
"heapDeltaBytes": 13718032,
"heapUsedBytes": 83941424,
"domNodes": 24,
"jsHeapTotalBytes": 5767168,
"scriptDurationMs": 118.71900000000001,
"eventListeners": 6,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66666666666665,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "subgraph-dom-widget-clipping",
"durationMs": 559.9539999999479,
"styleRecalcs": 48,
"styleRecalcDurationMs": 15.312,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 380.01199999999994,
"heapDeltaBytes": 14089640,
"heapUsedBytes": 83727564,
"domNodes": 22,
"jsHeapTotalBytes": 5767168,
"scriptDurationMs": 137.101,
"eventListeners": 6,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666682,
"p95FrameDurationMs": 16.799999999999727
},
{
"name": "subgraph-idle",
"durationMs": 2005.5419999999913,
"styleRecalcs": 13,
"styleRecalcDurationMs": 8.457,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 393.01399999999995,
"heapDeltaBytes": -9407532,
"heapUsedBytes": 60868608,
"domNodes": -273,
"jsHeapTotalBytes": 5758976,
"scriptDurationMs": 7.6129999999999995,
"eventListeners": -220,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "subgraph-idle",
"durationMs": 1990.0199999999586,
"styleRecalcs": 11,
"styleRecalcDurationMs": 7.7509999999999994,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 391.514,
"heapDeltaBytes": -1154900,
"heapUsedBytes": 62115372,
"domNodes": -277,
"jsHeapTotalBytes": 4972544,
"scriptDurationMs": 7.599999999999999,
"eventListeners": -220,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "subgraph-mouse-sweep",
"durationMs": 1677.3930000000519,
"styleRecalcs": 46,
"styleRecalcDurationMs": 13.22,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 601.604,
"heapDeltaBytes": -4998016,
"heapUsedBytes": 58107604,
"domNodes": -276,
"jsHeapTotalBytes": 5496832,
"scriptDurationMs": 87.765,
"eventListeners": -220,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "subgraph-mouse-sweep",
"durationMs": 1677.3859999999559,
"styleRecalcs": 46,
"styleRecalcDurationMs": 13.914,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 635.099,
"heapDeltaBytes": -4549872,
"heapUsedBytes": 58710356,
"domNodes": -273,
"jsHeapTotalBytes": 4448256,
"scriptDurationMs": 89.577,
"eventListeners": -220,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66999999999998,
"p95FrameDurationMs": 16.699999999999818
},
{
"name": "subgraph-transition-enter",
"durationMs": 850.7890000000771,
"styleRecalcs": 18,
"styleRecalcDurationMs": 22.305000000000007,
"layouts": 5,
"layoutDurationMs": 9.479,
"taskDurationMs": 691.303,
"heapDeltaBytes": -6240640,
"heapUsedBytes": 81342184,
"domNodes": 13667,
"jsHeapTotalBytes": 11272192,
"scriptDurationMs": 21.360000000000003,
"eventListeners": 2383,
"totalBlockingTimeMs": 87,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "viewport-pan-sweep",
"durationMs": 8245.317,
"styleRecalcs": 250,
"styleRecalcDurationMs": 38.091,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 4631.005,
"heapDeltaBytes": -6655852,
"heapUsedBytes": 80444484,
"domNodes": -213,
"jsHeapTotalBytes": 1564672,
"scriptDurationMs": 2202.336,
"eventListeners": -174,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "viewport-pan-sweep",
"durationMs": 8276.882999999998,
"styleRecalcs": 250,
"styleRecalcDurationMs": 37.940000000000005,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 4893.824,
"heapDeltaBytes": -11063992,
"heapUsedBytes": 76458096,
"domNodes": -240,
"jsHeapTotalBytes": 778240,
"scriptDurationMs": 2299.3949999999995,
"eventListeners": -174,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "vue-large-graph-idle",
"durationMs": 10841.250000000058,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 10465.965999999999,
"heapDeltaBytes": -46164204,
"heapUsedBytes": 181619068,
"domNodes": -8062,
"jsHeapTotalBytes": -14299136,
"scriptDurationMs": 210.99800000000002,
"eventListeners": -14928,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "vue-large-graph-idle",
"durationMs": 13968.87700000002,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 13733.360999999999,
"heapDeltaBytes": 10472800,
"heapUsedBytes": 181052604,
"domNodes": 0,
"jsHeapTotalBytes": -14417920,
"scriptDurationMs": 217.32399999999996,
"eventListeners": 0,
"totalBlockingTimeMs": 0,
"frameDurationMs": 17.220000000000073,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "vue-large-graph-pan",
"durationMs": 16747.608000000015,
"styleRecalcs": 115,
"styleRecalcDurationMs": 13.519999999999976,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 16518.797,
"heapDeltaBytes": -69743684,
"heapUsedBytes": 167147132,
"domNodes": -8062,
"jsHeapTotalBytes": -18460672,
"scriptDurationMs": 695.029,
"eventListeners": -14928,
"totalBlockingTimeMs": 22,
"frameDurationMs": 17.776666666666642,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "vue-large-graph-pan",
"durationMs": 16861.82399999984,
"styleRecalcs": 123,
"styleRecalcDurationMs": 13.547000000000004,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 16592.837,
"heapDeltaBytes": -36430204,
"heapUsedBytes": 190963668,
"domNodes": -8062,
"jsHeapTotalBytes": -15577088,
"scriptDurationMs": 715.341,
"eventListeners": -14928,
"totalBlockingTimeMs": 2,
"frameDurationMs": 17.223333333333358,
"p95FrameDurationMs": 16.80000000000291
},
{
"name": "vue-node-resize-workload",
"durationMs": 5153.209000000061,
"styleRecalcs": 20,
"styleRecalcDurationMs": 59.905999999999985,
"layouts": 20,
"layoutDurationMs": 20.730999999999998,
"taskDurationMs": 5080.019,
"heapDeltaBytes": -46362856,
"heapUsedBytes": 173953312,
"domNodes": -8062,
"jsHeapTotalBytes": 12713984,
"scriptDurationMs": 85.06499999999998,
"eventListeners": -14928,
"totalBlockingTimeMs": 263,
"frameDurationMs": 17.223333333333297,
"p95FrameDurationMs": 16.80000000000109
},
{
"name": "vue-node-resize-workload",
"durationMs": 5042.6400000001195,
"styleRecalcs": 20,
"styleRecalcDurationMs": 61.759000000000036,
"layouts": 20,
"layoutDurationMs": 21.121000000000002,
"taskDurationMs": 4978.705,
"heapDeltaBytes": -42762060,
"heapUsedBytes": 197276860,
"domNodes": -8062,
"jsHeapTotalBytes": 20652032,
"scriptDurationMs": 83.884,
"eventListeners": -14928,
"totalBlockingTimeMs": 203,
"frameDurationMs": 17.223333333333358,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "vue-zoom-out-idle",
"durationMs": 7260.42300000006,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 7056.593000000002,
"heapDeltaBytes": -341404,
"heapUsedBytes": 182201456,
"domNodes": 0,
"jsHeapTotalBytes": -5505024,
"scriptDurationMs": 102.974,
"eventListeners": 0,
"totalBlockingTimeMs": 0,
"frameDurationMs": 17.776666666666642,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "vue-zoom-out-idle",
"durationMs": 6922.358999999915,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 6798.089000000001,
"heapDeltaBytes": -13426512,
"heapUsedBytes": 171071800,
"domNodes": 0,
"jsHeapTotalBytes": -24379392,
"scriptDurationMs": 97.81199999999995,
"eventListeners": 0,
"totalBlockingTimeMs": 0,
"frameDurationMs": 17.223333333333358,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "workflow-execution",
"durationMs": 107.20200000002933,
"styleRecalcs": 9,
"styleRecalcDurationMs": 18.013,
"layouts": 3,
"layoutDurationMs": 1.4420000000000002,
"taskDurationMs": 80.83900000000001,
"heapDeltaBytes": 3236064,
"heapUsedBytes": 69002992,
"domNodes": 111,
"jsHeapTotalBytes": 262144,
"scriptDurationMs": 9.960000000000003,
"eventListeners": 33,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.663333333333338,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "workflow-execution",
"durationMs": 435.92000000012376,
"styleRecalcs": 19,
"styleRecalcDurationMs": 18.427,
"layouts": 4,
"layoutDurationMs": 1.466,
"taskDurationMs": 91.714,
"heapDeltaBytes": 5032492,
"heapUsedBytes": 70711364,
"domNodes": 150,
"jsHeapTotalBytes": 0,
"scriptDurationMs": 7.819000000000002,
"eventListeners": 81,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000273
}
]
} |
Reads the tool_calls a persisted assistant row now carries and folds them into the same ToolPart entries the live agent_tool_call WebSocket handler builds, so normalizeAgentTranscript()/hydrate() restore a completed turn's work summary through the existing collapsible UI instead of losing it on refresh or chat switch. No-ops when tool_calls is absent from a response.
54682b6 to
00737b4
Compare
Splits tool-call/text appending and run-approval handling out of normalizeAgentTranscript into applyAssistantRow, appendAssistantContent, and pendingRunApproval, following the parseUserWorkflowReferences extraction pattern, to bring cyclomatic complexity under the Fallow threshold.
…ction The composer's Send handler (Composer.vue onSend) no-ops and emits workflowTargetRequired instead of posting when hasWorkflowTarget is false, so the click never reached promptHistory and the poll on requests.length timed out. Every other promptHistoryTest spec that actually sends a message first drives the switchWorkflow -> "Unsaved Workflow" -> workflowSelection.finishSave(true) flow (see agentChatRefreshPersistence.spec.ts); this test was missing it.
Custom Nodes Ecosystem Matrix — red check is a harness/concurrency artifact, not this diffRoot-caused both failing runs (run 35593219841, run 35594199641): What actually happened, per each run's own job list:
Why: concurrency:
group: ecosystem-matrix-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' || github.event_name == 'merge_group' }}Each This is repo-wide, not specific to this PR. The same This PR's diff ( Re-run: skipping a manual re-run — a fresh No fix applied here — this is a harness/CI-config issue (concurrency cancellation racing a multi-minute matrix job on an actively-pushed branch), unrelated to and out of scope for this diff. Generated by Claude Code |
Playwright videos for new testsDownload the recorded videos and HTML report Recorded projects: cloud Recorded test titles:
|
Codecov Report✅ All modified and coverable lines are covered by tests. @@ Coverage Diff @@
## main #18282 +/- ##
==========================================
+ Coverage 83.49% 84.04% +0.55%
==========================================
Files 2988 2285 -703
Lines 147957 132895 -15062
Branches 38210 34346 -3864
==========================================
- Hits 123540 111696 -11844
+ Misses 23132 20900 -2232
+ Partials 1285 299 -986
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 800 files with indirect coverage changes 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
🔍 Cursor Review — Consolidated panel
Triggered by @christian-byrne.
Found 6 finding(s).
| Severity | Count |
|---|---|
| 🟠 High | 1 |
| 🟡 Medium | 2 |
| 🟢 Low | 3 |
Panel: 8/8 reviewers contributed findings.
| * that finished always sees `ok`/`error` for every call it made. | ||
| */ | ||
| function toolCallPartState(status: unknown): ToolPart['state'] { | ||
| return status === 'pending' || status === 'running' ? 'streaming' : 'done' |
There was a problem hiding this comment.
🟠 High — toolCallPartState maps a persisted pending/running status to state: 'streaming' regardless of the owning row's status, but hydrate() only attaches a transport when the row is a mid-ask run_approval, and settle() closes only text and thinking parts — so nothing can ever settle a restored tool part. Any turn reloaded with a call still in flight (mid-turn refresh, or an interrupted/errored turn) renders a permanently spinning animate-spin + shimmer row; consider clamping to a terminal state unless the row itself is streaming behind a live transport. Raised by 6 of 8 reviewers (claude-opus-5-thinking-max adversarial, claude-opus-5-thinking-max edge-case, gpt-5.6-sol-max adversarial, gpt-5.6-sol-max edge-case, kimi-k3-max adversarial, kimi-k3-max edge-case).
There was a problem hiding this comment.
Fixed in 3be32d3. applyAssistantRow now computes runApproval (and therefore isLive) before parsing tool calls, and threads that flag into toolCallPartState/toolCallOk: a restored pending/running call is clamped to state: 'done', ok: false unless its row is the one becoming transcript.pending (the run_approval mid-ask case with a live transport attached), which is the only case that legitimately keeps streaming. Added regression tests for both branches in agentTranscript.test.ts.
Generated by Claude Code
There was a problem hiding this comment.
Tracked as FE-2823. The PR merged with this thread unresolved, so the finding is carried in Linear rather than lost here. Filed automatically; close the ticket if the finding is no longer true at main.
| text: string | ||
| ): void { | ||
| const toolCalls = parseToolCalls(row.content) | ||
| if (toolCalls) message.parts = [...message.parts, ...toolCalls] |
There was a problem hiding this comment.
🟡 Medium — Restored tool parts are now appended to every assistant row, including the mid-ask row that becomes transcript.pending, but hydrate() then builds a fresh createAgentEventTransport whose tool_call_id map starts empty and is never seeded from message.parts. After a reload during a run-approval ask, the next agent_tool_call frame for an already-restored call pushes a second ToolPart instead of updating it, leaving a duplicate that foldActivity collapses into a bogus ×2 with doubled duration. Raised by 4 of 8 reviewers (gpt-5.6-sol-max adversarial, gpt-5.6-sol-max edge-case, claude-opus-5-thinking-max edge-case, kimi-k3-max edge-case).
There was a problem hiding this comment.
Fixed in 3be32d3. createAgentEventTransport now seeds its tools map from any ToolParts already present on the message it's given (message.parts.filter(part => part.type === 'tool').map(...)), so when hydrate() builds a fresh transport for the pending run_approval row, an incoming live agent_tool_call frame for an already-restored call updates that part in place instead of pushing a duplicate. Added a regression test in agentEventTransport.test.ts ("updates an already-restored tool part in place instead of duplicating it").
Generated by Claude Code
There was a problem hiding this comment.
Tracked as FE-2823. The PR merged with this thread unresolved, so the finding is carried in Linear rather than lost here. Filed automatically; close the ticket if the finding is no longer true at main.
| function toolCallOk(status: unknown): boolean | undefined { | ||
| if (status === 'ok') return true | ||
| if (status === 'error') return false | ||
| return undefined |
There was a problem hiding this comment.
🟡 Medium — toolCallOk recognizes only ok and error, so any other terminal status (failed, cancelled, timeout, or the live WebSocket vocabulary's success from agentApiSchema.ts) yields state: 'done' with ok omitted, which toolGlyph renders with the neutral known-tool icon — visually identical to a success. A restored transcript can therefore present failed calls as completed work; default unrecognized statuses to a non-success presentation, or validate against a shared enum so vocabulary drift becomes a compile error. Raised by 4 of 8 reviewers (claude-opus-5-thinking-max adversarial, claude-opus-5-thinking-max edge-case, gpt-5.6-sol-max adversarial, gpt-5.6-sol-max edge-case).
There was a problem hiding this comment.
Fixed in 3be32d3. toolCallOk now returns undefined only while genuinely in progress (state === 'streaming'), and otherwise treats ok/success as success and anything else (error, failed, cancelled, timeout, or any other unrecognized terminal string) as failure — never omitted/neutral. This is deliberately robust to both the persisted (ok/error) and live WebSocket (running/success/error) vocabularies, since the companion backend change (Comfy-Org/cloud#9960) landed with the wire status confirmed as ok→success, error→error. Added parameterized regression tests covering success, failed, cancelled, timeout, and an unrecognized string.
Generated by Claude Code
There was a problem hiding this comment.
Tracked as FE-2823. The PR merged with this thread unresolved, so the finding is carried in Linear rather than lost here. Filed automatically; close the ticket if the finding is no longer true at main.
| name: toolName, | ||
| state: toolCallPartState(status), | ||
| ...(toolCallOk(status) !== undefined ? { ok: toolCallOk(status) } : {}), | ||
| ...(typeof durationMs === 'number' ? { durationMs } : {}) |
There was a problem hiding this comment.
🟢 Low — typeof durationMs === 'number' admits NaN, Infinity (JSON 1e999), and negatives, which this otherwise-defensive parser rejects for every other field. These flow into totalDurationMs, where Infinity % 60 is NaN and the work-summary label falls through to splitMinutes and renders NaN minutes/seconds, while negatives silently subtract from the turn total; use Number.isFinite(durationMs) && durationMs >= 0. Raised by 3 of 8 reviewers (claude-opus-5-thinking-max adversarial, claude-opus-5-thinking-max edge-case, kimi-k3-max adversarial).
There was a problem hiding this comment.
Fixed in 3be32d3: now typeof durationMs === 'number' && Number.isFinite(durationMs) && durationMs >= 0. Added a parameterized regression test covering NaN, Infinity, -Infinity, and -1.
Generated by Claude Code
There was a problem hiding this comment.
Tracked as FE-2823. The PR merged with this thread unresolved, so the finding is carried in Linear rather than lost here. Filed automatically; close the ticket if the finding is no longer true at main.
| ): ToolPart[] | undefined { | ||
| const raw = content?.tool_calls | ||
| if (!Array.isArray(raw)) return undefined | ||
| const parts = (raw as unknown[]).flatMap((entry): ToolPart[] => { |
There was a problem hiding this comment.
🟢 Low — This flatMap appends every entry unconditionally, unlike the live path it mirrors, which keys parts by tool_call_id in a map and updates in place. Because one turn's message accumulates across assistant rows (assistants.get(turnId)), a repeated callId — within a single row's list or across two rows of the same turn — shows the call twice and makes foldActivity report a ×2 whose durationMs is the sum; keying by callId and keeping the last entry would match live semantics. Raised by 2 of 8 reviewers (claude-opus-5-thinking-max adversarial, claude-opus-5-thinking-max edge-case).
There was a problem hiding this comment.
Fixed in 3be32d3. parseToolCalls now builds a Map<callId, ToolPart> instead of a flatMap, so a repeated id within one row's tool_calls is deduped, keeping the last entry's data at the first entry's position (matching how the live path updates a part in place rather than appending). Added a regression test ("dedupes a repeated callId within one row...").
Generated by Claude Code
There was a problem hiding this comment.
Tracked as FE-2823. The PR merged with this thread unresolved, so the finding is carried in Linear rather than lost here. Filed automatically; close the ticket if the finding is no longer true at main.
| { | ||
| id: 'call-1', | ||
| tool_name: 'search_nodes', | ||
| status: 'ok', |
There was a problem hiding this comment.
🟢 Low — This mock is the only end-to-end proof of the feature, yet it asserts against a payload the test itself authors, hardcoding the same status: 'ok' literal the production parser assumes. If the real getMessages response uses a different vocabulary, the test still passes while restored tool calls lose their success/failure state; deriving the fixture from the generated ingest types or asserting against a shared schema would close that gap. Raised by 1 of 8 reviewers (claude-opus-5-thinking-max adversarial).
There was a problem hiding this comment.
Addressed in 3be32d3, within scope: call-2's mock status is now 'success' instead of 'ok', so the fixture exercises both terminal literals (ok and success) rather than only the one the production parser happens to special-case for the "success" test path. Deriving the fixture from the generated ingest types is out of scope here since AgentMessage.content is still { [key: string]: unknown } in packages/ingest-types (no tool_calls in the generated contract yet) — that's a larger, separate change.
Generated by Claude Code
There was a problem hiding this comment.
Tracked as FE-2823. The PR merged with this thread unresolved, so the finding is carried in Linear rather than lost here. Filed automatically; close the ticket if the finding is no longer true at main.
…ndling Cursor review findings on restored (non-live) tool-call parts in agentTranscript.ts: - A pending/running tool call restored from a persisted row with no live transport attached now clamps to state: 'done', ok: false instead of spinning forever. A row that is the live run_approval mid-ask keeps streaming, since its transport can still settle it. - toolCallOk/toolCallPartState now treat ok/success as success and any other terminal string (error, failed, cancelled, timeout, unrecognized) as failure, so the frontend is robust to either the persisted ok/error vocabulary or the live running/success/error vocabulary. - durationMs now requires Number.isFinite + >= 0, rejecting NaN/Infinity/ negative values that broke the work-summary duration label. - Duplicate callId entries within one row's tool_calls are deduped, keeping the last entry's data at the first entry's position, matching live semantics. - createAgentEventTransport now seeds its tool_call_id map from any ToolParts already on the message it is given, so a live agent_tool_call frame for an already-restored call (the run_approval mid-ask case) updates that part in place instead of pushing a duplicate. Extends the e2e mock to cover both terminal vocabularies (ok and success).
dante01yoon
left a comment
There was a problem hiding this comment.
Thanks for the thorough description and for wiring the restore through the existing WorkSummary/ActivityTrace components rather than building parallel UI — routing both transitions through normalizeAgentTranscript is the right shape, and I verified it holds: hydrate() replaces messages.value wholesale, so reload and chat switch share one code path and a previous chat's summary cannot bleed onto the next one.
Requesting changes primarily on the API contract, plus four behavioural defects that follow from it.
Source of truth. The restored summary is read, not reconstructed — the per-call facts (id, tool_name, status, duration_ms) come from the server's persisted row, and the frontend only folds them into the same ToolPart shape the live path uses. That is the right design. The one place it slips is the "Worked for Xs" headline, which is re-summed client-side over a partial restore (thinking spans are never rebuilt), so the same turn shows a different number before and after a refresh — see the comment on line 163.
Contract (blocking). tool_calls exists nowhere in the ingest contract at head:
packages/ingest-types/src/types.gen.ts:4599—AgentMessage.content?: { [key: string]: unknown }, whose doc comment states assistant turns carry{text}and nothing else.packages/ingest-types/src/zod.gen.ts:2725—content: z.record(z.unknown()).optional(), so nothing validates it.- No
ToolCallSummary/tool_name/duration_msanywhere in the generated package.
So the shape is hand-declared at the read site (entry as Record<string, unknown>), which is the drift pattern from #14771 and structurally the same as #17327. Could we do spec -> regenerate -> merge generated-types PR -> build against it? The three misrender bugs below would all become compile or validation errors under that order.
Blocking issues (5)
agentTranscript.ts:129—tool_callshand-parsed out of an untypedz.record(z.unknown()); no generated type, no validation.agentTranscript.ts:116— invented status vocabulary (okhere vs the validatedz.enum(['running','success','error'])the live path uses); any unrecognised terminal status renders with the success glyph, so failed calls look completed.agentTranscript.ts:110— restoredpending/runningcalls map tostate: 'streaming', and neithersettle()norhydrate()can ever close them; a finished thread keeps ananimate-spinrow forever. The new unit test atagentTranscript.test.ts:276asserts this behaviour as intended, on astatus: 'complete'row.agentTranscript.ts:164— restored parts are not keyed bycallIdnor seeded into the transport'stoolsmap, so a resumed turn re-pushes an already-restored call andfoldActivityreports a×2with summed duration.agentTranscript.ts:163— restored "Worked for Xs" omits thinking durations that the live label includes, so the headline changes across a reload and two tabs on one conversation disagree.
Non-blocking: duration_ms guard (agentTranscript.ts:147), the self-fulfilling e2e fixture vocabulary (spec line 95), the non-discriminating /worked/i label assertion (spec line 124), and missing chat-switch coverage (spec line 117). One question: about whether the backend field has actually shipped (line 121).
Tests. The new unit tests are genuinely discriminating — fixtures use non-empty text ('Done'), and the headline assertions fail on main (no tool parts -> no trace group -> WorkSummary never mounts). The e2e also fails without this change. Two soft spots: /worked/i matches the zero-duration fallback "Worked", and 'omits tool parts entirely when a message carries no tool_calls' passes on main too — fine as a compatibility guard, just not evidence for the feature.
CI at head 60cb58c8: green — 101 passing, 27 skipped, 0 failing. The earlier ecosystem-matrix red is resolved on this SHA, and your root-cause comment about the concurrency cancellation matches what I see. Bundle is +259 kB gzip, which looks unrelated to these four files and worth a sanity check against the base run.
I did not run the test suite locally (/workspace is shared and read-only for me, and installing dependencies was out of scope), so all verification above is by reading the code at head plus CI results.
| function parseToolCalls( | ||
| content: Record<string, unknown> | undefined | ||
| ): ToolPart[] | undefined { | ||
| const raw = content?.tool_calls |
There was a problem hiding this comment.
issue: tool_calls is a server response field that exists nowhere in the ingest contract, so this reads it out of an untyped escape hatch and hand-rolls its shape locally.
I checked the generated package at head:
packages/ingest-types/src/types.gen.ts:4599—AgentMessage.content?: { [key: string]: unknown }, and its doc comment enumerates the contract explicitly: "Assistant turns carry {text} — the final answer text (or error copy on a failed turn)." Notool_calls.packages/ingest-types/src/zod.gen.ts:2725—content: z.record(z.unknown()).optional(), so nothing validates what lands in there.ToolCallSummary,tool_name, andduration_msappear nowhere intypes.gen.ts,zod.gen.ts, orindex.ts. The onlyagent_tool_callhit is prose about the WebSocket stream.
The doc block just above (line 121) names ToolCallSummary as if it were a shared type, but no such export exists on the frontend side — the shape is re-declared here by destructuring entry as Record<string, unknown> on line 138. That is the hand-declared-response-type pattern that drifted in #14771, and structurally the same as #17327, where selection.workflow_id landed inside a z.record(z.unknown()) and ended up typed and validated by nothing.
Could we follow the contract-first order instead — (1) land the field in ComfyUI/Cloud and the OpenAPI spec, (2) regenerate, (3) merge the generated-types PR, (4) build this against the generated tool_calls type? Then CI enforces the contract rather than code review, and the concrete bugs below (status vocabulary, terminal-state handling) become compile/validation errors instead of silent misrenders.
Worth noting this file's own schema module already shows the sanctioned pattern for a genuine FE-side extension: src/workbench/extensions/agent/schemas/agentApiSchema.ts:97 does zGeneratedAgentMessage.extend({ pending_ask: zAgentPendingAsk.optional() }) — a validated extension on top of the generated export. If there is a reason tool_calls cannot go through the spec right now, routing it through that same .extend() would at least give it runtime validation and one declared shape, rather than an ad-hoc cast at the read site.
There was a problem hiding this comment.
Fixed in 49339f4, via the scoped path you suggested rather than the full OpenAPI regen: agentApiSchema.ts now has zPersistedToolCallSummary, a validated FE-side schema for one content.tool_calls entry (id, tool_name, status, duration_ms), defined next to zAgentPendingAsk/zAgentToolCallData in the same module. agentTranscript.ts's parseToolCallEntry now does zPersistedToolCallSummary.safeParse(entry) instead of the entry as Record<string, unknown> cast, so a malformed entry (missing id/tool_name, wrong types) is rejected by the schema rather than by hand-rolled typeof checks.
Two deliberate deviations, both explained in the schema's doc comment:
statusstaysz.string()rather than a closed enum, because an unrecognized value must still surface as a failedToolPart(see the reply on the status-vocabulary thread) rather than have the entire entry silently dropped by schema validation — a closed enum would turn "unknown status" into "entry vanishes," which is worse.duration_msstaysz.unknown()rather thanz.number(), because a NaN/Infinity/negative value there shouldn't sink the otherwise-valid entry;parseToolCallEntrynarrows it separately and just omits the field, matching the finding on that thread.
I didn't extend AgentMessage.content itself (i.e. didn't make content: z.object({tool_calls: ...}).passthrough()), since content also carries attachments/attachment_refs/workflow_references whose own malformed-input tests expect per-field graceful degradation rather than whole-message parse rejection — extending content's schema would risk rejecting an entire persisted row over one bad optional field elsewhere. The narrower tool_calls-only schema, applied at the point of use, gets the validation win without that risk.
Generated by Claude Code
There was a problem hiding this comment.
Tracked as FE-2823. The PR merged with this thread unresolved, so the finding is carried in Linear rather than lost here. Filed automatically; close the ticket if the finding is no longer true at main.
| function toolCallOk(status: unknown): boolean | undefined { | ||
| if (status === 'ok') return true | ||
| if (status === 'error') return false | ||
| return undefined |
There was a problem hiding this comment.
issue: I think a failed restored tool call can render as a successful one, because this path invents a status vocabulary that nothing validates against the server's.
The live WebSocket path validates its statuses with a real enum — src/workbench/extensions/agent/schemas/agentApiSchema.ts:140 has status: z.enum(['running', 'success', 'error']), and agentEventTransport.ts sets part.ok = event.data.status === 'success'. This persisted path instead assumes pending | running | ok | error, so the two halves of the same feature disagree on the word for success (success vs ok).
Failure path: any terminal status this function does not recognise falls through to return undefined, so ok is omitted from the ToolPart. toolGlyph(name, 'done', undefined) in agentToolGlyph.ts then returns knownTool(name)?.icon ?? 'icon-[lucide--wrench]' — the exact glyph a successful call gets. A restored transcript would present a failed, cancelled, or timed-out call as completed work, with no visual difference at all.
That is reachable if the persisted rows use the service's own WebSocket word success, or any status outside this pair (failed, cancelled, timeout). Because content is z.record(z.unknown()) (see the comment on line 129), nothing in CI would catch that mismatch.
Two things would close it: default an unrecognised terminal status to a non-success presentation rather than the neutral one, and validate against a shared enum from the generated types so vocabulary drift is a compile error instead of a silent misrender.
There was a problem hiding this comment.
Fixed in 3be32d3 (and the schema in 49339f4 now validates the shape this depends on). toolCallOk(status, state) returns undefined only while state === 'streaming' (genuinely in progress); otherwise ok/success → true, and everything else — error, failed, cancelled, timeout, or any other string this function has never seen — → false, never omitted/neutral. Confirmed against the now-landed (not yet merged) companion backend PR Comfy-Org/cloud#9960: its shared persist.ToolCallWireStatus translation emits exactly success/error as the two terminal wire values for both live and reload, which this handles, while still defensively covering the legacy ok/error pair and anything unrecognized. Added parameterized tests covering success, failed, cancelled, timeout, and an unrecognized string.
Generated by Claude Code
There was a problem hiding this comment.
Tracked as FE-2823. The PR merged with this thread unresolved, so the finding is carried in Linear rather than lost here. Filed automatically; close the ticket if the finding is no longer true at main.
| * that finished always sees `ok`/`error` for every call it made. | ||
| */ | ||
| function toolCallPartState(status: unknown): ToolPart['state'] { | ||
| return status === 'pending' || status === 'running' ? 'streaming' : 'done' |
There was a problem hiding this comment.
issue: a restored pending/running call maps to state: 'streaming', but nothing on the restore path can ever move it to done, so it spins forever.
Tracing what could settle it:
agentEventTransport.tssettle()calls onlycloseOpenText()andcloseOpenThinking()and setsmessage.streaming = false. It never touches tool parts.agentConversationStore.ts:282-290—hydrate()only constructs a transport at all whentranscript.pendingexists, i.e. when the row isstatus === 'streaming'and carries arun_approvalask. For every other row there is no transport in the first place.
So for a completed/errored/interrupted row that persisted a call as still in flight, the restored part keeps state: 'streaming' permanently, and toolGlyph returns animate-spin icon-[lucide--loader-circle] with the agent-shimmer-text label — an agent that looks like it is still working on a thread that finished hours ago.
The doc comment above asserts "a turn that finished always sees ok/error for every call it made", but that is an assumption about backend behaviour, and the PR's own unit test contradicts it: agentTranscript.test.ts:276 builds a row via row(1, 'assistant', ...), which hardcodes status: 'complete', gives it a running tool call, and asserts state: 'streaming' is correct. That test encodes exactly the permanently-spinning case as intended behaviour.
Could we clamp to a terminal state unless the owning row is genuinely streaming behind a live transport, and flip that test to assert the clamp? An interrupted turn in particular (status: 'interrupted' is in the generated AgentMessage enum) seems very likely to persist a call mid-flight.
There was a problem hiding this comment.
Fixed in 3be32d3, and the test you quoted is flipped rather than removed. applyAssistantRow now computes whether this specific row is the one becoming transcript.pending (the live run_approval mid-ask case) before parsing its tool calls, and passes that as isLive into toolCallPartState. A restored pending/running call now clamps to state: 'done', ok: false unless isLive, which is the only case with an actual transport able to settle it later. agentTranscript.test.ts now has "clamps a restored pending/running tool call to done+ok:false with no live transport" (the old case, now asserting the clamp) and "keeps a pending/running tool call streaming when its row is the live run_approval ask" (the case that must still work).
Per the coordinator's later update: the companion backend fix (Comfy-Org/cloud#9960) also now excludes pending/running rows from ToolCallsForThread entirely, which removes the main real-world trigger — but the clamp stays as defense-in-depth regardless (an interrupted row could still plausibly persist one, and it costs nothing).
Generated by Claude Code
There was a problem hiding this comment.
Tracked as FE-2823. The PR merged with this thread unresolved, so the finding is carried in Linear rather than lost here. Filed automatically; close the ticket if the finding is no longer true at main.
| text: string | ||
| ): void { | ||
| const toolCalls = parseToolCalls(row.content) | ||
| if (toolCalls) message.parts = [...message.parts, ...toolCalls] |
There was a problem hiding this comment.
issue: restored parts are appended without being keyed by callId, so a resumed turn can show the same call twice as a bogus ×2 with a doubled duration.
When the row is a mid-ask run_approval, this same message becomes transcript.pending, and agentConversationStore.ts:286 then builds a fresh transport for it: createAgentEventTransport(transcript.pending.message, replaceActive). Inside that transport, const tools = new Map<string, ToolPart>() starts empty and is never seeded from message.parts.
Failure path: reload during a run-approval ask with a call persisted as running; the user approves; the turn resumes and the service emits agent_tool_call for that same tool_call_id. tools.get(...) misses, so the transport pushes a second ToolPart beside the restored one instead of updating it. foldActivity in agentActivityRows.ts folds consecutive same-name rows into count += 1 and durationMs = (previous.durationMs ?? 0) + part.durationMs, so the trace reads ×2 with the duration summed for what was one call.
The flatMap on line 131 has the same gap in the other direction: it appends every entry unconditionally, so a repeated callId within one row's list, or across two assistant rows of the same turn (they accumulate through assistants.get(turnId)), double-renders the same way. The live path deliberately avoids both by keying on tool_call_id.
Keying the parse by callId and keeping the last entry, plus seeding the transport's tools map from the restored parts when hydrate() resumes a pending turn, would make restore match live semantics. This shares a root cause with the streaming-clamp issue on line 110 — restored in-flight calls are never reconciled with the live transport.
There was a problem hiding this comment.
Fixed in 3be32d3 — made a real effort here rather than deferring, and it turned out to fit cleanly in both places you named:
- The
flatMapyou flagged (line 131) is gone:parseToolCallsnow builds aMap<callId, ToolPart>(further refactored in 49339f4 intoparseToolCallEntry+ a small loop), so a repeatedcallIdwithin one row's list, or across two rows of the same turn (they accumulate viaassistants.get(turnId)), is deduped, keeping the last entry's data at the first entry's position — matching live update-in-place semantics. - The transport-seeding half is also fixed, not deferred:
createAgentEventTransport(agentEventTransport.ts) now seeds itstoolsmap straight frommessage.partsat construction time:This works for both the fresh-message case (const tools = new Map<string, ToolPart>( message.parts .filter((part): part is ToolPart => part.type === 'tool') .map((part) => [part.callId, part]) )
startTurn, wheremessage.partsis empty, so it's a no-op) and the hydrated pending-row case (wheremessage.partsalready has the restoredToolParts), with no signature change to the function and no change needed at either call site. Added a regression test inagentEventTransport.test.ts: "updates an already-restored tool part in place instead of duplicating it".
Generated by Claude Code
There was a problem hiding this comment.
Tracked as FE-2823. The PR merged with this thread unresolved, so the finding is carried in Linear rather than lost here. Filed automatically; close the ticket if the finding is no longer true at main.
| row: AgentMessages[number], | ||
| text: string | ||
| ): void { | ||
| const toolCalls = parseToolCalls(row.content) |
There was a problem hiding this comment.
issue: the restored "Worked for Xs" headline will not match the one the same turn showed live, because only tool calls are restored and the total is re-summed in the frontend.
WorkSummary.vue computes its label from totalDurationMs(parts), and AgentMessage.vue:43 feeds it every activity part — part.type === 'tool' || part.type === 'thinking'. Live, agentEventTransport.ts's closeOpenThinking() stamps each ThinkingPart with durationMs = Date.now() - openThinkingStartedAt, so thinking spans are part of that total. This restore path parses only content.tool_calls; no thinking span is ever rebuilt.
So for a turn that spent most of its time thinking, the summary reads e.g. "Worked for 12.3 seconds" while live and "Worked for 0.6 seconds" after a refresh — and two tabs open on the same conversation disagree, one having reloaded and one not. That number is presented as a record of what the agent actually did, so it should be given by the server rather than re-derived from whichever subset of parts the client happens to hold.
Since the contract work in the comment on line 129 has to happen anyway, would it make sense to have the turn's worked-duration (or the thinking spans) persisted and served alongside tool_calls, so live and restored render the same value from the same source? If restoring thinking spans is out of scope for this PR, it would be worth saying so explicitly in the description, because as written the feature silently changes a user-visible number across a reload.
There was a problem hiding this comment.
Agreed this is real, and going with option (b) rather than fixing it in this PR: persisting/restoring thinking-span durations so live and reloaded totals agree from the same source is a genuinely separate, larger change (it needs a new persisted field and a parsing path parallel to tool_calls, not a tweak to this one). Added a "Known limitations" section to the PR description spelling out exactly the scenario you described (turn spends most of its time thinking → restored total reads lower than live, and two tabs on the same conversation can disagree), and noted that persisting the turn's worked-duration or thinking spans is tracked as a follow-up rather than silently shipped as correct. Thank you for calling this out explicitly rather than letting it ship as an unremarked number change.
Generated by Claude Code
There was a problem hiding this comment.
Tracked as FE-2823. The PR merged with this thread unresolved, so the finding is carried in Linear rather than lost here. Filed automatically; close the ticket if the finding is no longer true at main.
| name: toolName, | ||
| state: toolCallPartState(status), | ||
| ...(toolCallOk(status) !== undefined ? { ok: toolCallOk(status) } : {}), | ||
| ...(typeof durationMs === 'number' ? { durationMs } : {}) |
There was a problem hiding this comment.
suggestion (non-blocking): typeof durationMs === 'number' is the one unguarded check in an otherwise carefully defensive parser — it admits Infinity (JSON accepts 1e999) and negatives.
Infinity flows into totalDurationMs, fails the ms < MS_PER_MINUTE branch in formatDuration.ts, and reaches splitMinutes, where Infinity % 60 is NaN — the label renders as Infinitym NaNs. A negative silently subtracts from the turn total. Number.isFinite(durationMs) && durationMs >= 0 would match how id and tool_name are handled two lines up.
There was a problem hiding this comment.
Fixed in 3be32d3 (and the guard now lives alongside the new schema validation as of 49339f4): duration_ms is checked with typeof rawDuration === 'number' && Number.isFinite(rawDuration) && rawDuration >= 0, rejecting NaN/Infinity/negatives while keeping the rest of the entry intact (a bad duration_ms just omits that one field rather than dropping the whole tool call — see the reply on the contract/typing thread for why the schema itself doesn't tighten duration_ms to z.number()). Added a parameterized regression test covering NaN, Infinity, -Infinity, and -1.
Generated by Claude Code
There was a problem hiding this comment.
Tracked as FE-2823. The PR merged with this thread unresolved, so the finding is carried in Linear rather than lost here. Filed automatically; close the ticket if the finding is no longer true at main.
| { | ||
| id: 'call-1', | ||
| tool_name: 'search_nodes', | ||
| status: 'ok', |
There was a problem hiding this comment.
suggestion (non-blocking): this fixture authors the same status: 'ok' literal the parser assumes, so it can only confirm the parser agrees with itself.
The const messages: AgentMessage[] annotation on line 71 looks like it guards the payload against the real contract — and jsonRoute's own doc comment promises callers can "catch contract drift against the real API shape" — but it cannot here: AgentMessage.content is { [key: string]: unknown } in packages/ingest-types/src/types.gen.ts:4599, so tool_calls type-checks no matter what is inside it. If the real getMessages uses the service's WebSocket word success instead of ok, this test still passes green while every restored call loses its success/failure state (see the comment on toolCallOk).
Once tool_calls is in the OpenAPI spec, deriving this fixture from the generated type — or parsing it through the generated zod schema in the route handler — would make the test fail on vocabulary drift, which is the one thing it cannot currently detect.
There was a problem hiding this comment.
Partially addressed in 49339f4, with the remaining gap named rather than hidden. The mock's call-2 now uses 'success' instead of 'ok' for call-1 (both terminal literals exercised in one fixture), and — more substantively — zPersistedToolCallSummary (added in 49339f4, see the contract/typing thread) now runs for real on this exact path: the app's own parseToolCallEntry validates whatever getMessages actually returns through that schema, so a vocabulary mismatch would now be caught by schema validation at runtime rather than silently mis-rendered. I did not derive the fixture literal from a generated type, since AgentMessage.content is still { [key: string]: unknown } in packages/ingest-types — that part of the gap only closes once tool_calls is in the OpenAPI spec, which is the larger multi-repo sequencing you and I both flagged as out of scope for this PR.
Generated by Claude Code
There was a problem hiding this comment.
Tracked as FE-2823. The PR merged with this thread unresolved, so the finding is carried in Linear rather than lost here. Filed automatically; close the ticket if the finding is no longer true at main.
| const reopenedPanel = page.locator('#agent-panel-root') | ||
| await expect(reopenedPanel).toBeVisible({ timeout: 30_000 }) | ||
|
|
||
| const summary = reopenedPanel.getByRole('button', { name: /worked/i }) |
There was a problem hiding this comment.
suggestion (non-blocking): /worked/i also matches the zero-duration fallback, so the duration half of the restore is not actually asserted.
WorkSummary.vue renders t('agent.worked') — plain "Worked" — whenever totalMs <= 0, and t('agent.workedForSeconds') = "Worked for {seconds} seconds" otherwise. Both match this regex, so the test would stay green even if every duration_ms were dropped on the floor during parsing.
The fixture's 420 + 180 ms should render "Worked for 0.6 seconds"; asserting that exact string would make the duration_ms path discriminating at no extra cost.
To be clear, the rest of the test does earn its keep: on main a restored transcript has no tool or thinking parts, so AgentMessage.vue emits no trace group and WorkSummary never mounts — the visibility assertion on line 125 genuinely fails without this change.
There was a problem hiding this comment.
Fixed in 49339f4. The assertion now matches the exact agent.workedForSeconds label interpolated with 0.6 ("Worked for 0.6 seconds" — 420ms + 180ms), via getByRole('button', { name: workedLabel, exact: true }), instead of the non-discriminating /worked/i. Good catch — this now actually fails if duration_ms parsing regresses.
Generated by Claude Code
There was a problem hiding this comment.
Tracked as FE-2823. The PR merged with this thread unresolved, so the finding is carried in Linear rather than lost here. Filed automatically; close the ticket if the finding is no longer true at main.
| .getByRole('button', { name: enMessages.agent.stop, exact: true }) | ||
| .click() | ||
|
|
||
| await page.reload() |
There was a problem hiding this comment.
suggestion (non-blocking): the title promises reload and chat switch, but only reload is exercised end to end.
I traced the switch path and the mechanism does look sound: useAgentSession.ts loadThread() -> hydrateFromServer() -> conversationStore.hydrate(), and hydrate() does messages.value = transcript.messages — a wholesale replacement — so the previous chat's work summary cannot bleed onto the new one. Both transitions share normalizeAgentTranscript, which the new unit tests cover well.
What is not covered anywhere is the switch transition itself: no test loads thread A with tool calls, switches to thread B, and asserts A's summary is gone while B's own is present. Given that "stale summary on the wrong conversation" is the kind of defect a reader of this title would most want guarded, an A -> B -> A case in agentConversationStore.test.ts (cheaper than a second Playwright run) would lock in the no-bleed property.
Also worth a note here: the stop click on line 113-115 and the reload are both needed to avoid racing a permanently-streaming message, which is itself a symptom of the clamp gap flagged on agentTranscript.ts:110.
There was a problem hiding this comment.
Added in 49339f4: agentConversationStore.test.ts now has "does not bleed a tool-call summary onto a different chat, and restores it when switching back" — hydrates thread A (with a tool call), asserts a tool part exists, hydrates thread B (no tool calls), asserts none exist anywhere in store.messages, then hydrates A again and asserts the tool part is back. This locks in the no-bleed property you traced through useAgentSession.ts/hydrateFromServer()/conversationStore.hydrate()'s wholesale messages.value replacement, cheaper than a second Playwright run as you suggested.
Generated by Claude Code
There was a problem hiding this comment.
Tracked as FE-2823. The PR merged with this thread unresolved, so the finding is carried in Linear rather than lost here. Filed automatically; close the ticket if the finding is no longer true at main.
|
|
||
| /** | ||
| * A persisted assistant row's `tool_calls` are `ToolCallSummary` objects | ||
| * (`id`, `tool_name`, `status`, plus omitted-when-empty detail fields this UI |
There was a problem hiding this comment.
question: is the backend field live today, and under which exact shape?
The description says "GET /agent/threads/:id/messages now returns each assistant message's tool_calls", but the Compatibility section says the behaviour "only takes effect once the corresponding cloud backend change lands". Those read as contradictory, and I could not verify either from this repo — tool_calls is absent from the generated ingest types and the e2e comment on the spec file points at services/agent/server/agent_handler.go, which lives elsewhere.
This matters beyond bookkeeping: this doc block names ToolCallSummary and its field set as though they were settled, and the parser's ok/error vocabulary and duration_ms unit are derived from that assumption. Could you confirm whether the serializer has merged, and link the spec change that describes the field? If it has not merged yet, that is the natural moment to do the spec -> regenerate -> merge -> build sequence rather than landing the reader first.
There was a problem hiding this comment.
Confirmed: the backend field is not yet merged. The companion change is Comfy-Org/cloud#9960 — it's open and green (as of its commit 96cd50f, which nails down the wire vocabulary as success/error via a shared persist.ToolCallWireStatus translation used by both the live and reload paths, and excludes pending/running rows from restored history), but not yet merged to cloud's main branch. The PR description's "Compatibility" section was accurate as written; I've tightened it in the latest description update to link cloud#9960 directly rather than describe it only as "the corresponding cloud backend change," so this is traceable without needing to ask.
Generated by Claude Code
There was a problem hiding this comment.
Tracked as FE-2823. The PR merged with this thread unresolved, so the finding is carried in Linear rather than lost here. Filed automatically; close the ticket if the finding is no longer true at main.
|
Timing note: I posted my review against Resolved by
Still blocking on
Non-blocking and still open: the Happy to re-review once the contract question is settled. Thanks for the fast turnaround on the first round. |
…complexity Addresses dante01yoon's human review on top of the earlier Cursor Review fixes: - agentApiSchema.ts: adds zPersistedToolCallSummary, a validated FE-side schema for one content.tool_calls entry (id, tool_name, status, duration_ms), following the same local-schema/.extend() pattern this file already uses for pending_ask. status stays z.string() rather than a closed enum, since an unrecognized value must still surface as a failed ToolPart rather than be silently dropped by schema validation; duration_ms stays z.unknown() so a bad value there doesn't sink the whole entry, matching how it was already narrowed defensively. - agentTranscript.ts: parseToolCalls now delegates per-entry parsing to parseToolCallEntry, which safeParses through that schema instead of an ad-hoc `entry as Record<string, unknown>` cast. normalizeAgentTranscript is split into recordTurnOrder/recordUserRow/recordAssistantRow helpers, bringing both functions' complexity back under threshold (confirmed via `npx fallow audit --changed-since`, which now passes). - Playwright e2e test: asserts the exact "Worked for 0.6 seconds" label (discriminating duration_ms parsing, not just the zero-duration fallback string) instead of a loose /worked/i match. - agentConversationStore.test.ts: adds a chat-switch A->B->A test proving a tool-call summary doesn't bleed onto a different chat.
dante01yoon
left a comment
There was a problem hiding this comment.
Re-review at head 49339f4 (2 commits since my review at 60cb58c8). I read the full review record — the prior review, all 12 of my threads, and every reply — then verified each item against head source rather than against the replies. Thank you for the thread-by-thread responses; they made this fast to check, and four of the five blocking items are genuinely closed.
Prior findings — verdicts
| # | Finding | Verdict | Evidence at head |
|---|---|---|---|
| 1 | tool_calls hand-parsed out of an untyped z.record(z.unknown()); no generated type, no validation |
Partially resolved | The ad-hoc cast is gone — parseToolCallEntry now runs zPersistedToolCallSummary.safeParse(entry) (agentTranscript.ts:152), and the shape is declared once, exported, and documented in agentApiSchema.ts:109-116. That is the interim I offered. What remains is the sequencing — see below |
| 2 | Invented status vocabulary (ok vs the validated success); unrecognised terminal status renders with the success glyph |
Resolved | toolCallOk (agentTranscript.ts:133-139) returns undefined only while state === 'streaming'; otherwise only ok/success yield true and every other string yields false. ok is therefore never omitted on a done part, so the neutral-glyph path I traced is unreachable. Parameterised tests cover success, failed, cancelled, timeout, and an unrecognised string |
| 3 | Restored pending/running maps to streaming with nothing able to settle it — spins forever |
Resolved | toolCallPartState(status, isLive) (:117-123) clamps to done unless isLive, and applyAssistantRow computes runApproval before parsing (:246-248), so only the row actually handed a live transport can stay streaming. Both branches are now tested, and the test I quoted as encoding the bug is flipped rather than deleted |
| 4 | Restored parts not keyed by callId nor seeded into the transport's tools map → bogus ×2 with summed duration |
Partially resolved | Both paths I traced are closed: parseToolCalls builds a Map<callId, ToolPart> (:190-195), and createAgentEventTransport seeds tools from message.parts at construction (agentEventTransport.ts:42-46), with a regression test. The third case — a repeated callId across two assistant rows of one turn — is not deduped, contrary to the reply; see the comment on agentTranscript.ts:211. Downgraded to suggestion: because I can't demonstrate the server duplicates across rows |
| 5 | Restored "Worked for Xs" omits thinking durations that the live label includes | Resolved on the terms I offered | I asked for the fix or an explicit statement in the description. The new Known limitations section states exactly the scenario — including the two-tabs-disagree case — and names the follow-up. That closes it; I'm not asking you to restore thinking spans here |
Non-blocking items, for completeness:
| Finding | Verdict |
|---|---|
duration_ms admits NaN/Infinity/negatives |
Resolved — Number.isFinite(rawDuration) && rawDuration >= 0 (:162-167), parameterised test |
/worked/i also matches the zero-duration "Worked" fallback |
Resolved — now asserts the exact agent.workedForSeconds label interpolated with 0.6, via getByRole(..., { exact: true }) |
| No chat-switch coverage (A→B, old summary gone) | Resolved — agentConversationStore.test.ts now has the A→B→A no-bleed case, exactly the cheaper shape I suggested |
| e2e fixture authors the vocabulary it asserts | Partially addressed, honestly scoped — the fixture now exercises both ok and success, and the real zPersistedToolCallSummary runs on that path. Deriving the literal from a generated type still isn't possible, and you said so rather than claiming otherwise |
question: has the backend field shipped? |
Answered — cloud#9960 is open and not merged. This is the answer that decides the one item below |
The one thing still blocking
Only the contract sequencing, and it's narrower than before. You've now confirmed what I asked: tool_calls is not in the merged Cloud spec, so it cannot be in the generated package, so zPersistedToolCallSummary is a frontend-authored declaration of a server response shape. My prior comment pre-committed to this disposition — "If it has not merged yet, that is the natural moment to do the spec → regenerate → merge → build sequence rather than landing the reader first" — and I'd rather be consistent with that than move the line now that it's been answered.
To be concrete about what I am not asking for: no further frontend work on this. The schema, the clamp, the dedupe, the terminal-status handling and the tests all stay as they are. The ask is merge order — land cloud#9960, let the generated-types PR carry tool_calls, then replace zPersistedToolCallSummary with (or narrow it to an extension of) the generated type. If cloud#9960 lands first, this becomes a regeneration plus a few lines.
I'd also gently push back on one line in the description: "This is safe to merge independently of the backend change." It's true that parsing degrades gracefully without the field — your test proves that. But merging the reader first is what puts an FE-authored declaration of a server shape into the repo, and that declaration is the thing the house rule exists to prevent. The graceful-degradation property makes it harmless at runtime, not contract-clean.
Two small new observations from the new commits are inline; both are suggestion: and neither needs to gate anything.
CI and validation
Green at 49339f4 — test (26m), scan, setup, storybook-build, validate-fonts, validate-licenses all pass, nothing failing.
I did not run the suite or the browser tests locally: /workspace is shared and read-only for me and installing dependencies was out of scope. Everything above is from reading head source fetched at 49339f4, the 60cb58c8...49339f4 compare, and CI. I could not verify cloud#9960's contents — the shape of the persisted rows, the persist.ToolCallWireStatus translation, and the exclusion of pending/running rows are all taken from your replies, not checked. That's also why the cross-row item below is a suggestion rather than a blocker.
| * `z.unknown()` so a NaN/Infinity/negative value there doesn't sink the | ||
| * whole entry; `parseToolCallEntry` narrows it separately and just omits it. | ||
| */ | ||
| export const zPersistedToolCallSummary = z |
There was a problem hiding this comment.
This resolves the part of my earlier finding I most cared about: tool_calls now has one declared, exported, documented shape and real runtime validation, instead of entry as Record<string, unknown> at the read site. Your reason for not extending content itself also holds up — content carries attachments/attachment_refs/workflow_references with per-field graceful degradation, and a closed content schema would let one bad optional field reject a whole persisted row. I'd have accepted zAgentMessage.extend(...); this is a better fit for that constraint.
issue: what's still open is only the sequencing. zPersistedToolCallSummary is a frontend-authored declaration of a server response shape, and you've confirmed the reason it has to be: cloud#9960 is open and unmerged, so tool_calls cannot exist in packages/ingest-types yet. That's the contract-first order — land the field in Cloud and the spec, regenerate, merge the generated-types PR, then build against it.
Concretely, what this declaration cannot do that a generated one would: if the server ships tool_name as name, or renames duration_ms, safeParse fails and every restored tool call silently vanishes from the work summary at runtime — no compile error, no test failure, and the turn just looks like it did less work. That's the drift shape from #14771, just with a softer landing than the cast had.
Nothing to change in this file. Once cloud#9960 merges and the generated types land, this becomes either a deletion in favour of the generated type or a thin extension on top of it.
There was a problem hiding this comment.
Understood, and agreed this is correctly sequenced — it's blocked on cloud#9960 merging, not something to work around here. Once that lands and the OpenAPI spec is regenerated with the real tool_calls type in packages/ingest-types, a follow-up will either delete zPersistedToolCallSummary in favor of the generated type or turn it into a thin extension on top of it.
Generated by Claude Code
There was a problem hiding this comment.
Tracked as FE-2823. The PR merged with this thread unresolved, so the finding is carried in Linear rather than lost here. Filed automatically; close the ticket if the finding is no longer true at main.
| .object({ | ||
| id: z.string(), | ||
| tool_name: z.string(), | ||
| status: z.string(), |
There was a problem hiding this comment.
suggestion (non-blocking): status: z.string() is required, so an entry that carries a valid id and tool_name but no status now fails safeParse and the whole tool call disappears from the restored summary.
That's a behaviour change from the previous head rather than a pre-existing quirk: the old parser only required id and tool_name (if (typeof id !== 'string' || typeof toolName !== 'string') return []), so a status-less entry still rendered — state: 'done' with ok omitted. Now it's dropped, and the turn's "Worked for Xs" total silently loses that call's duration.
It also reads against the principle your own doc comment states two lines up: "schema validation should reject a malformed entry (missing id/tool_name), not an unfamiliar status string or a bad duration_ms." A missing status is closer to the second category than the first — and toolCallOk already has a correct answer for it, since anything that isn't ok/success reads as failure.
status: z.string().optional() (or z.unknown().optional(), matching duration_ms) would keep the entry and let toolCallOk surface it as a failed call. I don't think this is reachable against cloud#9960 as you've described it, which is why it's a suggestion.
There was a problem hiding this comment.
Good catch, fixed. status is now z.string().optional() (matching how duration_ms is handled) so an entry with a valid id+tool_name but no status survives safeParse instead of failing the whole entry. toolCallPartState/toolCallOk already treat an unset status as terminal-and-not-ok, so it renders as a failure, matching the old parser's behavior.
Added a regression test: an entry with id+tool_name and no status still renders as a done/ok:false ToolPart instead of vanishing.
Pushed in 6b971ef.
Generated by Claude Code
There was a problem hiding this comment.
Tracked as FE-2823. The PR merged with this thread unresolved, so the finding is carried in Linear rather than lost here. Filed automatically; close the ticket if the finding is no longer true at main.
| isLive: boolean | ||
| ): void { | ||
| const toolCalls = parseToolCalls(row.content, isLive) | ||
| if (toolCalls) message.parts = [...message.parts, ...toolCalls] |
There was a problem hiding this comment.
suggestion (non-blocking): the cross-row half of the dedupe isn't actually deduped, so I want to correct the record rather than let it close on the reply.
Your reply on that thread said the Map means "a repeated callId within one row's list, or across two rows of the same turn (they accumulate via assistants.get(turnId)), is deduped." The first half is right. The second isn't: parseToolCalls allocates a fresh Map per call (line 190), it's called once per row, and this line spreads the result onto a message.parts array shared across every row of the turn via assistants.get(turnId) (line 324). So two assistant rows of one turn each carrying the same callId still produce two ToolParts, and foldActivity folds them into ×2 with the durations summed — the original finding, unchanged.
Worth noting the code itself is honest about this; the doc comment on parseToolCalls says "within the list", which is exactly what it does. It's only the reply that claimed more.
Multi-assistant-row turns are a real shape here — agentTranscript.test.ts:117-119 already exercises two assistant rows under one turn-a. What I can't verify is whether cloud#9960 attaches a turn's tool_calls list to more than one of its assistant rows; if a bulk ToolCallsForThread join does, this is reachable. Since I can't show that from this repo, it's a suggestion and not a blocker.
If you want it closed cheaply, hoisting the dedupe to the message — e.g. skipping any parsed part whose callId is already present in message.parts — is a couple of lines here and would make restore match the live path's global keying in all three directions.
There was a problem hiding this comment.
You're right, and thanks for catching the overclaim in my earlier reply — parseToolCalls only dedupes within one row's own list; message.parts is shared across every assistant row of a turn, so two rows carrying the same callId were still producing two ToolParts.
Fixed by hoisting the dedupe to the message level: appendAssistantContent now filters a parsed row's tool-call parts against the callIds already present in message.parts before appending. Restore now matches the live path's global keying in all three directions (within-row, cross-row same-parse-call, cross-row across separate row-parses).
Added a regression test (agentTranscript.test.ts): two assistant rows in one turn sharing a callId collapse to a single ToolPart.
Pushed in 6b971ef.
Generated by Claude Code
There was a problem hiding this comment.
Tracked as FE-2823. The PR merged with this thread unresolved, so the finding is carried in Linear rather than lost here. Filed automatically; close the ticket if the finding is no longer true at main.
Addresses dante01yoon's second review round: - agentTranscript.ts: appendAssistantContent now dedupes a parsed row's tool-call parts against message.parts before appending. parseToolCalls only dedupes within one row's own list, but message.parts is shared across every assistant row of a turn, so two rows carrying the same callId were still producing two ToolParts. This closes that gap, matching the live path's turn-wide keying in all three directions. - agentApiSchema.ts: zPersistedToolCallSummary's status field is now optional. It was required, so an entry with a valid id/tool_name but no status failed safeParse and the whole tool call silently vanished from the restored summary - a regression from the old parser, which rendered a status-less call as a failure. toolCallPartState/toolCallOk already treat an unset status as terminal-and-failed, so no other change is needed. - agentTranscript.test.ts: adds regression tests for both - two assistant rows in one turn sharing a callId collapsing to one ToolPart, and a status-less entry still rendering (as a failure) instead of being dropped.
|
Thanks for the thorough re-review. Pushed 6b971ef addressing both new non-blocking suggestions:
Added regression tests for both in The remaining sequencing point on Generated by Claude Code |
dante01yoon
left a comment
There was a problem hiding this comment.
Following up on 6b971ef, pushed after my re-review at 49339f4. Both suggestion: items from that pass are resolved. I am leaving the existing CHANGES_REQUESTED in place rather than restating it, because the single remaining blocker is unchanged and is not yours to fix in this repo — details at the bottom.
1. Cross-row callId dedupe — resolved. My correction was that parseToolCalls allocates a fresh Map per row while message.parts is shared across every assistant row of a turn via assistants.get(turnId), so two rows carrying the same callId still produced two ToolParts. appendAssistantContent now builds an existingCallIds set from message.parts and filters the parsed list against it before appending, which hoists the dedupe to the message level where the sharing actually happens. The flatMap narrowing on part.type === 'tool' is the right shape — a text part has no callId to collide on. The doc comment you added states the invariant and why it lives at this level, which is what I would want the next reader to find.
2. Required status dropping valid entries — resolved. status: z.string().optional() on zPersistedToolCallSummary. This was the behaviour change I flagged: an entry with a valid id and tool_name but no status used to render under the old parser and had started vanishing from the summary entirely, against the schema's own documented principle of rejecting a malformed entry rather than an unfamiliar status. The comment now spells out that toolCallPartState/toolCallOk already treat undefined as terminal-and-failed, so the omission degrades to the same glyph the old parser produced rather than to a hole.
Remaining blocker — unchanged, and external. zPersistedToolCallSummary is still a frontend-authored declaration of a server response shape, because the contract it describes has not landed: I re-checked Comfy-Org/cloud#9960 just now and it is still open, merged: false. Nothing further is being asked of the frontend code here — the safeParse against a named schema is the interim I offered, and you took it. This is merge order only: once #9960 lands and the types are regenerated, tool_calls / tool_name / duration_ms come from @comfyorg/ingest-types and this local schema becomes the thin extension it is standing in for. I will flip to approve at that point.
Validation: read 6b971ef's three-file delta at head via the contents API and traced appendAssistantContent against the shared-parts path; confirmed cloud#9960's state through the API. I did not run the unit suite or Playwright locally — no dependency install — so the new agentTranscript.test.ts cases are read, not executed. I also still cannot see cloud#9960's actual row shape or status translation, which is exactly why the dedupe point was a suggestion rather than a blocker.
A live agent_tool_call frame carries tool_call_id (the provider id), and agentEventTransport keys its tools map on ToolPart.callId against that same field. parseToolCallEntry was deriving callId from the persisted row's own id (the audit row's UUID) instead, so a restored chip could never match a live frame that arrives for it later. zPersistedToolCallSummary now also types tool_call_id; parseToolCallEntry prefers it over id, falling back to id only for rows recorded before tool_call_id existed. Adds a unit test with distinct id/tool_call_id values (existing tests used 'call-1' for both, so they never caught this) and an integration test through normalizeAgentTranscript + createAgentEventTransport proving a restored part updates in place instead of duplicating when a live frame with the matching tool_call_id arrives.
|
Fixed the Added a unit test with distinct |
## Before Reloading the page or switching chats mid-thread dropped a completed turn's tool-call trace: the collapsible "Worked for Xs" work summary (with the tool names/durations inside it) that shows up live while the agent is running would not reappear once the transcript was rehydrated from history. Only the final reply text survived a refresh. ## After `GET /agent/threads/:id/messages` now returns each assistant message's `tool_calls`. This PR reads that field and folds it into the same `ToolPart` entries the live WebSocket `agent_tool_call` handler already builds, so a reloaded or chat-switched transcript renders through the exact same `WorkSummary`/`ActivityTrace` components a live turn uses — no parallel UI. The collapsible starts closed and expands on click identically for a historical trace as for a live one, since that behavior is owned by the (stateless) `CollapsibleRoot` the component already used. ### What changed - `agentApiSchema.ts`: adds `zPersistedToolCallSummary`, a validated FE-side schema for one `content.tool_calls` entry (`id`, `tool_name`, `status`, `duration_ms`), following the same `.extend()`/local-schema pattern this file already uses for `pending_ask`. `status` is deliberately `z.string()` rather than a closed enum, since an unrecognized value must still surface as a failed `ToolPart` rather than be dropped by schema validation. - `agentTranscript.ts`: `normalizeAgentTranscript()` now parses each assistant row's `content.tool_calls` through that schema into `ToolPart[]` and appends them to that turn's `AssistantMessage.parts`, ahead of the row's reply text — mirroring how the live event transport appends tool/text parts into the same array. A restored `pending`/`running` call clamps to a terminal `done`/`ok:false` state unless its row is the one actively backed by a live transport (the run_approval mid-ask case); `ok`/`success` map to success, everything else terminal maps to failure; duplicate `callId`s within one row are deduped; malformed `duration_ms` is rejected without dropping the whole entry. - `agentEventTransport.ts`: `createAgentEventTransport()` now seeds its `tool_call_id` map from any `ToolPart`s already on the message it's given, so a live frame for an already-restored call updates it in place instead of duplicating it. - No changes were needed in `agentConversationStore.ts`: `hydrate()` already assigns `transcript.messages` (which now carries the tool parts) straight into the store's `messages`, the same field the live turn path writes to and the same field the rendering components read. - Unit tests added to `agentTranscript.test.ts` (parsing, ordering, multiple calls, in-flight status, malformed/missing `tool_calls`, restore-without-transport clamping, broadened terminal vocabulary, duration guard, dedup) and `agentConversationStore.test.ts` (hydrate wiring into `store.messages`, and a chat-switch A→B→A test confirming a tool-call summary doesn't bleed across chats). - One Playwright e2e test added (`browser_tests/tests/agent/agentToolCallHistoryPersistence.spec.ts`): sends a message, mocks the history GET to return a completed turn with two tool calls (using both the `ok` and `success` terminal literals), reloads, and asserts the same work-summary button appears with the exact expected duration label, stays collapsed by default, and expands to show both tool names. ### Known limitations The restored "Worked for Xs" headline is computed client-side from `totalDurationMs(parts)`, but only tool-call durations are restored — thinking-span durations are not persisted/parsed in this PR. A turn that spent significant time thinking can therefore show a different total live vs. after a reload (or across two tabs on the same conversation, one reloaded and one not). Persisting/serving the turn's worked-duration (or its thinking spans) so live and restored render from the same source is tracked as a follow-up rather than fixed here. ### Compatibility This is safe to merge independently of the backend change: when a response has no `tool_calls` key (today's shape, or a user message), parsing simply returns `undefined` and nothing is appended — covered by an explicit unit test. The full frontend behavior (tool history actually showing up after reload) only takes effect once the corresponding cloud backend change, [Comfy-Org/cloud#9960](Comfy-Org/cloud#9960), lands. That PR's shared `persist.ToolCallWireStatus` translation emits `success`/`error` as the two terminal wire values for both the live and reload paths, and excludes `pending`/`running` rows from restored history entirely; this PR's parsing handles that vocabulary (plus the legacy `ok`/`error` pair and any other unrecognized terminal string, defensively) either way. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01RuB3pFMNyS3AE7JYNFNesb --- _Generated by [Claude Code](https://claude.ai/code/session_01RuB3pFMNyS3AE7JYNFNesb)_ --------- Co-authored-by: Christian Byrne <cbyrne@comfy.org>
## Before Reloading the page or switching chats mid-thread dropped a completed turn's tool-call trace: the collapsible "Worked for Xs" work summary (with the tool names/durations inside it) that shows up live while the agent is running would not reappear once the transcript was rehydrated from history. Only the final reply text survived a refresh. ## After `GET /agent/threads/:id/messages` now returns each assistant message's `tool_calls`. This PR reads that field and folds it into the same `ToolPart` entries the live WebSocket `agent_tool_call` handler already builds, so a reloaded or chat-switched transcript renders through the exact same `WorkSummary`/`ActivityTrace` components a live turn uses — no parallel UI. The collapsible starts closed and expands on click identically for a historical trace as for a live one, since that behavior is owned by the (stateless) `CollapsibleRoot` the component already used. ### What changed - `agentApiSchema.ts`: adds `zPersistedToolCallSummary`, a validated FE-side schema for one `content.tool_calls` entry (`id`, `tool_name`, `status`, `duration_ms`), following the same `.extend()`/local-schema pattern this file already uses for `pending_ask`. `status` is deliberately `z.string()` rather than a closed enum, since an unrecognized value must still surface as a failed `ToolPart` rather than be dropped by schema validation. - `agentTranscript.ts`: `normalizeAgentTranscript()` now parses each assistant row's `content.tool_calls` through that schema into `ToolPart[]` and appends them to that turn's `AssistantMessage.parts`, ahead of the row's reply text — mirroring how the live event transport appends tool/text parts into the same array. A restored `pending`/`running` call clamps to a terminal `done`/`ok:false` state unless its row is the one actively backed by a live transport (the run_approval mid-ask case); `ok`/`success` map to success, everything else terminal maps to failure; duplicate `callId`s within one row are deduped; malformed `duration_ms` is rejected without dropping the whole entry. - `agentEventTransport.ts`: `createAgentEventTransport()` now seeds its `tool_call_id` map from any `ToolPart`s already on the message it's given, so a live frame for an already-restored call updates it in place instead of duplicating it. - No changes were needed in `agentConversationStore.ts`: `hydrate()` already assigns `transcript.messages` (which now carries the tool parts) straight into the store's `messages`, the same field the live turn path writes to and the same field the rendering components read. - Unit tests added to `agentTranscript.test.ts` (parsing, ordering, multiple calls, in-flight status, malformed/missing `tool_calls`, restore-without-transport clamping, broadened terminal vocabulary, duration guard, dedup) and `agentConversationStore.test.ts` (hydrate wiring into `store.messages`, and a chat-switch A→B→A test confirming a tool-call summary doesn't bleed across chats). - One Playwright e2e test added (`browser_tests/tests/agent/agentToolCallHistoryPersistence.spec.ts`): sends a message, mocks the history GET to return a completed turn with two tool calls (using both the `ok` and `success` terminal literals), reloads, and asserts the same work-summary button appears with the exact expected duration label, stays collapsed by default, and expands to show both tool names. ### Known limitations The restored "Worked for Xs" headline is computed client-side from `totalDurationMs(parts)`, but only tool-call durations are restored — thinking-span durations are not persisted/parsed in this PR. A turn that spent significant time thinking can therefore show a different total live vs. after a reload (or across two tabs on the same conversation, one reloaded and one not). Persisting/serving the turn's worked-duration (or its thinking spans) so live and restored render from the same source is tracked as a follow-up rather than fixed here. ### Compatibility This is safe to merge independently of the backend change: when a response has no `tool_calls` key (today's shape, or a user message), parsing simply returns `undefined` and nothing is appended — covered by an explicit unit test. The full frontend behavior (tool history actually showing up after reload) only takes effect once the corresponding cloud backend change, [Comfy-Org/cloud#9960](Comfy-Org/cloud#9960), lands. That PR's shared `persist.ToolCallWireStatus` translation emits `success`/`error` as the two terminal wire values for both the live and reload paths, and excludes `pending`/`running` rows from restored history entirely; this PR's parsing handles that vocabulary (plus the legacy `ok`/`error` pair and any other unrecognized terminal string, defensively) either way. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01RuB3pFMNyS3AE7JYNFNesb --- _Generated by [Claude Code](https://claude.ai/code/session_01RuB3pFMNyS3AE7JYNFNesb)_ --------- Co-authored-by: Christian Byrne <cbyrne@comfy.org>
|
|
…oolCallGroup UI (#18579) ## Summary `browser_tests/tests/agent/agentToolCallHistoryPersistence.spec.ts:24` ("keeps a completed turn work summary after a browser refresh") fails deterministically on `core/1.54` since #18554. Fixes it by correcting the test's UI assertion to match this branch's actual, working agent-panel component. <details> <summary>Full context for agent readers</summary> ## Root cause #18554 backported #18282 ("restore tool-call work summary on reload and chat switch") from `main`, including a **new** E2E test. The data-layer change it ported — `agentTranscript.ts`'s `normalizeAgentTranscript`, which folds a persisted assistant row's `content.tool_calls` into `ToolPart`s — is **byte-for-byte identical** between `main` and the backport, and its 49 existing/added unit tests (`agentTranscript.test.ts`, `agentConversationStore.test.ts`) pass unchanged. So the actual bug the PR fixes (tool-call history vanishing on reload) is already correctly fixed on `core/1.54`. What's missing is a separate, **unrelated, unbackported** UI redesign that #18282 on `main` happens to sit on top of: `main` replaced the agent panel's `ToolCallGroup.vue` (dynamic label: `"Ran {count} tool calls for {seconds} seconds"`) with a `WorkSummary.vue`/`ActivityTrace.vue` split, where a settled group's trigger is the static i18n string `agent.worked` ("Worked"). That redesign was never backported to `core/1.54` — `ToolCallGroup.vue` is still what's rendered here, and it still (correctly, per its own pinned tests, e.g. `T-11 / PM-661 / FE-1301` in `ToolCallGroup.test.ts`) renders the dynamic "Ran N tool calls..." label. The backported test, however, was carried over verbatim from `main` and asserts a button named `enMessages.agent.worked` — text that no component on `core/1.54` renders (`agent.worked` has zero non-test usages in this codebase). Reproduced locally: the persisted transcript restores its `ToolPart`s correctly, but the actual rendered trigger reads `"Ran 2 tool calls for 0.6 seconds"`, so `getByRole('button', { name: 'Worked', exact: true })` never matches → the reported timeout. ## Fix Rather than backport the full main-branch `WorkSummary`/`ActivityTrace` redesign (a large, unrelated surface, under time pressure and not what this bug is about), this updates the test's assertion to the label `ToolCallGroup.vue` actually — and correctly — produces for the mocked 2-call, 600ms-total turn: `/ran 2 tool calls for 0\.6 seconds/i`. The rest of the test (aria-expanded default state, expand-to-reveal humanized tool names "Search nodes"/"Add node") already passed against the existing `ToolCallCard.vue`/`agentToolGlyph.ts` and is untouched. ## Verification - `pnpm eslint` on the changed file: clean. - `pnpm exec vue-tsc --noEmit`: no errors on the changed file. - `npx vitest run` on `ToolCallGroup.test.ts` + `agentTranscript.test.ts`: 49/49 pass (confirms the data-layer restore and existing `ToolCallGroup` behavior are both intact and untouched by this change). - Pre-commit hooks (oxfmt/oxlint/eslint/typecheck) ran clean on commit. - Could not execute the Playwright browser test itself in this sandbox (outbound fetch of the Chromium binary from `cdn.playwright.dev` is blocked by the environment's proxy allowlist); the fix was validated by reproducing the exact rendered trigger text via the unit-level `ToolCallGroup.test.ts` coverage instead, plus reading the mocked test data (`420ms + 180ms` → `0.6s`, `2` calls) against `ToolCallGroup.vue`'s `statusLabel`/`ranToolCallsTimed` i18n string directly. Merging via admin bypass given severity — this is blocking #18559 and #18574's `playwright-tests (cloud)` checks. Posting a post-merge-review request comment once merged. </details> Claude-Session: https://claude.ai/code/session_01UqyourCBfi97xzpBx2W7oY --- _Generated by [Claude Code](https://claude.ai/code/session_01UqyourCBfi97xzpBx2W7oY)_ Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com>
## Summary Preserve the tool-call reload regression and extend it through New chat → chat history → original chat, including exact rendered row counts and labels. ## Changes - Keep all existing collapsed/expanded and visible-label assertions; ensure no summary leaks into the new chat and both calls return. - Source follow-up to #18282. The Cloud backport #18555 expects main’s "Worked" label, but cloud/1.54 still renders "Ran 2 tool calls for 0.6 seconds". That release-specific adaptation will be a separate backport, not a runtime or package change. ## Review Focus Check the preserved GET content.tool_calls fixture, both terminal success vocabularies, and reload/chat-switch behavior. No deployment or feature-flag changes. Validation: targeted Cloud Playwright 1 passed (23.6s); transcript/store/transport/WorkSummary/glyph Vitest 139 passed; browser typecheck, targeted ESLint and oxfmt passed. Release baseline independently reproduced the exact line-132 failure while its accessibility tree already contained the correct two-call summary. --------- Co-authored-by: Amp <amp@ampcode.com>
|
|
|
|
…itch (PM-717) (Comfy-Org#21600) ## Summary - Reopening a chat from history lost the thinking. Tool calls stayed. - The transcript now restores `content.thinking` into the Worked trace, each entry at its round. - Needs Comfy-Org/cloud#14903 to persist the field. Until that lands this is a no-op. Tracks [PM-717](https://linear.app/comfyorg/issue/PM-717) (fresh Windows QA report, case Q4: "Thinking and tool call summary survive a chat switch"). <details><summary>Full context for agent readers</summary> **Before.** `hydrate()` replaces the conversation with `normalizeAgentTranscript(history)`. An assistant row contributed tool parts from `content.tool_calls` (FE Comfy-Org#18282) and its reply text, and nothing else. The thinking the live turn streamed through `agent_thinking` existed only in memory, so after New Chat → reopen, or after a reload, the Worked trace showed tool rows only. That matches the reporter's screenshots. **After.** Comfy-Org/cloud#14903 stores each round's live thinking text on the completed row: ```json "thinking": [{ "text": "...", "tool_call_id": "call-1" }, { "text": "..." }] ``` `appendAssistantContent` restores each entry as a done `ThinkingPart` in front of the tool part whose `callId` matches `tool_call_id`. An entry with no anchor, or one whose call is not in the transcript, goes after the calls and before the reply. Entries are parsed one at a time with `zPersistedThinkingEntry.safeParse`. A malformed or blank entry is skipped, and the row still loads. No rendering change: `WorkSummary`/`ActivityTrace` already render thinking parts. ## Verification - **Black-box harness, red → green.** `agentToolCallHistoryPersistence.spec.ts` now mocks the history row with `content.thinking` (the cloud#14903 contract). It asserts the trace reads `thinking, Search nodes, thinking, Add node, thinking` after a reload and again after New Chat → reopen from history. - On parent `7178296cf5`: **fails**. Received only `Search nodes, Add node`. - On this head: **passes**. - Unit: one new `agentTranscript.test.ts` case covers a malformed or blank entry being skipped, and a missing-call anchor falling after the calls. - `vitest run src/workbench/extensions/agent/`: 178 files, 4038 passed, 1 expected fail. - `pnpm typecheck`, eslint, oxfmt, pre-commit, pre-push (knip/fallow): clean. - Local setup: cloud-distribution dev server with `VITE_USE_LEGACY_DEFAULT_GRAPH=true`, own backend container (ci image 0.0.28), `--project=cloud --retries=0`, Node 26.10, Chromium. - Screenshots were inspected locally. Before: the expanded Worked trace holds two tool rows and no thinking. After the chat switch: thinking rows sit between and after the tool rows, and the layout is intact. </details>
Before
Reloading the page or switching chats mid-thread dropped a completed turn's tool-call trace: the collapsible "Worked for Xs" work summary (with the tool names/durations inside it) that shows up live while the agent is running would not reappear once the transcript was rehydrated from history. Only the final reply text survived a refresh.
After
GET /agent/threads/:id/messagesnow returns each assistant message'stool_calls. This PR reads that field and folds it into the sameToolPartentries the live WebSocketagent_tool_callhandler already builds, so a reloaded or chat-switched transcript renders through the exact sameWorkSummary/ActivityTracecomponents a live turn uses — no parallel UI. The collapsible starts closed and expands on click identically for a historical trace as for a live one, since that behavior is owned by the (stateless)CollapsibleRootthe component already used.What changed
agentApiSchema.ts: addszPersistedToolCallSummary, a validated FE-side schema for onecontent.tool_callsentry (id,tool_name,status,duration_ms), following the same.extend()/local-schema pattern this file already uses forpending_ask.statusis deliberatelyz.string()rather than a closed enum, since an unrecognized value must still surface as a failedToolPartrather than be dropped by schema validation.agentTranscript.ts:normalizeAgentTranscript()now parses each assistant row'scontent.tool_callsthrough that schema intoToolPart[]and appends them to that turn'sAssistantMessage.parts, ahead of the row's reply text — mirroring how the live event transport appends tool/text parts into the same array. A restoredpending/runningcall clamps to a terminaldone/ok:falsestate unless its row is the one actively backed by a live transport (the run_approval mid-ask case);ok/successmap to success, everything else terminal maps to failure; duplicatecallIds within one row are deduped; malformedduration_msis rejected without dropping the whole entry.agentEventTransport.ts:createAgentEventTransport()now seeds itstool_call_idmap from anyToolParts already on the message it's given, so a live frame for an already-restored call updates it in place instead of duplicating it.agentConversationStore.ts:hydrate()already assignstranscript.messages(which now carries the tool parts) straight into the store'smessages, the same field the live turn path writes to and the same field the rendering components read.agentTranscript.test.ts(parsing, ordering, multiple calls, in-flight status, malformed/missingtool_calls, restore-without-transport clamping, broadened terminal vocabulary, duration guard, dedup) andagentConversationStore.test.ts(hydrate wiring intostore.messages, and a chat-switch A→B→A test confirming a tool-call summary doesn't bleed across chats).browser_tests/tests/agent/agentToolCallHistoryPersistence.spec.ts): sends a message, mocks the history GET to return a completed turn with two tool calls (using both theokandsuccessterminal literals), reloads, and asserts the same work-summary button appears with the exact expected duration label, stays collapsed by default, and expands to show both tool names.Known limitations
The restored "Worked for Xs" headline is computed client-side from
totalDurationMs(parts), but only tool-call durations are restored — thinking-span durations are not persisted/parsed in this PR. A turn that spent significant time thinking can therefore show a different total live vs. after a reload (or across two tabs on the same conversation, one reloaded and one not). Persisting/serving the turn's worked-duration (or its thinking spans) so live and restored render from the same source is tracked as a follow-up rather than fixed here.Compatibility
This is safe to merge independently of the backend change: when a response has no
tool_callskey (today's shape, or a user message), parsing simply returnsundefinedand nothing is appended — covered by an explicit unit test. The full frontend behavior (tool history actually showing up after reload) only takes effect once the corresponding cloud backend change, Comfy-Org/cloud#9960, lands. That PR's sharedpersist.ToolCallWireStatustranslation emitssuccess/erroras the two terminal wire values for both the live and reload paths, and excludespending/runningrows from restored history entirely; this PR's parsing handles that vocabulary (plus the legacyok/errorpair and any other unrecognized terminal string, defensively) either way.🤖 Generated with Claude Code
https://claude.ai/code/session_01RuB3pFMNyS3AE7JYNFNesb
Generated by Claude Code