Repository navigation
[agent-v1 08/18] feat(agent): session and state coordination - thread, turn, cancellation - #16204
CodeJuggernaut wants to merge 11 commits into
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Team Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Comment |
🎭 Playwright: ✅ 1888 passed, 0 failed · 1 flaky📊 Browser Reports
🎨 Storybook: ✅ Built — View Storybook📦 Bundle Size
⚡ Performance Report
Absolute values
Raw data{
"timestamp": "2026-09-01T11:22:15.104Z",
"gitSha": "c2fcc31a9b78cf89e470c61796cfcce89b38ac35",
"branch": "nathaniel/agent-v1/08-session-state",
"measurements": [
{
"name": "canvas-idle",
"durationMs": 2054.8200000000065,
"styleRecalcs": 8,
"styleRecalcDurationMs": 7.122999999999999,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 559.011,
"heapDeltaBytes": -12568840,
"heapUsedBytes": 57686128,
"domNodes": -283,
"jsHeapTotalBytes": 4972544,
"scriptDurationMs": 7.880999999999999,
"eventListeners": -155,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "canvas-idle",
"durationMs": 2056.002000000035,
"styleRecalcs": 8,
"styleRecalcDurationMs": 8.249999999999998,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 563.2239999999999,
"heapDeltaBytes": -2319508,
"heapUsedBytes": 67606052,
"domNodes": -282,
"jsHeapTotalBytes": 5496832,
"scriptDurationMs": 9.184999999999999,
"eventListeners": -185,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333335,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "canvas-mouse-sweep",
"durationMs": 2071.3570000000345,
"styleRecalcs": 80,
"styleRecalcDurationMs": 51.604000000000006,
"layouts": 14,
"layoutDurationMs": 5.292,
"taskDurationMs": 1058.025,
"heapDeltaBytes": -9348296,
"heapUsedBytes": 59721332,
"domNodes": -282,
"jsHeapTotalBytes": 5234688,
"scriptDurationMs": 186.382,
"eventListeners": -157,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "canvas-mouse-sweep",
"durationMs": 1907.4100000000271,
"styleRecalcs": 78,
"styleRecalcDurationMs": 43.647,
"layouts": 14,
"layoutDurationMs": 4.776,
"taskDurationMs": 949.07,
"heapDeltaBytes": -8527284,
"heapUsedBytes": 61640084,
"domNodes": -279,
"jsHeapTotalBytes": 5496832,
"scriptDurationMs": 163.04300000000003,
"eventListeners": -155,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "canvas-zoom-sweep",
"durationMs": 1738.742000000002,
"styleRecalcs": 31,
"styleRecalcDurationMs": 19.029999999999998,
"layouts": 6,
"layoutDurationMs": 1.329,
"taskDurationMs": 412.66900000000004,
"heapDeltaBytes": 4443176,
"heapUsedBytes": 74273888,
"domNodes": 78,
"jsHeapTotalBytes": 5767168,
"scriptDurationMs": 11.600000000000003,
"eventListeners": 19,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "canvas-zoom-sweep",
"durationMs": 1738.3159999999407,
"styleRecalcs": 31,
"styleRecalcDurationMs": 18.437999999999995,
"layouts": 6,
"layoutDurationMs": 1.129,
"taskDurationMs": 406.07099999999997,
"heapDeltaBytes": 4592808,
"heapUsedBytes": 73936108,
"domNodes": 78,
"jsHeapTotalBytes": 4980736,
"scriptDurationMs": 11.07,
"eventListeners": 19,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "dom-widget-clipping",
"durationMs": 709.7459999999955,
"styleRecalcs": 11,
"styleRecalcDurationMs": 8.113999999999999,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 469.1449999999999,
"heapDeltaBytes": 17742880,
"heapUsedBytes": 88058368,
"domNodes": 18,
"jsHeapTotalBytes": 5767168,
"scriptDurationMs": 167.75199999999998,
"eventListeners": 2,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "dom-widget-clipping",
"durationMs": 743.033999999966,
"styleRecalcs": 12,
"styleRecalcDurationMs": 9.396999999999998,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 492.425,
"heapDeltaBytes": 18080360,
"heapUsedBytes": 88074388,
"domNodes": 20,
"jsHeapTotalBytes": 5767168,
"scriptDurationMs": 172.221,
"eventListeners": 2,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "large-graph-idle",
"durationMs": 2060.7889999999998,
"styleRecalcs": 5,
"styleRecalcDurationMs": 5.012000000000002,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 660.803,
"heapDeltaBytes": 11068528,
"heapUsedBytes": 86046100,
"domNodes": -271,
"jsHeapTotalBytes": -860160,
"scriptDurationMs": 37.844,
"eventListeners": -183,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "large-graph-idle",
"durationMs": 2048.9599999999655,
"styleRecalcs": 4,
"styleRecalcDurationMs": 3.800999999999999,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 643.481,
"heapDeltaBytes": -13085244,
"heapUsedBytes": 87165388,
"domNodes": -270,
"jsHeapTotalBytes": -1609728,
"scriptDurationMs": 33.581,
"eventListeners": -153,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "large-graph-pan",
"durationMs": 2448.428999999976,
"styleRecalcs": 66,
"styleRecalcDurationMs": 11.488000000000001,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 1692.1860000000001,
"heapDeltaBytes": 21966964,
"heapUsedBytes": 87312508,
"domNodes": -273,
"jsHeapTotalBytes": 225280,
"scriptDurationMs": 848.814,
"eventListeners": -153,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.699999999999818
},
{
"name": "large-graph-pan",
"durationMs": 2388.288999999986,
"styleRecalcs": 62,
"styleRecalcDurationMs": 7.922000000000002,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 1635.946,
"heapDeltaBytes": 21788460,
"heapUsedBytes": 88085324,
"domNodes": 0,
"jsHeapTotalBytes": 225280,
"scriptDurationMs": 833.342,
"eventListeners": 6,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "large-graph-zoom",
"durationMs": 3864.1020000000026,
"styleRecalcs": 61,
"styleRecalcDurationMs": 11.318000000000001,
"layouts": 60,
"layoutDurationMs": 12.546999999999999,
"taskDurationMs": 1824.151,
"heapDeltaBytes": 9578720,
"heapUsedBytes": 76561516,
"domNodes": -275,
"jsHeapTotalBytes": 0,
"scriptDurationMs": 836.3399999999999,
"eventListeners": 8,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.670000000000012,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "large-graph-zoom",
"durationMs": 3786.261999999965,
"styleRecalcs": 60,
"styleRecalcDurationMs": 9.870000000000005,
"layouts": 60,
"layoutDurationMs": 12.198,
"taskDurationMs": 1774.0459999999998,
"heapDeltaBytes": 8013604,
"heapUsedBytes": 75652072,
"domNodes": 0,
"jsHeapTotalBytes": 0,
"scriptDurationMs": 828.401,
"eventListeners": 10,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "legacy-node-drag",
"durationMs": 3133.408999999972,
"styleRecalcs": 40,
"styleRecalcDurationMs": 5.398999999999997,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 1989.4699999999998,
"heapDeltaBytes": 21941864,
"heapUsedBytes": 89586432,
"domNodes": 0,
"jsHeapTotalBytes": 417792,
"scriptDurationMs": 1004.6679999999999,
"eventListeners": 188,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66999999999998,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "legacy-node-drag",
"durationMs": 3092.9609999999457,
"styleRecalcs": 40,
"styleRecalcDurationMs": 5.3610000000000015,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 1979.82,
"heapDeltaBytes": 22635520,
"heapUsedBytes": 92096788,
"domNodes": 0,
"jsHeapTotalBytes": 417792,
"scriptDurationMs": 1010.6899999999998,
"eventListeners": 188,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "minimap-idle",
"durationMs": 2019.2219999999566,
"styleRecalcs": 4,
"styleRecalcDurationMs": 3.3019999999999996,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 640.273,
"heapDeltaBytes": -14431852,
"heapUsedBytes": 87477668,
"domNodes": -271,
"jsHeapTotalBytes": -1347584,
"scriptDurationMs": 35.119,
"eventListeners": -153,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "minimap-idle",
"durationMs": 2008.0940000000282,
"styleRecalcs": 1,
"styleRecalcDurationMs": 0.782999999999999,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 593.033,
"heapDeltaBytes": 21806760,
"heapUsedBytes": 87068492,
"domNodes": -278,
"jsHeapTotalBytes": 0,
"scriptDurationMs": 31.85700000000001,
"eventListeners": -183,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "subgraph-dom-widget-clipping",
"durationMs": 637.9009999999994,
"styleRecalcs": 46,
"styleRecalcDurationMs": 10.541000000000002,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 428.88500000000005,
"heapDeltaBytes": 14640204,
"heapUsedBytes": 80084364,
"domNodes": 18,
"jsHeapTotalBytes": 5242880,
"scriptDurationMs": 146.69700000000003,
"eventListeners": 8,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "subgraph-dom-widget-clipping",
"durationMs": 600.973999999951,
"styleRecalcs": 47,
"styleRecalcDurationMs": 10.992,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 417.22100000000006,
"heapDeltaBytes": 13953320,
"heapUsedBytes": 86090760,
"domNodes": 20,
"jsHeapTotalBytes": 4980736,
"scriptDurationMs": 143.595,
"eventListeners": 6,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "subgraph-idle",
"durationMs": 2039.4370000000208,
"styleRecalcs": 9,
"styleRecalcDurationMs": 8.962000000000002,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 547.5909999999999,
"heapDeltaBytes": -2113512,
"heapUsedBytes": 69365048,
"domNodes": -296,
"jsHeapTotalBytes": 5496832,
"scriptDurationMs": 7.719999999999998,
"eventListeners": -231,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "subgraph-idle",
"durationMs": 2010.2510000000393,
"styleRecalcs": 9,
"styleRecalcDurationMs": 8.341000000000001,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 530.471,
"heapDeltaBytes": -871284,
"heapUsedBytes": 71516336,
"domNodes": -296,
"jsHeapTotalBytes": 5234688,
"scriptDurationMs": 7.973000000000001,
"eventListeners": -231,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "subgraph-mouse-sweep",
"durationMs": 1803.0969999999797,
"styleRecalcs": 77,
"styleRecalcDurationMs": 40.162,
"layouts": 18,
"layoutDurationMs": 5.816,
"taskDurationMs": 893.8919999999999,
"heapDeltaBytes": -12545456,
"heapUsedBytes": 58995284,
"domNodes": -299,
"jsHeapTotalBytes": 6545408,
"scriptDurationMs": 121.20400000000001,
"eventListeners": -201,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "subgraph-mouse-sweep",
"durationMs": 1738.554000000022,
"styleRecalcs": 78,
"styleRecalcDurationMs": 38.424,
"layouts": 18,
"layoutDurationMs": 5.359,
"taskDurationMs": 887.34,
"heapDeltaBytes": 970564,
"heapUsedBytes": 73065032,
"domNodes": -295,
"jsHeapTotalBytes": 5758976,
"scriptDurationMs": 118.43599999999998,
"eventListeners": -233,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "subgraph-transition-enter",
"durationMs": 1417.1949999999924,
"styleRecalcs": 20,
"styleRecalcDurationMs": 32.59100000000001,
"layouts": 16,
"layoutDurationMs": 15.476999999999999,
"taskDurationMs": 974.8410000000001,
"heapDeltaBytes": -7277580,
"heapUsedBytes": 86412852,
"domNodes": 13671,
"jsHeapTotalBytes": 10223616,
"scriptDurationMs": 33.884,
"eventListeners": 2383,
"totalBlockingTimeMs": 144,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "viewport-pan-sweep",
"durationMs": 8849.491999999998,
"styleRecalcs": 246,
"styleRecalcDurationMs": 35.717999999999996,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 6055.804999999999,
"heapDeltaBytes": -11481300,
"heapUsedBytes": 88853548,
"domNodes": -272,
"jsHeapTotalBytes": -1384448,
"scriptDurationMs": 2803.1580000000004,
"eventListeners": -137,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.80000000000109
},
{
"name": "viewport-pan-sweep",
"durationMs": 8498.40299999994,
"styleRecalcs": 248,
"styleRecalcDurationMs": 36.051,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 5953.68,
"heapDeltaBytes": 24179464,
"heapUsedBytes": 89069512,
"domNodes": -268,
"jsHeapTotalBytes": 225280,
"scriptDurationMs": 2830.6800000000003,
"eventListeners": -137,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "vue-large-graph-idle",
"durationMs": 17119.884000000013,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 16527.012999999995,
"heapDeltaBytes": -26440012,
"heapUsedBytes": 176500588,
"domNodes": -6548,
"jsHeapTotalBytes": 2359296,
"scriptDurationMs": 277.565,
"eventListeners": -7473,
"totalBlockingTimeMs": 0,
"frameDurationMs": 17.220000000000073,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "vue-large-graph-idle",
"durationMs": 17473.394999999982,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 16942.788,
"heapDeltaBytes": -33685428,
"heapUsedBytes": 175906232,
"domNodes": -6548,
"jsHeapTotalBytes": -6148096,
"scriptDurationMs": 289.521,
"eventListeners": -7475,
"totalBlockingTimeMs": 0,
"frameDurationMs": 17.776666666666642,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "vue-large-graph-pan",
"durationMs": 22055.714999999964,
"styleRecalcs": 175,
"styleRecalcDurationMs": 20.241999999999983,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 21669.702999999998,
"heapDeltaBytes": -25906360,
"heapUsedBytes": 180117144,
"domNodes": -6548,
"jsHeapTotalBytes": -692224,
"scriptDurationMs": 976.623,
"eventListeners": -7469,
"totalBlockingTimeMs": 87,
"frameDurationMs": 18.333333333333332,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "vue-large-graph-pan",
"durationMs": 22134.54200000001,
"styleRecalcs": 175,
"styleRecalcDurationMs": 19.867000000000022,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 21701.025999999998,
"heapDeltaBytes": -36558928,
"heapUsedBytes": 166182244,
"domNodes": -6548,
"jsHeapTotalBytes": 2392064,
"scriptDurationMs": 983.87,
"eventListeners": -7469,
"totalBlockingTimeMs": 190,
"frameDurationMs": 18.330000000000048,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "vue-node-resize-workload",
"durationMs": 6589.3330000000105,
"styleRecalcs": 20,
"styleRecalcDurationMs": 85.52199999999999,
"layouts": 20,
"layoutDurationMs": 25.289999999999992,
"taskDurationMs": 6459.784,
"heapDeltaBytes": -36355756,
"heapUsedBytes": 173025988,
"domNodes": -6548,
"jsHeapTotalBytes": 4337664,
"scriptDurationMs": 152.20500000000004,
"eventListeners": -7469,
"totalBlockingTimeMs": 364,
"frameDurationMs": 17.776666666666763,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "vue-node-resize-workload",
"durationMs": 6265.661000000023,
"styleRecalcs": 20,
"styleRecalcDurationMs": 82.909,
"layouts": 20,
"layoutDurationMs": 22.604,
"taskDurationMs": 6131.208999999999,
"heapDeltaBytes": -27157280,
"heapUsedBytes": 182269428,
"domNodes": -6548,
"jsHeapTotalBytes": 15040512,
"scriptDurationMs": 112.56899999999999,
"eventListeners": -7471,
"totalBlockingTimeMs": 357,
"frameDurationMs": 18.886666666666677,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "workflow-execution",
"durationMs": 496.4780000000246,
"styleRecalcs": 18,
"styleRecalcDurationMs": 26.415000000000003,
"layouts": 3,
"layoutDurationMs": 1.4740000000000002,
"taskDurationMs": 143.56000000000003,
"heapDeltaBytes": 5414696,
"heapUsedBytes": 72985404,
"domNodes": 149,
"jsHeapTotalBytes": 262144,
"scriptDurationMs": 17.474000000000004,
"eventListeners": 99,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "workflow-execution",
"durationMs": 499.87899999996444,
"styleRecalcs": 16,
"styleRecalcDurationMs": 24.807000000000002,
"layouts": 3,
"layoutDurationMs": 1.8299999999999998,
"taskDurationMs": 132.047,
"heapDeltaBytes": 5181524,
"heapUsedBytes": 73261920,
"domNodes": 144,
"jsHeapTotalBytes": 524288,
"scriptDurationMs": 10.812999999999999,
"eventListeners": 99,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
}
]
}🔬 E2E Coverage
Top 10 files by uncovered lines
|
Codecov Report❌ Patch coverage is @@ Coverage Diff @@
## nathaniel/agent-v1/07-agent-control-plane #16204 +/- ##
=============================================================================
- Coverage 83.26% 83.25% -0.02%
=============================================================================
Files 2022 2022
Lines 116997 117063 +66
Branches 32576 32470 -106
=============================================================================
+ Hits 97419 97460 +41
- Misses 19222 19250 +28
+ Partials 356 353 -3
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 39 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 10 finding(s).
| Severity | Count |
|---|---|
| 🟠 High | 3 |
| 🟡 Medium | 6 |
| 🟢 Low | 1 |
Panel: 8/8 reviewers contributed findings.
|
Automated fleet review (desktop operator, Christian-authorized)
Full context for agent readersPR #16204 — design-review packetSubject: Comfy-Org/ComfyUI_frontend#16204 Verdict: MERGE-AFTER-CHANGES (2 enumerated items, both cheap; neither is a correctness 1. What the PR actually doesNine files, seven of them new, all under
Surfaces touched. Imports of CRDT internals: none. Zero imports from Three module-level mutable globals ( 2. Alignment with our ADRs2.1 ADR-012 §3 (resync is the authority path) — divergence, actionable
The CRDT follower resyncs the document by state vector. It cannot resync the transcript. The PR body classes this as "an open question for the CRDT decision stream, not this PR's call." 2.2 ADR-015 (target-graph addressing) — narrower than the end shape, seam obligation
A single nullable scalar can express at most one subscribed target. Concretely: 2.3 scalar-v1 vs Lamport stamps — no exposure, cleancomfy-multi-player main is Lamport-merged at The only schema this slice binds to is the 07 chat surface ( 2.4 ADR-006 / BE vocabulary drift in
|
| File | Result |
|---|---|
stores/agent/agentConversationStore.ts |
byte-identical |
stores/agent/agentRunModeStore.ts |
byte-identical |
composables/agent/useAgentSession.ts |
diverges: 433 L vs 393 L |
The useAgentSession.ts divergence is exactly as advertised — the 07 seam obligation (local
AgentEventSource interface deleted, imported from the service) plus the review-driven defect
fixes. Confirmed present in #16204 and absent from the candidate copy: the try/catch that
stops a post-ack local failure from reporting an accepted turn as failed; the
unsubscribe?.()/unsubscribeStatus?.() release-before-resubscribe guard against double-ingest;
localErrorCount hoisted from instance to module scope (id collision across remount); and the
resetOnFailure load-failure path. The claim that these fix defects present in the snapshot is
accurate — our own candidate branch carries the pre-fix copy. See §5.
Candidate SHA drift (flag for the operator; not written here per single-writer).
reports/review-queue/integration-candidate.md records the v2 candidate at 6a5115ab32a5, and the
verified-state row for the deployed agent.comfy.org commit uses the same SHA. The branch head is
now 84841ed46cc4, which is diverged, not ahead: 351 ahead / 347 behind 6a5115ab, i.e. the
branch was rebuilt onto a much newer main rather than advanced. Two recorded facts are stale.
Ledger candidates (R2). Not appended — this lane owns only this file and sibling
pr162xx-review lanes would race on reports/audit/verified-state.md. For the operator to add:
agentConversationStore.ts+agentRunModeStore.tsbyte-identical between [agent-v1 08/18] feat(agent): session and state coordination - thread, turn, cancellation #162041b129dffa082
and candidate84841ed46cc4;useAgentSession.tson the candidate lacks the post-ack failure
guard, the double-subscribe guard, and the module-scoped error-id mint.christian-byrne/integration-candidate-v2head is84841ed46cc4, diverged from the recorded
6a5115ab32a5(351/347).- [agent-v1 08/18] feat(agent): session and state coordination - thread, turn, cancellation #16204 E2E failures are the base [agent-v1 07/18] feat(agent): control plane - REST client, event schemas, turn transport #16188 set plus one unrelated
creditsTile.spec.tscloud flake.
5. Verdict
MERGE-AFTER-CHANGES
- Unpin the reconnect negative (
useAgentSession.test.ts, the(g)-series live-transition
test). Either drop thepostMessagecall-count assertion or retitle it as a deliberate
deferral with aTODOnaming transcript resync. As written it is a regression test protecting
behaviour our ADR-012 §3 decides against, and the correct fix — onegetMessageson the live
edge — must delete it. Cheapest correct version of the fix is in the same file. - Validate the persisted run mode on read (
agentRunModeStore.ts): fall back to'ask'when
the stored string is not one of the three known values. Three lines. Not a migration and not a
vocabulary change — the currentuseLocalStorage<AgentRunMode>simply asserts a type over
untrusted storage.
Non-blocking, record don't demand:
boundWorkflowIdis a single-target scalar where ADR-015's end shape is a target-session
registry (§2.2). Fine for this slice; must be replaced, not extended, when the registry lands.creditLimitcannot express "unset" (§2.4) — surfaces at slice 12, not here.- One-live-session-per-page is enforced by module globals and is undocumented (§1).
Downgrade condition. Both enumerated items live in unreachable code behind two gates. If chain
velocity outranks them, MERGE-OK-AS-IS + follow-up ticket is a defensible operator call — the
only thing that must not happen silently is item 1 surviving into the slice that wires the panel,
because at that point it pins user-visible transcript loss.
Merge path
Its own packet — does not fold into #97. #97 is
Comfy-Org/comfy-multi-player#97, a dependabot GitHub-Actions bump on main, unrelated to this
lineage; the reference in the lane prompt looks stale. The FE surface that matters is our own draft
candidate #16198 (christian-byrne/integration-candidate-v2), and it does collide: it contains
all three of this PR's content files at the same paths, so the two are mutually exclusive routes to
main for those files.
Recommended sequencing for the operator:
- [agent-v1 08/18] feat(agent): session and state coordination - thread, turn, cancellation #16204 cannot merge before its base [agent-v1 07/18] feat(agent): control plane - REST client, event schemas, turn transport #16188 (07) — it is stacked, and the body pins SQUASH-MERGE
ONLY per the owner's 2026-08-28 branch-history-containment order. - chore(crdt): v2 integration candidate with package pin fix #16198 is a deploy-proof branch, not a merge path. When it is next rebuilt (v3), rebase it onto
the slice chain so it picks up the fixeduseAgentSession.tsrather than shipping the pre-fix
copy it carries today (§4). This is an action on our branch, not a change request on
Nathaniel's PR. - The stale candidate SHAs in
reports/review-queue/integration-candidate.mdand the
verified-state ledger should be re-baselined before either is cited again.
Glossary
- Slice / chain: the 18-PR
nathaniel/agent-v1/NN-*stack, each PR based on its predecessor's
branch rather than onmain. - Integration candidate: our disposable branch proving a CRDT composition merges and passes
gates; currentlychristian-byrne/integration-candidate-v2, draft PR chore(crdt): v2 integration candidate with package pin fix #16198. - Transcript vs document: the chat rows (
agent_messages, durable, REST-recovered) vs the
workflow CRDT doc (state-vector-recovered). Distinct recovery paths; §2.1 turns on not
conflating them. - Stash / background turn: a turn moved out of the active slot into
backgroundTurnsso its
events keep landing while another thread is on screen. - DCE: dead-code elimination — here, the build-time
__DISTRIBUTION__literal comparison that
removes the whole agent panel from OSS bundles.
Merge-readiness scorecard
Slice 08 merge-readiness scorecard
PR: Comfy-Org/ComfyUI_frontend#16204 — session and state coordination
Observed: 2026-08-30 at head 1b129dffa0828109601f472b6149ff95407b4bee
Overall verdict: NEEDS-CHANGES — both review items remain absent from the unchanged PR head; the PR is also draft, red, and waiting for slices 03–07.
Score: 2.5/7 (PASS or accepted discretion = 1; PARTIAL = 0.5; FAIL/BLOCKED = 0)
03 -> 04 -> 05 -> 06 -> 07 -> [08] -> 09 -> 10 -> 11 -> 12 -> main
^
current slice; not its turn
| gate | status | evidence |
|---|---|---|
| Review verdict | FAIL (0/1) | The review packet says MERGE-AFTER-CHANGES. Item 1, stop the reconnect test from protecting transcript loss, is not on the PR head. Item 2, validate persisted run mode on read, is not on the PR head. Both are implemented and verified only in the detached patch series; the live head is still the reviewed 1b129dff. |
| Flag-off safety | PASS (1/1) | The slice audit is CLEAN: session and Pinia stores are dormant below the gated panel, with no global registration, CSS, route, or listener. This satisfies blocked-on-christian issue #149's user-facing-strict standard without using desktop discretion. |
| CI on current head | FAIL (0/1) | Live gh pr checks at 1b129dff: 89 pass, 12 fail, 22 skip. Failures are e2e-status, mobile Chrome, nine Chromium shards, and cloud Playwright. The review found the first eleven inherited from base slice 07 and the cloud failure unrelated, but the current head is still not green. |
| Conflict with declared base | PASS (1/1) | GitHub reports MERGEABLE against current base nathaniel/agent-v1/07-agent-control-plane@3d8c6833; no merge conflict. mergeStateStatus=BLOCKED reflects policy/check state, not a Git conflict. |
| Draft and retarget-to-main readiness | BLOCKED (0/1) | Still draft. The FEH-4 audit requires bottom-up restacking after the reconciled CRDT candidate and slices 03–07. It must not be retargeted directly to main before slice 07 lands. |
| Test coverage | PARTIAL (0.5/1) | Strong unit coverage: useAgentSession.test.ts alone has 71 tests, plus conversation-entry, conversation-store, and run-mode suites. Unit/type/lint gates passed in the review packet. Missing release evidence: no mounted browser journey for reconnect recovery, background turns, cancellation, and run-mode persistence; current E2E is red. |
| Open blockers | BLOCKED (0/1) | Slice-local review items 1–2 must be applied; current-head CI must become green; draft must be removed only by the owner; and slices 03–07 need their independent rp-1 packets and bottom-up landing. This scorecard does not duplicate rp-1. |
Merge decision
Do not merge or retarget now. When slices 03–07 have landed, apply or reproduce the two prepared
fixes on the restacked slice, rerun the affected suites and full CI, then reassess.
Provenance and glossary
Sources: live GitHub metadata/checks, the internal review packet, the mr-1 flag-off audit, and the
FEH-4 ordering audit. No quarantined Nathaniel design document or Linear design narrative was read.
- Declared base — the branch GitHub currently compares the PR against, here slice 07 rather than
main. - Restack — rebuild/rebase the slice onto the newly landed predecessor in bottom-up order.
- Detached patch series — reviewed fixes stored as patches in this program repo but not applied to the source PR.
rp-1— the parallel lane producing review packets for slices 03–07.
811eea8 to
1c196df
Compare
1b129df to
e425af1
Compare
1c196df to
062a605
Compare
- session composable owning thread, message, turn, cancellation, and active-tab state over the landed control plane - conversation store folding transport events into entries with identity-keyed turn reconciliation - run-mode store persisting the auto/ask choice - the event-source interface now imports from its 07 home; the session locale notices land with their consumer - knip transitional entries retire as their consumers land (the config-hint gate forces per-slice retirement)
DEFECT-FIX F1 (hydrateFromServer/loadThread/start): a loadThread whose history GET failed non-404 left the previous thread's transcript rendered under the new thread id, and the two hydrate entry paths disagreed on failure semantics. Entry-path hydrates now reset identity and transcript together on failure and clear the persisted key; the start() rehost path keeps its retain semantics. Receipt: (f1a)/(f1b) red at faff148, green here. DEFECT-FIX F2 (sendMessage): the try wrapped post-ack bookkeeping, so a localStorage.setItem or workflow.adopted throw after a server-accepted POST reported the turn failed and orphaned its events. Store transitions now precede the fallible side effects, persistence and consumer bookkeeping are best-effort, and sending clears on every path. Receipt: (f2a)/(f2b) red at base. DEFECT-FIX F3 (localErrorCount): the instance-scoped counter re-minted duplicate error ids into the app-scoped store across a remount; moved to module scope beside sessionGeneration. Receipt: (f3) red at base. DEFECT-FIX T3-guard (start): re-subscribing without releasing the prior subscription double-ingested every frame under the real source's per-call closure semantics; the old single-slot test fake masked it. Receipt: (t3b) red at base under the per-subscription fake. F4 (knip.config.ts): whole-file ignore replaced with the knipIgnoreUsedByStackedPR tag on WorkflowTurnContext. Receipt: knip exit 0 with the tag; exit 1 reporting WorkflowTurnContext without it. F5/F6 (test file): import grouping per file idiom; SelectedNode shadow carries its retirement marker (slice 16). F12 (knip.config.ts): agentMessageParts comment names the actual residual (PartState, NoticePart, TabLinkPart, ActivityPart) now that the factory is consumed by this slice. Pins: (t1a)/(t1b) post-settle frame immunity on the active and background-retained paths; (t2a-d) workflow wire shape, prepare gate, timeout, and rejection; (t3a)/(t3b) subscription lifecycle; (t4) reset resurface probe; (t5a)/(t5b) rememberedWorkflowId across remounts, with module state reset in beforeEach. Mutant receipts in the round delivery.
DEFECT-FIX R2-1 (hydrateFromServer 404 branch): the 404 sibling of R1's F1 still stranded the foreign transcript - it returned before the reset, nulling identity while leaving the previous thread's rows rendered. resetOnFailure now folds into the 404 branch (reset when set, setThreadId(null) otherwise); rehost 404 semantics unchanged. Receipt: (r2a) red at BOTH faff148 and b6948b7, green here. DEFECT-FIX R2-2 (start boot path): R1 passed resetOnFailure=true on the stored-key boot branch beyond the package, which destroyed an accepted in-flight turn on a transient 500 and deleted the resume pointer. The boot path no longer resets, and every reset site now requires activeTurnId === null, so a turn accepted mid-fetch is never destroyed. Receipt: (r2b) red at b6948b7 (green at faff148 - the hazard was introduced by R1), green here. DEFECT-FIX R2-3 (sendMessage): workflow.prepare/current()/tabs() ran after sending=true but outside the try, so a synchronous throw latched sending forever and killed the composer until remount. All three now run inside the inner try: a throw surfaces sendFailed and the finally clears sending. Receipt: (r2c) red at both bases (the latch predates R1), green here. DEFECT-FIX R2-4 (post-ack catches): both silent catches now console.warn per the file's own idiom; the adopted() hook is the 09-14 consumer surface and must be diagnosable. Receipt: the warn assertions folded into (f2a)/(f2b) are red at b6948b7. Corrections of record for the R1 commit body (b6948b7): - "entry-path hydrates reset identity and transcript together on failure" was FALSE for the 404 half until R2-1. - "sending clears on every path" was FALSE for synchronous workflow callback throws until R2-3. - The R1 start() guard dedupes the SUBSCRIPTION only; a second start() still costs a duplicate history GET (known, harmless). - loadThread resets while rehost retains is a deliberate divergence; both satisfy the coherence-on-failure property. Hygiene: (t2b)/(t2d) moved onto fake timers (each leaked a pending real 3s timer); (t5a) flushes its unawaited boot hydrate.
DEFECT-FIX R3-1 (director ruling, hydrateFromServer): the R2 in-flight guard re-opened the stranded-transcript failure at the 404 site when a send acked against the loading thread mid-flight. Both resetOnFailure sites now STASH-THEN-RESET: stashActiveTurn() parks the accepted turn in background state (reset does not clear it), then reset() clears the foreign rows and identity; the acked turn resumes on a later load of its thread; the activeTurnId guard retires. Receipts: (r3a) 404 flavor and (r3b) 500 flavor red at e0d9180, green here. Known cost boarded, store fenced: reset's dropAttachmentPreviews revokes the stashed turn's blob previews. Pins R3-4: (r3c) throwing tabs() and (r3d) synchronously-throwing prepare join the no-latch property; both red at b6948b7 and faff148 (they inherit R2-3's receipt), green since R2-3. Hygiene R3-5: (t5a) now awaits the actual hydrate promise from the getMessages spy result instead of two blind microtask ticks, so the dangling-hydrate flush is proven, not assumed. Notes - Receipt-integrity corrections for the R2 delivery doc land beside this commit (observed failure text, executed-vs-call-site test counts reconciled: it.for at (b6) registers two tests per site).
faf10c8 to
bf2ca92
Compare
There was a problem hiding this comment.
🔍 Cursor Review — Consolidated panel
Triggered by @christian-byrne.
Round 2 — ledger: 10 prior finding(s) across 1 round(s) (10 never answered).
Found 10 finding(s).
| Severity | Count |
|---|---|
| 🟠 High | 2 |
| 🟡 Medium | 7 |
| 🟢 Low | 1 |
Panel: 5/8 reviewers contributed findings.
Reviewers that did not contribute: claude-opus-5-thinking-max:adversarial (error), claude-opus-5-thinking-max:edge-case (error), gemini-3.1-pro:edge-case (error)
The finding(s) below could not be anchored to a line the reviewed diff carries, so they are reported here instead of inline:
src/workbench/extensions/agent/crdt/mintPortWiring.ts:226— 🟠 High —onBeforeGraphLoad()increments the teardown depth, butafterConfigureGraphdoes not fire when the load throws — as this PR's ownComfyExtension.afterLoadGraphdoc states, the bracket is meant to reset at the nextbeforeLoadGraph. Because it increments instead, the next load takes depth 1→2 and its successfulafteronly returns it to 1, leavinginTeardown()permanently true so all three mint ports silently swallow every human edit for the rest of the session — with no divergence error, since the gate short-circuits before the ports' own surfacing. Reset the depth ononBeforeGraphLoad, or balance the bracket from the load-failure path.Raised by 1 of 8 reviewers (gpt-5.6-sol-max edge-case).
src/workbench/extensions/agent/crdt/docFrameClient.ts:145— 🟡 Medium —parseDocOpFailureaccepts only the legacy{op_id, code, message}object and returnsnullfor anything else, soparseServerDocFramediscards the wholefailedfield for the shipped{index, op: {op_id}, ...}and array forms — exactly the shapestoOpsResultViewinopSender.tswas written to normalize, which can therefore never see them. A rejected batch then reaches the sender anonymous, where the empty-list path settles whichever batch is in flight asacknowledged, so a genuinely rejected batch can be credited to the wrong one. Pass the rawfailedthrough asunknown, or normalize every supported shape at this boundary.Raised by 2 of 8 reviewers (gemini-3.1-pro edge-case, gpt-5.6-sol-max edge-case).
src/workbench/extensions/agent/crdt/mintPortWiring.ts:183— 🟡 Medium — Link-store$onActionaftercallbacks run synchronously, so aconnectis enqueued immediately, whereas the layout store delivers itscreateNodechange (and thereforeadd_node) on a microtask — the same single-microtask timinglinkMintPort's severance sweep is written against. A paste or duplicate that creates and connects nodes in one task therefore sendsconnectbefore either endpoint'sadd_node; the host no-ops or rejects the missing endpoints, the serialized sender advances, and the link is permanently lost. Buffer both feeds into one ordered flush, or hold connects until their endpoint adds are enqueued.Raised by 1 of 8 reviewers (gpt-5.6-sol-max edge-case).
src/workbench/extensions/agent/components/agent/DockedAgentPanel.vue:7— 🟡 Medium — The dock consumes up tow-1/3/420px of layout width but nothing callsuseWorkspaceInsetRight, so--workspace-inset-rightis never published. Every consumer this PR adds — thedialog.variants.tssize caps andmaximized:falsecentering,viewerDialogContentClass,HUG_CONTENT_CLASS,useShareDialog, and theGlobalToastanchor fallbacks — reads it with a0pxfallback, so all of that inset math is inert and body-portaled dialogs still center on the raw viewport underneath the docked panel.Raised by 1 of 8 reviewers (claude-opus-5-thinking-max edge-case).
src/components/topbar/WorkflowTabs.vue:228— 🟢 Low —openWorkflownow resolvesfalsewhen the graph load reports failure (workflowService repaints the retained workflow and returnsfalserather than throwing), but this handler only recovers incatch, so a resolvedfalseskips theselectionRevisionbump that forces the SelectButton to re-sync. On a configure failure the tab strip can keep the failed workflow visually selected while the store and canvas were restored to the retained one — handle thefalsereturn the same way as the rejection.Raised by 1 of 8 reviewers (kimi-k3-max edge-case).
| } | ||
| unsubscribe?.() | ||
| unsubscribeStatus?.() | ||
| unsubscribe = events.subscribe(onRaw) |
There was a problem hiding this comment.
🟠 High — createAgentEventSource.onStatus delivers the current liveness synchronously on subscribe (listener(host.socket?.readyState === OPEN), pinned by its own "reports a connecting socket as offline" test), so mounting the panel while the socket is not OPEN — during a reconnect, or any remount before createSocket finishes — runs onStatus(false) here, before stashActiveTurn() a few lines below. That calls abortActiveTurn() + dropBackgroundTurns() and destroys exactly the surviving and background turns b5/b6/b7 exist to protect, and re-ordering alone will not fix it because dropBackgroundTurns() would then settle the just-stashed turn. The fakeEvents() double never emits on subscribe, so no current test can catch this.
Raised by 1 of 8 reviewers (claude-opus-5-thinking-max edge-case).
| text, | ||
| sentAttachments, | ||
| sentTags | ||
| ) |
There was a problem hiding this comment.
🟡 Medium — A stopTurn() issued before the POST ack sets stopRequestedWhileSending, but when the ack lands after a thread switch this !stillDisplayed branch backgrounds the turn and returns here, above the if (stopRequestedWhileSending) check further down — so the cancel intent is dropped, no cancelMessage is ever issued, and the server keeps generating (and billing) a turn the user explicitly stopped. Fire the deferred cancel against ack.thread_id/turnId on this path and clear the flag.
Raised by 4 of 8 reviewers (claude-opus-5-thinking-max adversarial, kimi-k3-max adversarial, claude-opus-5-thinking-max edge-case, kimi-k3-max edge-case).
| if (stored !== null) { | ||
| const generation = ++loadGeneration | ||
| conversationStore.setThreadId(stored) | ||
| void hydrateFromServer( |
There was a problem hiding this comment.
🟡 Medium — This stored-thread boot path calls void hydrateFromServer(stored, ...) without the .then(() => resumeBackgroundTurn()) that the surviving-thread branch above it has. A turn accepted while the boot GET is in flight is therefore stashed by hydrateFromServer's success path and then abandoned: hydrate() replaces messages/userTexts, so the prompt the user just sent and its streaming reply disappear while isStreaming reports idle, and a later stashActiveTurn/startBackgroundTurn for that thread overwrites the orphan (or stop()/onStatus(false) drops it outright).
Raised by 2 of 8 reviewers (claude-opus-5-thinking-max adversarial, kimi-k3-max edge-case).
| initiatingOwner !== sessionGeneration || | ||
| initiatingGeneration !== loadGeneration || | ||
| (conversationStore.threadId ?? 'new') !== destinationThread | ||
| ) |
There was a problem hiding this comment.
🟡 Medium — Unlike every other return false in sendMessage, this destination-changed guard records nothing — no recordUser, no recordFailedSend, no notice. A loadThread/newChat landing during the up-to-3s prepare() gate therefore makes the composed prompt, its attachments and its tags vanish from both the old and the new thread with no transcript row and no explanation. Abandoning the send is the right call, but it has to be visible.
Raised by 2 of 8 reviewers (claude-opus-5-thinking-max adversarial, claude-opus-5-thinking-max edge-case).
| attachments?: UserAttachment[], | ||
| tags?: string[] | ||
| ): void { | ||
| const message = createAssistantMessage(turnId) |
There was a problem hiding this comment.
🟡 Medium — startBackgroundTurn builds its transport with a no-op emit, and resumeBackgroundTurn adopts that same transport unchanged, so once the turn is resumed replaceActive() is never called again. The transport mutates the raw message object in place, which the reactive array proxy does not track, so after resume the reply's deltas and thinking state stop repainting until some unrelated ref (e.g. clearActive() on done) happens to force a re-render — the reply looks frozen mid-stream, then jumps to its final text. Give the resumed turn a transport whose emit is replaceActive, or make the emit re-bindable on resume.
Raised by 1 of 8 reviewers (claude-opus-5-thinking-max edge-case).
|
Superseded — closing per Christian's direction.
Full context for agent readersProgram pivot 2026-08-31: the 17-slice stack targeting the v1 integration branch is superseded by the #16198 v2 merge to main @f954e479. Per program/reorientation-plan.md, all remaining value (tests, QA artifacts, invariant checks, refactors) ports to main-based successor PRs. Pre-close dossier cross-check completed for this PR; unique unsalvaged content (if any) was filed as a salvage row in the program todo before close. This closed PR remains a readable source; review/QA deliverables are posted only on open successor PRs. |
…rol-plane' into hub-08-cascade # Conflicts: # knip.config.ts # src/locales/en/main.json # src/workbench/extensions/agent/composables/agent/useAgentSession.test.ts # src/workbench/extensions/agent/composables/agent/useAgentSession.ts # src/workbench/extensions/agent/stores/agent/agentConversationStore.test.ts # src/workbench/extensions/agent/stores/agent/agentConversationStore.ts # src/workbench/extensions/agent/stores/agent/agentRunModeStore.test.ts # src/workbench/extensions/agent/stores/agent/agentRunModeStore.ts
There was a problem hiding this comment.
🔍 Cursor Review — Consolidated panel
Triggered by @christian-byrne.
Round 3 — ledger: 15 prior finding(s) across 2 round(s) (15 never answered).
Found 8 finding(s).
| Severity | Count |
|---|---|
| 🟠 High | 1 |
| 🟡 Medium | 6 |
| 🟢 Low | 1 |
Panel: 3/8 reviewers contributed findings.
Reviewers that did not contribute: claude-opus-5-thinking-max:adversarial (error), gpt-5.6-sol-max:adversarial (error), claude-opus-5-thinking-max:edge-case (error), gpt-5.6-sol-max:edge-case (error), kimi-k3-max:edge-case (error)
| unsubscribe?.() | ||
| unsubscribeStatus?.() | ||
| unsubscribe = events.subscribe(onRaw) | ||
| if (events.onStatus) unsubscribeStatus = events.onStatus(onStatus) |
There was a problem hiding this comment.
🟠 High — createAgentEventSource.onStatus delivers the socket's current liveness synchronously on subscribe, so mounting while the socket is not OPEN (a reconnect, or any remount before createSocket finishes) runs onStatus(false) right here — before the surviving-thread stashActiveTurn() further down — and its abortActiveTurn() + dropBackgroundTurns() destroy exactly the live and background turns the remount path exists to preserve. The new ownedGeneration !== sessionGeneration guard only covers cross-instance staleness, not this same-instance ordering; either subscribe to status after the stash/resume completes or ignore the first synchronous status callback. Unanswered since round 2. Raised by 2 of 8 reviewers (kimi-k3-max adversarial, gemini-3.1-pro edge-case).
| sentAttachments, | ||
| sentTags | ||
| ) | ||
| return true |
There was a problem hiding this comment.
🟡 Medium — A stopTurn() issued before the POST ack sets stopRequestedWhileSending, but when the ack lands after a thread switch this !stillDisplayed branch backgrounds the turn and returns here — above the if (stopRequestedWhileSending) check on line 321 — so no cancelMessage is ever issued and the server keeps generating (and billing) a turn the user explicitly stopped. Fire the deferred cancel against ack.thread_id/turnId on this path and clear the flag. Unanswered since round 2. Raised by 2 of 8 reviewers (kimi-k3-max adversarial, gemini-3.1-pro edge-case).
| initiatingGeneration !== loadGeneration || | ||
| (conversationStore.threadId ?? 'new') !== destinationThread | ||
| ) | ||
| return false |
There was a problem hiding this comment.
🟡 Medium — Unlike every other return false in sendMessage, this destination-changed guard records nothing — no recordUser, no recordFailedSend, no notice. A loadThread/newChat landing during the up-to-3s prepare() gate therefore makes the composed prompt, its attachments, and its tags vanish from both the old and the new thread with no transcript row and no explanation; abandoning the send is the right call, but it has to be visible to the user. Unanswered since round 2. Raised by 2 of 8 reviewers (kimi-k3-max adversarial, gemini-3.1-pro edge-case).
| const stored = storageGet() | ||
| if (stored !== null) { | ||
| const generation = ++loadGeneration | ||
| conversationStore.setThreadId(stored) |
There was a problem hiding this comment.
🟡 Medium — The stored-thread boot path just below this line calls void hydrateFromServer(stored, ...) without the .then(() => resumeBackgroundTurn()) that the surviving-thread branch has. A turn accepted while that boot GET is in flight is now stashed by hydrateFromServer's success path and then abandoned: hydrate() replaces messages/userTexts, so the just-sent prompt and its streaming reply disappear while isStreaming reports idle. The [08-T2] regression test only covers the failing boot GET, not the succeeding one. Raised by 1 of 8 reviewers (gemini-3.1-pro edge-case); also unanswered from round 2.
| tags?: string[] | ||
| ): void { | ||
| const message = createAssistantMessage(turnId) | ||
| const backgroundTransport = createAgentEventTransport(message, () => {}) |
There was a problem hiding this comment.
🟡 Medium — startBackgroundTurn builds its transport with a no-op emit, and resumeBackgroundTurn adopts that same transport unchanged, so once the turn is resumed replaceActive() is never called again and the transport's updated message never reaches messages. The resumed reply therefore stops repainting mid-stream until some unrelated ref forces a re-render, then jumps to its final text — no test covers resuming an entry created by this function (the 08-fix specs all exercise the stashActiveTurn path). Give the resumed entry a transport whose emit is replaceActive. Unanswered since round 2. Raised by 2 of 8 reviewers (kimi-k3-max adversarial, gemini-3.1-pro edge-case).
|
|
||
| function saveChanges(): void { | ||
| store.save(draftMode.value, draftLimit.value) | ||
| void store.save( |
There was a problem hiding this comment.
🟡 Medium — void store.save(...) discards a promise that now rejects on any non-404 API failure (the store re-throws — see its "surfaces non-404 failures" test) and on zod validation failure, while line 39 closes the popover unconditionally. A 500 from PUT /agent/run-mode therefore yields an unhandled rejection and dismisses the dialog with the trigger still showing the old mode, as if the change had been persisted. Await the save and keep the popover open (or surface an error) when it rejects. Raised by 2 of 8 reviewers (claude-opus-5-thinking-max adversarial, kimi-k3-max adversarial).
| if (draftMode.value !== 'auto_limited') return true | ||
| const limit = draftLimit.value | ||
| return limit !== null && Number.isFinite(limit) && Math.floor(limit) > 0 | ||
| }) |
There was a problem hiding this comment.
🟡 Medium — limitValid accepts any positive finite number, but zAgentRunMode requires z.number().int(), so a fractional credit limit such as 1.5 (the spinbutton has no step) enables Save and then makes store.save() reject inside the zod parse — agentRunModeStore.test.ts pins ['auto_limited', 1.5] as rejecting. Combined with the void above, the popover closes with nothing saved and no error shown; validate with Number.isInteger or floor the draft before saving. Raised by 1 of 8 reviewers (claude-opus-5-thinking-max adversarial).
| apply(await api.putRunMode(preference)) | ||
| } catch (error) { | ||
| if (!(error instanceof AgentApiError && error.status === 404)) throw error | ||
| apply(preference) |
There was a problem hiding this comment.
🟢 Low — On a 404 save() keeps the choice locally, but nothing ever re-sends that pending preference once the endpoint exists: load()'s 404 branch only re-validates localStorage, and a later successful load() overwrites the local choice with whatever the server returns. Until BE-3135 ships, an auto/auto_limited choice made against a 404 backend is reported as saved yet never enforced, then silently reverted. Raised by 1 of 8 reviewers (claude-opus-5-thinking-max adversarial).
christian-byrne
left a comment
There was a problem hiding this comment.
Re-review found one prior fix only partially addressed. Nine of Christian's 10 earlier dispositions hold; 13 unique current findings remain open, including two High session-lifecycle failures.
Full context for agent readers
Christian prior-thread follow-through
| Prior thread | Current-head status |
|---|---|
| Key resumed rows by identity | Addressed: the text-based fallback was removed; resume deduplicates by turn identity. |
| Scope malformed completion frames | Addressed: malformed completion handling now checks both thread and message identity. |
| Reject stale remount listeners | Addressed: both raw-event and status handlers reject superseded session generations. |
| Do not re-adopt an abandoned thread after POST | Addressed for thread ownership: a late ack is routed into a background turn rather than replacing the displayed thread. A deferred Stop is still lost on this branch in a separate open finding. |
| Preserve an accepted turn across hydration | Partially addressed: hydration stashes the live turn, but the stored-thread boot path never calls resumeBackgroundTurn() after a successful GET, so the accepted prompt and reply remain hidden. This is repeated by the current open thread. |
| Capture send destination before prepare | Addressed for routing: the original destination and generation are captured before prepare(). The guard still drops the prompt without a transcript row or notice in a separate open finding. |
| Make thread storage best-effort | Addressed: get/set/remove are guarded and accepted turns no longer depend on storage success. |
| Retain attachments and tags while backgrounded | Addressed: the stash carries attachments/tags and retained blob URLs are not revoked during hydrate/reset. |
| Block a second send while a turn streams | Addressed: the send guard checks both pending POST and active turn state. |
| Recover prompt-edit state after cancel 409 | Resolved with Christian's explicit non-blocking/no-change disposition. |
GitHub marks all 10 original threads resolved. The current code independently confirms eight claimed fixes and the explicit no-change disposition; the successful stored-thread hydration case remains incomplete.
Remaining review state
There are 13 unique unresolved findings: eight attached to current slice lines and five out-of-diff findings in the round-2 review body. Five current-line findings were duplicated by round 3 and are counted once. The two High session-lifecycle failures are initial offline status destroys surviving turns before they are stashed and the partially addressed successful stored-thread hydration strands the accepted turn. The current run-mode delta also still has three open persistence/validation findings; the remaining session findings cover deferred cancellation, silent destination invalidation, and resumed-background repainting.
Verification
Reviewed exact head 7f63109bd82d90e2d76b0ea68de0c4632ecdc4cf against stacked base nathaniel/agent-v1/07-agent-control-plane. Focused Vitest: 146/146 passed across the session, conversation-store, run-mode-store, and Composer suites. Exact-head hosted product/test checks have no failed jobs; four Cursor panel model jobs were cancelled, so this is not described as fully green. This is a COMMENT review, not approval.
|
This slice is reference-only. Accepted work is routed to #17324. Full context for agent readersPer Christian's main-target close ruling, #16204 (08 — session and state) is no longer a landing vehicle. It remains readable implementation and review provenance. Session and state ownership has one live main-based destination. If a genuinely unaccounted delta is found, reopen this source or file a bounded main-based carrier rather than reviving the stacked merge path. |
Merge after: #16188 (07) - stacked on its branch per the successive-stack chain.
Decisions: Agent V1 Decision Log
Landing strategy: SQUASH-MERGE ONLY - owner order 2026-08-28 (branch-history containment; do not merge-commit).
Summary
Slice 08 of the agent-v1 chain: session and state coordination - thread, message, turn, cancellation, and session state with one tested owner. No UI, no graph semantics, no CRDT. Census vs merge-base: 9 files, +3333/-6.
Changes
useAgentSession+ its suite) and the conversation/run-mode stores extracted from the reviewed integration snapshot; three locale keys land with the code that calls them; two knip transitional entries retire as their exports gain in-slice consumers.Review Focus
useAgentSession.tsdiverges only by the recorded 07 seam obligation (deletes its localAgentEventSourceinterface and imports it from the 07 service); its test file re-points the same import and homes a 5-lineSelectedNodeshim verbatim from its snapshot location (marked transitional, retires when the canvas-selection slice lands).sendingcan no longer latch permanently on a throwing workflow callback; local-error ids no longer collide across a panel remount; a real double-subscribe bug (twostart()calls double-ingesting every frame) fixed with a release-before-resubscribe guard; the whole-file knip ignore replaced with the repo's one-symbol tag idiom.'ask' | 'auto' | 'auto-limit'identifiers and 300 default are the reviewed snapshot's values; migration to the backend vocabulary (ask_approval/auto/auto_limited, null-unset credit limit) is a scheduled follow-up ruled with the backend owner - deliberately not changed in the extraction.Linear tickets
Review-audit deltas (salvage matrix): items found during the slicing and review audits that did not make it through the integration merge (#16198).
12 artifacts resolved by this slice (5 high severity):