Skip to content

[agent-v1 08/18] feat(agent): session and state coordination - thread, turn, cancellation - #16204

Closed
CodeJuggernaut wants to merge 11 commits into
nathaniel/agent-v1/07-agent-control-planefrom
nathaniel/agent-v1/08-session-state
Closed

CodeJuggernaut wants to merge 11 commits into
nathaniel/agent-v1/07-agent-control-planefrom
nathaniel/agent-v1/08-session-state

Conversation

@CodeJuggernaut

@CodeJuggernaut CodeJuggernaut commented Aug 28, 2026 •

Copy link
Copy Markdown
Contributor

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

  • What: the session composition seam (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

  • Extraction fidelity: 5 of 7 content files hash-exact against the integration snapshot (the whole conversation-store layer, plus the run-mode store pair); useAgentSession.ts diverges only by the recorded 07 seam obligation (deletes its local AgentEventSource interface and imports it from the 07 service); its test file re-points the same import and homes a 5-line SelectedNode shim verbatim from its snapshot location (marked transitional, retires when the canvas-selection slice lands).
  • Dual blind cuts converged byte-identically on 7 of 9 files - the strongest extraction-fidelity receipt in the chain so far.
  • Three review-driven fix rounds landed at the current head (all deviations DEFECT-FIX-tagged with red-at-base receipts, several fixing defects present in the integration snapshot itself): entry-path load failures now leave transcript and thread identity coherent, with a send acked mid-load surviving as a resumable background turn (stash-then-reset); a server-accepted turn can no longer be reported failed or orphaned by post-ack local failures; sending can no longer latch permanently on a throwing workflow callback; local-error ids no longer collide across a panel remount; a real double-subscribe bug (two start() 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.
  • Suite: 97 tests across the four files (71 in the session suite), including cancellation post-settle pins (active and background-retained variants), workflow wire-body coverage with prepare-gate cases on fake timers, listener-set source semantics (stopped sessions ingest nothing; double start never double-ingests), and load-failure race pins in both 404 and 500 flavors.
  • FE-1313 split, for QA readers: this slice lands the persisted run-mode preference (the store); the popover UI rides the composer slice (12); run gating ships with BE-3135. The store's '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.
  • Known limitation, boarded: a load failure that backgrounds an in-flight turn revokes its attachment blob previews (the conversation store is extraction-fenced this slice; recorded for the panel-composition slice).
  • CRDT: zero crdt references; reconnect transcript recovery is an open question for the CRDT decision stream, not this PR's call.
  • Draft until the chain's review flow completes.

Linear tickets

  • FE-1313 - Auto/Ask run-mode control: the persisted preference store
  • FE-1929 - normalized transcript model and stable message identity (the persistence seam lands in 09)

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):

ID Severity Kind Artifact
7.0 high fix send() ack-vs-navigation race fix: destination snapshot + background routing of accepted acks (startBackground
7.1 high fix accepted-turn orphaning fix: store transitions before fallible side effects (localStorage quota, workflow.adop
7.2 high fix sending-latch brick fix: workflow.current()/tabs()/sync-throwing prepare moved inside try/finally
7.3 high guard stale-session guards: ownedGeneration check in onRaw/onStatus + unsubscribe-before-resubscribe in start()
7.4 medium fix concurrent-send guard: block send while a turn is active, not just while POST pending
7.5 medium fix thread-scoped background-turn settle: settleBackgroundTurn(thread, turnId) and thread-id-aware malformed-done
7.6 medium fix hydration hardening: stashActiveTurn before hydrate + resetOnFailure semantics for entry-path loads
7.7 medium fix background-turn attachments/tags carried through stash/resume + blob preview retention in dropAttachmentPrevie
7.8 medium fix removal of the same-user-text collapse heuristic in resumeBackgroundTurn (identity-only dedupe)
7.9 medium feature run-mode persistence conformed to the API contract: zAgentRunMode schema, GET/PUT /agent/run-mode client, serv
7.10 low guard localStorage failure wrappers (storageGet/storageSet/storageRemove) + app-lifetime localErrorCount error-id mi
7.11 high test ~650 lines of regression tests: 29 tip-only scenarios in useAgentSession.test.ts (incl. the [08-T1..T9] regres

@coderabbitai

coderabbitai Bot commented Aug 28, 2026 •

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Team

Run ID: 8850f289-8e8b-4415-a34e-b001f711b610

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actions Bot commented Aug 28, 2026 •

Copy link
Copy Markdown
Contributor

🎭 Playwright: ✅ 1888 passed, 0 failed · 1 flaky

📊 Browser Reports
  • chromium: View Report (✅ 1867 / ❌ 0 / ⚠️ 1 / ⏭️ 4)
  • chromium-2x: View Report (✅ 2 / ❌ 0 / ⚠️ 0 / ⏭️ 0)
  • chromium-0.5x: View Report (✅ 1 / ❌ 0 / ⚠️ 0 / ⏭️ 0)
  • mobile-chrome: View Report (✅ 18 / ❌ 0 / ⚠️ 0 / ⏭️ 0)

🎨 Storybook: ✅ Built — View Storybook

Details

⏰ Completed at: 09/01/2026, 11:10:02 AM UTC

Links

📦 Bundle Size

⏳ Size data collection in progress…

⚡ Performance Report

canvas-idle: · 60.0 avg FPS · 59.7 P5 FPS ✅ (target: ≥52) · 0ms TBT · 59.7 MB heap
canvas-mouse-sweep: · 60.0 avg FPS · 59.5 P5 FPS ✅ (target: ≥52) · 0ms TBT · 57.9 MB heap
canvas-zoom-sweep: · 60.0 avg FPS · 59.9 P5 FPS ✅ (target: ≥52) · 0ms TBT · 70.7 MB heap
dom-widget-clipping: · 60.0 avg FPS · 59.7 P5 FPS ✅ (target: ≥52) · 0ms TBT · 84.0 MB heap
large-graph-idle: · 60.0 avg FPS · 59.7 P5 FPS ✅ (target: ≥52) · 0ms TBT · 82.6 MB heap
large-graph-pan: · 60.0 avg FPS · 59.9 P5 FPS ✅ (target: ≥52) · 0ms TBT · 83.6 MB heap
large-graph-zoom: · 60.0 avg FPS · 59.7 P5 FPS ✅ (target: ≥52) · 0ms TBT · 72.6 MB heap
legacy-node-drag: · 60.0 avg FPS · 59.7 P5 FPS ✅ (target: ≥52) · 0ms TBT · 86.6 MB heap
minimap-idle: · 60.0 avg FPS · 59.9 P5 FPS ✅ (target: ≥52) · 0ms TBT · 83.2 MB heap
subgraph-dom-widget-clipping: · 60.0 avg FPS · 59.7 P5 FPS ✅ (target: ≥52) · 0ms TBT · 79.2 MB heap
subgraph-idle: · 60.0 avg FPS · 59.7 P5 FPS ✅ (target: ≥52) · 0ms TBT · 67.2 MB heap
subgraph-mouse-sweep: · 60.0 avg FPS · 59.5 P5 FPS ✅ (target: ≥52) · 0ms TBT · 63.0 MB heap
subgraph-transition-enter: · 60.0 avg FPS · 59.9 P5 FPS ✅ (target: ≥52) · 144ms TBT · 82.4 MB heap
viewport-pan-sweep: · 60.0 avg FPS · 59.7 P5 FPS ✅ (target: ≥52) · 0ms TBT · 84.8 MB heap
vue-large-graph-idle: · 57.1 avg FPS · 59.5 P5 FPS ✅ (target: ≥52) · 0ms TBT · 168.0 MB heap
vue-large-graph-pan: · 54.6 avg FPS · 59.7 P5 FPS ✅ (target: ≥52) · 139ms TBT · 165.1 MB heap
vue-node-resize-workload: · 54.6 avg FPS · 59.7 P5 FPS ✅ (target: ≥52) · 361ms TBT · 169.4 MB heap
workflow-execution: · 60.0 avg FPS · 59.7 P5 FPS ✅ (target: ≥52) · 0ms TBT · 69.7 MB heap

ℹ️ No baseline found — significance unavailable.

Absolute values
Metric Value
canvas-idle: avg frame time 17ms
canvas-idle: p95 frame time 17ms
canvas-idle: layout duration 0ms
canvas-idle: style recalc duration 8ms
canvas-idle: layout count 0
canvas-idle: style recalc count 8
canvas-idle: task duration 561ms
canvas-idle: script duration 9ms
canvas-idle: TBT 0ms
canvas-idle: heap used 59.7 MB
canvas-idle: DOM nodes -283
canvas-idle: event listeners -170
canvas-mouse-sweep: avg frame time 17ms
canvas-mouse-sweep: p95 frame time 17ms
canvas-mouse-sweep: layout duration 5ms
canvas-mouse-sweep: style recalc duration 48ms
canvas-mouse-sweep: layout count 14
canvas-mouse-sweep: style recalc count 79
canvas-mouse-sweep: task duration 1004ms
canvas-mouse-sweep: script duration 175ms
canvas-mouse-sweep: TBT 0ms
canvas-mouse-sweep: heap used 57.9 MB
canvas-mouse-sweep: DOM nodes -281
canvas-mouse-sweep: event listeners -156
canvas-zoom-sweep: avg frame time 17ms
canvas-zoom-sweep: p95 frame time 17ms
canvas-zoom-sweep: layout duration 1ms
canvas-zoom-sweep: style recalc duration 19ms
canvas-zoom-sweep: layout count 6
canvas-zoom-sweep: style recalc count 31
canvas-zoom-sweep: task duration 409ms
canvas-zoom-sweep: script duration 11ms
canvas-zoom-sweep: TBT 0ms
canvas-zoom-sweep: heap used 70.7 MB
canvas-zoom-sweep: DOM nodes 78
canvas-zoom-sweep: event listeners 19
dom-widget-clipping: avg frame time 17ms
dom-widget-clipping: p95 frame time 17ms
dom-widget-clipping: layout duration 0ms
dom-widget-clipping: style recalc duration 9ms
dom-widget-clipping: layout count 0
dom-widget-clipping: style recalc count 12
dom-widget-clipping: task duration 481ms
dom-widget-clipping: script duration 170ms
dom-widget-clipping: TBT 0ms
dom-widget-clipping: heap used 84.0 MB
dom-widget-clipping: DOM nodes 19
dom-widget-clipping: event listeners 2
large-graph-idle: avg frame time 17ms
large-graph-idle: p95 frame time 17ms
large-graph-idle: layout duration 0ms
large-graph-idle: style recalc duration 4ms
large-graph-idle: layout count 0
large-graph-idle: style recalc count 5
large-graph-idle: task duration 652ms
large-graph-idle: script duration 36ms
large-graph-idle: TBT 0ms
large-graph-idle: heap used 82.6 MB
large-graph-idle: DOM nodes -271
large-graph-idle: event listeners -168
large-graph-pan: avg frame time 17ms
large-graph-pan: p95 frame time 17ms
large-graph-pan: layout duration 0ms
large-graph-pan: style recalc duration 10ms
large-graph-pan: layout count 0
large-graph-pan: style recalc count 64
large-graph-pan: task duration 1664ms
large-graph-pan: script duration 841ms
large-graph-pan: TBT 0ms
large-graph-pan: heap used 83.6 MB
large-graph-pan: DOM nodes -137
large-graph-pan: event listeners -74
large-graph-zoom: avg frame time 17ms
large-graph-zoom: p95 frame time 17ms
large-graph-zoom: layout duration 12ms
large-graph-zoom: style recalc duration 11ms
large-graph-zoom: layout count 60
large-graph-zoom: style recalc count 61
large-graph-zoom: task duration 1799ms
large-graph-zoom: script duration 832ms
large-graph-zoom: TBT 0ms
large-graph-zoom: heap used 72.6 MB
large-graph-zoom: DOM nodes -138
large-graph-zoom: event listeners 9
legacy-node-drag: avg frame time 17ms
legacy-node-drag: p95 frame time 17ms
legacy-node-drag: layout duration 0ms
legacy-node-drag: style recalc duration 5ms
legacy-node-drag: layout count 0
legacy-node-drag: style recalc count 40
legacy-node-drag: task duration 1985ms
legacy-node-drag: script duration 1008ms
legacy-node-drag: TBT 0ms
legacy-node-drag: heap used 86.6 MB
legacy-node-drag: DOM nodes 0
legacy-node-drag: event listeners 188
minimap-idle: avg frame time 17ms
minimap-idle: p95 frame time 17ms
minimap-idle: layout duration 0ms
minimap-idle: style recalc duration 2ms
minimap-idle: layout count 0
minimap-idle: style recalc count 3
minimap-idle: task duration 617ms
minimap-idle: script duration 33ms
minimap-idle: TBT 0ms
minimap-idle: heap used 83.2 MB
minimap-idle: DOM nodes -275
minimap-idle: event listeners -168
subgraph-dom-widget-clipping: avg frame time 17ms
subgraph-dom-widget-clipping: p95 frame time 17ms
subgraph-dom-widget-clipping: layout duration 0ms
subgraph-dom-widget-clipping: style recalc duration 11ms
subgraph-dom-widget-clipping: layout count 0
subgraph-dom-widget-clipping: style recalc count 47
subgraph-dom-widget-clipping: task duration 423ms
subgraph-dom-widget-clipping: script duration 145ms
subgraph-dom-widget-clipping: TBT 0ms
subgraph-dom-widget-clipping: heap used 79.2 MB
subgraph-dom-widget-clipping: DOM nodes 19
subgraph-dom-widget-clipping: event listeners 7
subgraph-idle: avg frame time 17ms
subgraph-idle: p95 frame time 17ms
subgraph-idle: layout duration 0ms
subgraph-idle: style recalc duration 9ms
subgraph-idle: layout count 0
subgraph-idle: style recalc count 9
subgraph-idle: task duration 539ms
subgraph-idle: script duration 8ms
subgraph-idle: TBT 0ms
subgraph-idle: heap used 67.2 MB
subgraph-idle: DOM nodes -296
subgraph-idle: event listeners -231
subgraph-mouse-sweep: avg frame time 17ms
subgraph-mouse-sweep: p95 frame time 17ms
subgraph-mouse-sweep: layout duration 6ms
subgraph-mouse-sweep: style recalc duration 39ms
subgraph-mouse-sweep: layout count 18
subgraph-mouse-sweep: style recalc count 78
subgraph-mouse-sweep: task duration 891ms
subgraph-mouse-sweep: script duration 120ms
subgraph-mouse-sweep: TBT 0ms
subgraph-mouse-sweep: heap used 63.0 MB
subgraph-mouse-sweep: DOM nodes -297
subgraph-mouse-sweep: event listeners -217
subgraph-transition-enter: avg frame time 17ms
subgraph-transition-enter: p95 frame time 17ms
subgraph-transition-enter: layout duration 15ms
subgraph-transition-enter: style recalc duration 33ms
subgraph-transition-enter: layout count 16
subgraph-transition-enter: style recalc count 20
subgraph-transition-enter: task duration 975ms
subgraph-transition-enter: script duration 34ms
subgraph-transition-enter: TBT 144ms
subgraph-transition-enter: heap used 82.4 MB
subgraph-transition-enter: DOM nodes 13671
subgraph-transition-enter: event listeners 2383
viewport-pan-sweep: avg frame time 17ms
viewport-pan-sweep: p95 frame time 17ms
viewport-pan-sweep: layout duration 0ms
viewport-pan-sweep: style recalc duration 36ms
viewport-pan-sweep: layout count 0
viewport-pan-sweep: style recalc count 247
viewport-pan-sweep: task duration 6005ms
viewport-pan-sweep: script duration 2817ms
viewport-pan-sweep: TBT 0ms
viewport-pan-sweep: heap used 84.8 MB
viewport-pan-sweep: DOM nodes -270
viewport-pan-sweep: event listeners -137
vue-large-graph-idle: avg frame time 17ms
vue-large-graph-idle: p95 frame time 17ms
vue-large-graph-idle: layout duration 0ms
vue-large-graph-idle: style recalc duration 0ms
vue-large-graph-idle: layout count 0
vue-large-graph-idle: style recalc count 0
vue-large-graph-idle: task duration 16735ms
vue-large-graph-idle: script duration 284ms
vue-large-graph-idle: TBT 0ms
vue-large-graph-idle: heap used 168.0 MB
vue-large-graph-idle: DOM nodes -6548
vue-large-graph-idle: event listeners -7474
vue-large-graph-pan: avg frame time 18ms
vue-large-graph-pan: p95 frame time 17ms
vue-large-graph-pan: layout duration 0ms
vue-large-graph-pan: style recalc duration 20ms
vue-large-graph-pan: layout count 0
vue-large-graph-pan: style recalc count 175
vue-large-graph-pan: task duration 21685ms
vue-large-graph-pan: script duration 980ms
vue-large-graph-pan: TBT 139ms
vue-large-graph-pan: heap used 165.1 MB
vue-large-graph-pan: DOM nodes -6548
vue-large-graph-pan: event listeners -7469
vue-node-resize-workload: avg frame time 18ms
vue-node-resize-workload: p95 frame time 17ms
vue-node-resize-workload: layout duration 24ms
vue-node-resize-workload: style recalc duration 84ms
vue-node-resize-workload: layout count 20
vue-node-resize-workload: style recalc count 20
vue-node-resize-workload: task duration 6295ms
vue-node-resize-workload: script duration 132ms
vue-node-resize-workload: TBT 361ms
vue-node-resize-workload: heap used 169.4 MB
vue-node-resize-workload: DOM nodes -6548
vue-node-resize-workload: event listeners -7470
workflow-execution: avg frame time 17ms
workflow-execution: p95 frame time 17ms
workflow-execution: layout duration 2ms
workflow-execution: style recalc duration 26ms
workflow-execution: layout count 3
workflow-execution: style recalc count 17
workflow-execution: task duration 138ms
workflow-execution: script duration 14ms
workflow-execution: TBT 0ms
workflow-execution: heap used 69.7 MB
workflow-execution: DOM nodes 147
workflow-execution: event listeners 99
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

Metric Covered Total Pct
Lines 48024 70479 68.1% 🟡
Functions 0 0 — —
Branches 0 0 — —
Top 10 files by uncovered lines
File Coverage Missed
src/LGraphCanvas.ts 67.1% 1188
src/LGraphNode.ts 69.7% 391
src/extensions/core/cameraInfo/CameraInfoViewport.ts 2.0% 343
src/platform/workspace/stores/billingOperationStore.ts 8.3% 300
src/platform/workspace/stores/workspaceAuthStore.ts 36.0% 288
src/platform/workspace/stores/teamWorkspaceStore.ts 37.7% 261
src/LGraph.ts 78.4% 258
src/scripts/app.ts 71.5% 251
src/scripts/pnginfo.ts 21.4% 221
src/stores/assetsStore.ts 44.7% 204

@github-actions github-actions Bot added the risk:R2 PR risk grade (advisory shadow check; grader-owned) label Aug 28, 2026
@codecov

codecov Bot commented Aug 28, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 84.00000% with 24 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
...ensions/agent/composables/agent/useAgentSession.ts 87.20% 11 Missing ⚠️
...sions/agent/stores/agent/agentConversationStore.ts 41.17% 10 Missing ⚠️
...extensions/agent/stores/agent/agentRunModeStore.ts 89.65% 3 Missing ⚠️
@@                              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     
Flag Coverage Δ
e2e 66.63% <ø> (+0.02%) ⬆️
unit 76.49% <84.00%> (-0.04%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...agent/components/agent/composer/RunModePopover.vue 100.00% <100.00%> (ø)
...rkbench/extensions/agent/schemas/agentApiSchema.ts 100.00% <100.00%> (ø)
...xtensions/agent/services/agent/agentEventSource.ts 100.00% <ø> (ø)
...extensions/agent/services/agent/agentRestClient.ts 100.00% <100.00%> (ø)
...extensions/agent/stores/agent/agentRunModeStore.ts 90.00% <89.65%> (-10.00%) ⬇️
...sions/agent/stores/agent/agentConversationStore.ts 92.85% <41.17%> (-6.02%) ⬇️
...ensions/agent/composables/agent/useAgentSession.ts 94.57% <87.20%> (-1.62%) ⬇️

... and 39 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@christian-byrne christian-byrne added the cursor-review Trigger multi-model Cursor agent review on this PR label Aug 30, 2026

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔍 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.

@christian-byrne

christian-byrne commented Aug 30, 2026 •

Copy link
Copy Markdown
Contributor

Automated fleet review (desktop operator, Christian-authorized)

  • NEEDS-CHANGES.
  • Apply two prepared fixes.
  • Chain and CI blocked.
Full context for agent readers

PR #16204 — design-review packet

Subject: Comfy-Org/ComfyUI_frontend#16204
— "[agent-v1 08/18] feat(agent): session and state coordination — thread, turn, cancellation"
Author: CodeJuggernaut · State: OPEN, draft · Head: 1b129dffa082
Base: nathaniel/agent-v1/07-agent-control-plane (stacked on #16188, itself open and stacked on 06)
Size: 9 files, +3333/−6 · label risk:R2
Reviewed: 2026-08-29 · report-only lane, no PR comments filed.

Verdict: MERGE-AFTER-CHANGES (2 enumerated items, both cheap; neither is a correctness
blocker in shipped code — see §5 for the downgrade condition). Merge path needs its own
packet
; it does not fold into #97.


1. What the PR actually does

Nine files, seven of them new, all under src/workbench/extensions/agent/:

File Kind Note
composables/agent/useAgentSession.ts new, 433 L the session composition seam
composables/agent/useAgentSession.test.ts new, 2094 L 71 tests
stores/agent/agentConversationStore.ts new, 327 L Pinia; transcript + turn lifecycle
stores/agent/agentConversationStore.test.ts, agentConversationEntries.test.ts new
stores/agent/agentRunModeStore.ts new, 19 L Pinia; useLocalStorage run-mode preference
stores/agent/agentRunModeStore.test.ts new, 41 L
knip.config.ts edit retires 2 transitional ignores, rewords a third
src/locales/en/main.json edit +3 keys under agent.

Surfaces touched. useAgentSession(deps) owns: WS subscribe/unsubscribe via the 07
AgentEventSource, thread identity (localStorage key Comfy.Agent.ThreadId), send/cancel over
the 07 AgentRestClient, hydrate-from-server, new-chat/load-thread, and a boundWorkflowId ref.
agentConversationStore owns the assistant-message list, the active turn's event transport, and a
backgroundTurns map keyed by thread id (stash/resume/settle/drop). agentRunModeStore is a
2-key persisted preference.

Imports of CRDT internals: none. Zero imports from extensions/agent/crdt/**; zero references
to Yjs, Loro, state vectors, doc frames, seq gaps, stamps, or SCHEMA_VERSION. The only two
CRDT mentions in the whole diff are prose comments (useAgentSession.ts:74,
useAgentSession.test.ts ~line 543) asserting that reconnection recovery is the follower's job —
see §2.1, that assertion is the one real divergence.

Three module-level mutable globals (sessionGeneration, localErrorCount, rememberedWorkflowId)
encode a deliberate one-live-agent-session-per-page model: a second start() bumps
sessionGeneration and silently invalidates the first instance's stop() and in-flight hydrate
callbacks. That is compatible with our end shape (one session, many targets) but is an
unwritten assumption worth an ADR line somewhere in the chain.

2. Alignment with our ADRs

2.1 ADR-012 §3 (resync is the authority path) — divergence, actionable

onStatus(live=false) calls conversationStore.abortActiveTurn() +
dropBackgroundTurns(). Nothing recovers on the live=true edge, and the suite pins the
absence:

// Reconnection recovery is the CRDT follower's job now; the session
// makes no REST calls on a live transition.
status(true)
expect(vi.mocked(rest.postMessage).mock.calls.length).toBe(requestsBefore)

The CRDT follower resyncs the document by state vector. It cannot resync the transcript.
ADR-012 §1 puts agent_threads/agent_messages/agent_tool_calls in the durable class and §3
makes the durable rows the catch-up source for every client class; ADR-012 §4 says the server-side
turn keeps running when the client is not there. So after a socket blip the user's in-flight reply
is locally aborted and permanently invisible, while the rows land server-side — recovering it
needs exactly one rest.getMessages(threadId) on the live edge, which is the call this test now
forbids.

The PR body classes this as "an open question for the CRDT decision stream, not this PR's call."
In our design it is not open: ADR-012 answers it, and the doc-follower cannot be the answer.
Delegating transcript recovery to the follower is a category error, and pinning the negative
converts it into a regression test that the correct fix must delete.

2.2 ADR-015 (target-graph addressing) — narrower than the end shape, seam obligation

boundWorkflowId: Ref<string | null> is documented in-file as "the CRDT follower's subscribe
target," and that is literally true on the integration lineage:
useAgentCrdtFollower(workflowId: Ref<string | null>, …) at christian-byrne/integration-candidate-v2
takes precisely this shape. ADR-015's FE end shape is a registry of target sessions — each
workflow_id keeping its own doc, state vector, GraphScope and pending queue, with offscreen
targets retaining their batches and never falling back to the active graph.

A single nullable scalar can express at most one subscribed target. Concretely: loadThread() and
newChat() null boundWorkflowId, so a turn stashed into backgroundTurns for thread A keeps
streaming its chat events while its document target is unsubscribed — offscreen doc mutations
for A's workflow are dropped, not queued, which is the failure ADR-015 exists to prevent. No code
in this slice does that dropping (there is no follower here), so it is not a defect in #16204; it
is a recorded obligation that the registry work must replace this scalar, not extend it.

2.3 scalar-v1 vs Lamport stamps — no exposure, clean

comfy-multi-player main is Lamport-merged at 8636af3e and the DQ-11 fix raised the wire to
SCHEMA_VERSION = 2 with creator-carried node_incarnation. #16204 has zero surface on any of
it
: no stamps, no op envelopes, no doc frames, no schema-version literals, no persisted document
shape. Rebasing this slice onto the integration candidate cannot break on stamp semantics.

The only schema this slice binds to is the 07 chat surface (agentApiSchema): AgentTurnAccepted
(thread_id, message_id, optional workflow_id), zAgentWsEvent, and AgentMessages rows
(id, seq, turn_id, role, content.text). Those match ADR-012's durable-row model. One
readability trap for future reviewers: hydrate() sorts by row.seq, a per-thread chat
sequence, which is a different quantity from the document seq in ADR-011's gap-recovery rule.
Same word, unrelated invariants.

2.4 ADR-006 / BE vocabulary drift in agentRunModeStore

The store persists 'ask' | 'auto' | 'auto-limit' and a numeric creditLimit defaulting to 300;
the backend vocabulary is ask_approval / auto / auto_limited with a null-unset limit. The PR
declares this deliberate (snapshot values preserved; translation is a scheduled BE-3135 follow-up).
That is a defensible extraction call and, under #79 (private alpha), no migration is owed — this
report asks for none.

Two things remain worth naming anyway, neither of which is a migration ask:

  • useLocalStorage<AgentRunMode>('Comfy.Agent.RunMode', 'ask') performs no read-side validation.
    Any string already in that key — including a post-BE-3135 value — is returned typed as
    AgentRunMode. The type is a lie about untrusted input, independent of any vocabulary change.
  • creditLimit has no representation for "unset". Once slice 12's popover ships, every request
    carries a limit even in ask/auto mode, where the backend's null means something different.

2.5 ADR-004 / ADR-008 / ADR-018 — no contact

V0 draft_patch, local single-writer/SQLite persistence, and the handleDocFrame product gate are
all outside this slice's surface. Nothing here contradicts them.

3. Risk classing

Shipped surface: effectively none. The chain's distribution seam is
composables/useAgentDockMount.ts, which returns a dead branch under
if (__DISTRIBUTION__ !== 'cloud') — compile-time DCE for OSS builds — and otherwise gates on
agentPanelStore.enabled (PostHog flag, utils/postHogFlagSource.ts) behind a
defineAsyncComponent chunk. Layered gating: build-time distribution → runtime flag → lazy chunk.

Reachability of this slice's code: zero. On the 08 head, AgentPanelRoot.vue — the only thing
the docked panel lazily mounts — is still a header-and-empty-body stub importing only
agentPanelStore. Nothing mounted imports useAgentSession, agentConversationStore, or
agentRunModeStore. With no import edge, Rollup emits none of the three modules into any chunk.

Bundle impact: ~0 for the code; ~150 bytes for the strings. The three new agent.* keys in
src/locales/en/main.json are not distribution-gated and do ship in OSS builds. Trivial, but it is
the one byte of this PR that reaches every user.

Note on the knip delta. Retiring the agentRestClient.ts and agentApiSchema.ts ignores is
correct — this slice consumes both. But knip counts test files as entry points, so it stays green
on the three new modules purely because their own suites import them. Knip is not evidence of
reachability here; the AgentPanelRoot.vue stub above is.

CI at head 1b129dffa082: 73 SUCCESS / 18 SKIPPED / 12 FAILURE.

  • 9 chromium shards + mobile-chrome + e2e-status fail identically on the base [agent-v1 07/18] feat(agent): control plane - REST client, event schemas, turn transport #16188
    (3d8c68334133). Inherited, not caused here.
  • playwright-tests (cloud) is the one check that passes on the base and fails on this PR.
    Read the log before treating that as a signal: the sole failure is
    browser_tests/tests/dialogs/creditsTile.spec.ts:489 (Top-up 3DS verification), 149 passed, 3
    further tests flaky-passed on retry, and the assertion is a credits-dialog "Back" button that was
    never found. Unrelated to agent code that has no mount site — infrastructure flake, not a
    regression. Worth a re-run, not a hold.

4. Extraction-fidelity check (verified, not taken on trust)

Byte-compared the PR head against the current integration-candidate head
christian-byrne/integration-candidate-v2 @ 84841ed46cc4:

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:

5. Verdict

MERGE-AFTER-CHANGES

  1. Unpin the reconnect negative (useAgentSession.test.ts, the (g)-series live-transition
    test). Either drop the postMessage call-count assertion or retitle it as a deliberate
    deferral with a TODO naming transcript resync. As written it is a regression test protecting
    behaviour our ADR-012 §3 decides against, and the correct fix — one getMessages on the live
    edge — must delete it. Cheapest correct version of the fix is in the same file.
  2. 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 current useLocalStorage<AgentRunMode> simply asserts a type over
    untrusted storage.

Non-blocking, record don't demand:

  • boundWorkflowId is 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.
  • creditLimit cannot 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:

  1. [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.
  2. 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 fixed useAgentSession.ts rather 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.
  3. The stale candidate SHAs in reports/review-queue/integration-candidate.md and 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 on main.
  • Integration candidate: our disposable branch proving a CRDT composition merges and passes
    gates; currently christian-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 backgroundTurns so 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.

@christian-byrne
christian-byrne force-pushed the nathaniel/agent-v1/07-agent-control-plane branch 4 times, most recently from 811eea8 to 1c196df Compare August 30, 2026 14:26
@christian-byrne
christian-byrne force-pushed the nathaniel/agent-v1/08-session-state branch from 1b129df to e425af1 Compare August 30, 2026 14:47
@christian-byrne
christian-byrne force-pushed the nathaniel/agent-v1/07-agent-control-plane branch from 1c196df to 062a605 Compare August 30, 2026 17:00
CodeJuggernaut and others added 6 commits August 30, 2026 17:37
- 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).
@christian-byrne
christian-byrne force-pushed the nathaniel/agent-v1/08-session-state branch from faf10c8 to bf2ca92 Compare August 30, 2026 17:40
@christian-byrne christian-byrne added cursor-review Trigger multi-model Cursor agent review on this PR and removed cursor-review Trigger multi-model Cursor agent review on this PR labels Aug 30, 2026

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔍 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, but afterConfigureGraph does not fire when the load throws — as this PR's own ComfyExtension.afterLoadGraph doc states, the bracket is meant to reset at the next beforeLoadGraph. Because it increments instead, the next load takes depth 1→2 and its successful after only returns it to 1, leaving inTeardown() 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 on onBeforeGraphLoad, 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 — parseDocOpFailure accepts only the legacy {op_id, code, message} object and returns null for anything else, so parseServerDocFrame discards the whole failed field for the shipped {index, op: {op_id}, ...} and array forms — exactly the shapes toOpsResultView in opSender.ts was 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 as acknowledged, so a genuinely rejected batch can be credited to the wrong one. Pass the raw failed through as unknown, 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 $onAction after callbacks run synchronously, so a connect is enqueued immediately, whereas the layout store delivers its createNode change (and therefore add_node) on a microtask — the same single-microtask timing linkMintPort's severance sweep is written against. A paste or duplicate that creates and connects nodes in one task therefore sends connect before either endpoint's add_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 to w-1/3/420px of layout width but nothing calls useWorkspaceInsetRight, so --workspace-inset-right is never published. Every consumer this PR adds — the dialog.variants.ts size caps and maximized:false centering, viewerDialogContentClass, HUG_CONTENT_CLASS, useShareDialog, and the GlobalToast anchor fallbacks — reads it with a 0px fallback, 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 — openWorkflow now resolves false when the graph load reports failure (workflowService repaints the retained workflow and returns false rather than throwing), but this handler only recovers in catch, so a resolved false skips the selectionRevision bump 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 the false return the same way as the rejection.

Raised by 1 of 8 reviewers (kimi-k3-max edge-case).

}
unsubscribe?.()
unsubscribeStatus?.()
unsubscribe = events.subscribe(onRaw)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟠 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
)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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
)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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).

@christian-byrne

Copy link
Copy Markdown
Contributor

Superseded — closing per Christian's direction.

Full context for agent readers

Program 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
@christian-byrne christian-byrne added cursor-review Trigger multi-model Cursor agent review on this PR and removed cursor-review Trigger multi-model Cursor agent review on this PR labels Sep 2, 2026

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔍 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)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟠 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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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, () => {})

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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
})

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 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).

@huang47 huang47 added the risk:high PR risk grade (advisory shadow check; grader-owned) label Sep 2, 2026 — with ChatGPT Codex Connector
@huang47 huang47 removed the risk:R2 PR risk grade (advisory shadow check; grader-owned) label Sep 2, 2026

@christian-byrne christian-byrne left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@christian-byrne

Copy link
Copy Markdown
Contributor

This slice is reference-only. Accepted work is routed to #17324.

Full context for agent readers

Per 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.

Decision record.

@DrJKL DrJKL added agent Comfy Agent product, integration, tests or product documentation agent-session Agent sessions, history, turn lifecycle or workflow binding agent-test-unit Touches Agent-related unit/component tests or their support agent-ui Agent panel, composer, transcript or other user-interface components labels Sep 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent Comfy Agent product, integration, tests or product documentation agent-session Agent sessions, history, turn lifecycle or workflow binding agent-test-unit Touches Agent-related unit/component tests or their support agent-ui Agent panel, composer, transcript or other user-interface components cursor-review Trigger multi-model Cursor agent review on this PR risk:high PR risk grade (advisory shadow check; grader-owned)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants