Repository navigation
test(agent): reserve active workflow coverage for slice 04 - #16226
christian-byrne wants to merge 73 commits into
Conversation
Lands the agent shell dark behind the existing PostHog flag agent-in-app-experience: the gate wiring (extension setup syncing the flag into the panel store), the Ask Comfy Agent topbar entry button, a stub docked panel mounted in graph and linear views, and the flag-off E2E proving no agent surface renders while the flag is off. The stub intentionally omits what later slices own: engagement telemetry and detection, panel resize and maximize, the workspace inset, selection-driven chrome hiding, and the full panel content. File paths match the feature branch so later slices replace stub content in place.
Rapid or overlapping workflow opens, closes, and subgraph hash navigations could interleave: a slower earlier load could overwrite a newer selection, closing a workflow could re-activate it, and stale hash navigations could move the canvas after a newer one. Workflow loads now run through a serialized queue with per-path pending tracking and re-entrant close accounting; hash/graph synchronization carries navigation intent ids so only the newest intent can write the route or move the canvas. Test-led split from the agent feature branch: the added service and navigation-store tests pin the contract - 13 of them fail against the previous implementation - and only non-agent hunks are extracted (the new extension load hooks stay on the feature branch with their consumer).
The full-suite baseline caught main's navigateToHash suite failing against the extracted intent-id signature: the feature branch had extended that suite (+557) plus app.test.ts's intent-forwarding case, and the initial extraction missed both. Both are taken now; the app.test.ts case covering the excluded extension load hooks stays on the feature branch with its subject.
Eight-hat review round on the shell PR; the convergent findings: - Register the gate extension in the cloud block, where the PostHog flag actually exists and the SDK is initialized - the misplaced !isCloud registration made the panel unreachable in every shipped build, failed the cloud E2E job, and leaked posthog-js into the OSS dist scan. - Force-enable dev builds BEFORE the SDK import so a blocked chunk cannot take local development down, and add a bounded retry that re-takes the flag subscription when extension setup wins the race against posthog initialization (pre-init subscriptions are dead). The gate marks a body dataset when settled so the flag-off E2E asserts after gating actually ran, anchored by the tab-bar container being visible. - Restructure LinearView like the canvas overlay (row root + column wrapper) so the docked panel is a right-hand sibling instead of stacking below the workspace; pinned by a placement test. - Replace the entry chip's fixed ink-700 fill with a semantic surface token (the fixed hex under a theme-flipping foreground computed 1.11:1 in light themes) and add aria-pressed. - Rebuild the E2E boot mocks on the shared mockCloudBoot helper instead of a hand-rolled route fork. - Trim agentTheme.css to the four consumed tokens (the trimmed rest returns with its consumers and keyframes in later slices), drop the width ref and dead guards from the store, drop the dead shell testid and alias click handler, and merge the async component into the setup block with a complementary landmark role. - New gate composition tests (flag on/off/flip, init race, blocked SDK), a close-button test for the panel root, a legacy-tab-bar gating case, and a real enable/disable transition in the store persistence test.
The cloud E2E run proved the registration fix end to end (the flag-on test passed against the production build) but the flag-off spec timed out awaiting the settle marker: posthog drops false-valued bootstrap flags, so isFeatureEnabled legitimately stays undefined forever when the flag is off and settle only arrived at retry exhaustion (~30s). The retry budget only needs to cover telemetry's init window, so it shrinks to ~5s worst case, exhaustion being the settled fail-closed state, and the spec awaits settle with an explicit window.
Round-2 panel residuals on the gate: readiness now settles on an observed flags delivery OR a definite flag read, the resolved path no longer stacks a second subscription, and the exhausted path re-takes the subscription against the by-now live instance before settling - so a flag that first appears mid-session still propagates instead of waiting for a reload. The unit mock now models the off state the way the real SDK reports it (undefined, never false) and pins the exhausted-then-arrives path. Also: the close button reuses g.close instead of minting a duplicate key, and the store drops the consumer-less open().
…delivery Round-2 panels caught the rework's own regression with the SDK source as receipt: uninitialized posthog invokes the onFeatureFlags callback synchronously with errorsLoading and registers nothing, so the delivered signal fired against a dead subscription and pinned the panel off for the session - the exact race the retry defends. The flag source now filters error-context callbacks before they reach the listener, the unit double models the real pre-init contract (fires once, registers nothing, undefined flags) and the race test asserts a live subscription exists after recovery. The retry constants are exported so tests pace off the real values, the settle window fits inside the cloud project's test timeout with actual headroom, and the E2E mocks drop a hand-rolled auth-token route that shadowed the shared workspace mint.
Eight-hat review round; the convergent findings: - Pass suppressWorkflowReset=false at the two import call sites (importA1111, loadApiJson) - they reset to root with no later workflow-load hash republish, so the armed suppression left the URL on a destroyed subgraph id; pinned by new app tests covering both branches of the clean flag. - Capture the closing workflow's path once at closeWorkflow entry: a rename mid-close mutates workflow.path in place, and the live re-read in the finally would strand a phantom closingWorkflowCounts entry that silently no-ops every future open of that path. - Restore main's last-workflow fallback for an inactive close: the sole open workflow closing while inactive now still creates the default workflow. - Log queued-load failures inside the serialization chain: attaching the internal handler marks the caller's promise handled, which had silenced fire-and-forget failures. - Test hardening: a module-state reset hook with per-test leak assertions, the active-workflow no-op guard pinned from both sides, a reopen-after-close-settles case, the misleadingly named clean-flag test renamed, and a shadowed parameter renamed.
Tree-shaking: the cloud extension block now gates on the literal __DISTRIBUTION__ comparison - the cross-module isCloud const does not dead-code-eliminate, so the gate's posthog-js import was shipping into OSS and desktop bundles (measured +289KB; the localhost build now scans clean and the vendor chunk returns to baseline). The gate's retry/re-take machinery is deleted: the shipped posthog bundle constructs its featureFlags extension in the constructor, so a pre-init subscription registers and survives init() (probe-verified); what remains is the errorsLoading filter, a settle timeout for the no-token path, and a dev force-enable that now honours the ff: localStorage override in both directions. The gate's settle signal moved off document.body onto a store ref bound as a data attribute on the tab-bar actions container, and its constants moved out of extensions/core so nothing new lands on the window.comfyAPI surface. Layout and a11y: the dock width is a proportional cap (min(420px, 33%)) so narrow viewports and the linear arrange panels can no longer be clipped dead; the panel title is a real heading the landmark references via aria-labelledby; borders unify on interface-stroke and the four-token alias theme file is deleted in favour of design-system tokens. Structure: the extension tree flattens to the manager exemplar's shape (stores/, utils/, components/agent/), and the E2E fixture moves to fixtures/ and drives a raw page like the cloud siblings - with the assets mock typed against ListAssetsResponse and the posthog ingest host routed so CI emits no live third-party traffic. Tests: real-contract gate coverage replaces the mock-manufactured race tests, dev force-enable and blocked-import paths are pinned, aria-pressed and the settle attribute are asserted, the graph-side mount invariants are pinned, and the hollow store case is replaced with a writeDefaults pin.
- key the closing-workflow registry by raw workflow object identity - queue default/blank/duplicate loads through the same load queue - bound the close-drain and skip it when no workflow is open - release a failed workflow-load navigation intent and restore the hash - move the workflow-load hash publish into loadGraphData's finally - pin the close-race orderings and the intent release in unit tests
- new-surface mutation battery left this guard undiscriminated: the existing replacement test's interleaving empties the closing window before the shift loop runs - hold the neighbor's close inside the store call so it is still open AND registered at decision time, then assert the fallback lands on the survivor and never the closing neighbor
- a blocked posthog import only reached console.error; it now also calls reportError with the stable agent_flag_gate_load_failure type, so the failure is queryable in Sentry and RUM - fail-closed settling and the dev force-enable are unchanged and both paths pin the report in the gate tests
- swap the store test onto createTestingPinia({stubActions:false})
per the repo's testing-pinia convention
- pin that disabling the flag mid-session never wipes the stored
open preference
- give the async panel root a Suspense fallback so the dock frame
never flashes empty chrome
…w nits - the nav recovery catch and the queued-load catch now also call reportError with stable types (workflow_navigation_failure, workflow_load_failure), keeping each site's redirect and queue-continue behavior - pin that a stale workflow-load publish reapplies the latest graph intent and clears the pending reset suppression (the finally publish is what prevents the suppression leak on a failed load) - detect the default load by its payload, not a missing argument
The Aug-12 review's one Request-Changes gap, still live: closeWorkflow deleted the draft at the top of the try, so a replacement load that fails (which now rethrows) left the tab open with its draft already gone. The draft is removed only after the store close is real, and the regression pin asserts a failed replacement keeps both the tab and the draft.
… source Two comment anchors naming which coordination primitives the ECS per-document milestone deletes and which survive, so the supersession is greppable from the code as well as the decision log and PR body.
Same treatment the crdt files got: every multi-line justification block drops to the one invariant the code cannot show.
A real configure failure is caught inside loadGraphData (dialog, then resolve), so the close path never saw it and deleted the draft of a tab that stayed open over a never-painted graph. loadGraphData now returns an explicit outcome; openWorkflow and loadDefaultWorkflow thread it; closeWorkflow aborts on an explicit failure report through its existing not-closed contract, releasing the load's navigation intent and skipping warnings for a graph that never painted. The regression tests drive the real failure shape: rootGraph.configure throwing, not a mocked rejection.
The docked panel's complementary landmark lost its accessible name while the async panel body loaded; the Suspense fallback now carries a visually-hidden agent-panel-title heading with the same translated string, covered in loading and resolved states. The dock-siblinghood test now mounts the splitter overlay and asserts the rendered structure instead of pinning source text; the linear-mode guard stays a source pin because GraphCanvas cannot mount in the unit environment. The dock width moves from an arbitrary min() to w-1/3 max-w-[420px].
A rejected AgentPanelRoot load left the Suspense fallback up forever with nothing reported. The dock now acts as an error boundary: the failure reaches reportError under agent_panel_load_failure and the panel renders a localized error state that keeps the landmark named. Also drops a non-null assertion in the mount test for optional chaining.
OSS builds now emit no agent chunk and carry no agent code: the dock mounts and tab-bar button sit behind the distribution literal (new useAgentDockMount seam), and the flag gate follows the initTelemetry idiom - the guard lives inside the retained function with every agent module imported dynamically past it, so the dead remainder and its import edges fold away, taking posthog-js with them. Cloud builds inline the gate into the core graph instead of fetching a separate extension chunk, and the panel body chunks load only once the gate enables and the panel opens. Verified by dist scans of both distributions.
The follower doc, wire schema and frame client, mint ports, litegraph mutator and semantic projector, layout follower bridge, op envelope and sender, schema guard, and the dev panel - all flag-gated and inert with no consumer in this slice (activation arrives with the agent stack). Carries the beforeLoadGraph/afterLoadGraph extension hooks, the layoutStore withActor scope, graph traversal support, the four transport prompt-error registrations with their locale entries, the comfy-multi-player dependency with its license-scan exclusion, ADR-0020 and the follower boundary check. Transitional knip entries mark the tree until slices 07+ import it.
…heet - rename ADR 0020 -> 0024 (main already carries 0020-0023), fix its H1, update all references, add the missing README index row - correct the license-exclusion comment: the pinned package declares GPL-3.0-only and ships a LICENSE file - genericize RUN-CLOUD-E2E.md (no internal hosts or names) and note the follower has no mount site until the agent-panel slice - install __agentCrdtPoc only under import.meta.env.DEV - update stale PoC comments; document both load hooks in docs/extensions/core.md including the configure-failure asymmetry
- port the child's graph-load hook test and pin once-each-in-order - pin afterLoadGraph skipped when graph configure fails - cover the four agent prompt-error types in the resolver suite - document beforeLoadGraph/afterLoadGraph pairing on ComfyExtension - dedupe findSubgraphPathById/findSubgraphNodePathById via a shared walk - reject async callbacks in layoutStore.withActor, with a pinning test - exercise the traversal walker's malformed-subgraph guard
- remove the comfy-multi-player license-scan exclusion: the pinned package declares GPL-3.0-only (allowlisted), and keeping the check live guards future pin bumps of a git-ref dependency - render CrdtDevPanel only in dev builds; knip tracks it via ignore instead of entry so unused-export reporting stays live for the tree - reword the ADR and boundary-check lines that asserted an env gate that does not exist on this branch
- correct the afterLoadGraph JSDoc: neither after-hook fires on a configure failure; brackets reset at the next beforeLoadGraph and close on afterConfigureGraph (superset of this hook's cases) - pin the full four-hook load order in the app suite - widen withActor's guard to thenables, report through the assert seam, neutralize the orphaned rejection, and pin actor restoration
- dev panel: init open state and start the poll interval only in dev builds (the render gate alone left prod lifecycle effects running) - symmetric DEV gate on the console-helper teardown delete - ADR: drop the dev-rendered claim, name the stopgap product-flag-gated, future-tense the mount statement - run sheet: point Verify at the dev panel's real testid
…ooks - the guard asserts, not throws: DEV throws, production reports and returns the thenable - say so on the method - the configure-fail test now pins that afterConfigureGraph is also skipped, completing the documented two-hook promise
|
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: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Comment |
🎭 Playwright: ❌ 1884 passed, 1 failed · 2 flaky❌ Failed Tests📊 Browser Reports
📦 Bundle Size
⚡ Performance Report
Absolute values
Raw data{
"timestamp": "2026-08-29T10:04:26.297Z",
"gitSha": "ee0eee7c478029b070ffda545338dac906b3ddb4",
"branch": "christian-byrne/reserve-qa-slice04",
"measurements": [
{
"name": "canvas-idle",
"durationMs": 2099.5489999999677,
"styleRecalcs": 8,
"styleRecalcDurationMs": 11.587,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 604.84,
"heapDeltaBytes": 11460524,
"heapUsedBytes": 79550672,
"domNodes": -278,
"jsHeapTotalBytes": 4710400,
"scriptDurationMs": 8.453,
"eventListeners": -157,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "canvas-idle",
"durationMs": 2026.2559999999894,
"styleRecalcs": 8,
"styleRecalcDurationMs": 8.394,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 487.634,
"heapDeltaBytes": -11473152,
"heapUsedBytes": 56682636,
"domNodes": -282,
"jsHeapTotalBytes": 5234688,
"scriptDurationMs": 8.047000000000002,
"eventListeners": -155,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "canvas-mouse-sweep",
"durationMs": 1905.7549999999992,
"styleRecalcs": 79,
"styleRecalcDurationMs": 38.401,
"layouts": 14,
"layoutDurationMs": 3.9259999999999997,
"taskDurationMs": 896.7610000000002,
"heapDeltaBytes": 5334364,
"heapUsedBytes": 68466784,
"domNodes": -282,
"jsHeapTotalBytes": 5758976,
"scriptDurationMs": 170.278,
"eventListeners": -185,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.699999999999818
},
{
"name": "canvas-mouse-sweep",
"durationMs": 1868.3899999999767,
"styleRecalcs": 77,
"styleRecalcDurationMs": 36.668000000000006,
"layouts": 14,
"layoutDurationMs": 3.4280000000000004,
"taskDurationMs": 894.494,
"heapDeltaBytes": -9696456,
"heapUsedBytes": 59381972,
"domNodes": -279,
"jsHeapTotalBytes": 4972544,
"scriptDurationMs": 154.91500000000002,
"eventListeners": -155,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "canvas-zoom-sweep",
"durationMs": 1681.869000000006,
"styleRecalcs": 31,
"styleRecalcDurationMs": 17.538999999999998,
"layouts": 6,
"layoutDurationMs": 0.8669999999999999,
"taskDurationMs": 371.926,
"heapDeltaBytes": 4422188,
"heapUsedBytes": 73041136,
"domNodes": 76,
"jsHeapTotalBytes": 5242880,
"scriptDurationMs": 11.148000000000001,
"eventListeners": 19,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.699999999999818
},
{
"name": "canvas-zoom-sweep",
"durationMs": 1730.485999999928,
"styleRecalcs": 30,
"styleRecalcDurationMs": 18.781000000000002,
"layouts": 6,
"layoutDurationMs": 0.7490000000000001,
"taskDurationMs": 404.35200000000003,
"heapDeltaBytes": 4284724,
"heapUsedBytes": 73092216,
"domNodes": 76,
"jsHeapTotalBytes": 5767168,
"scriptDurationMs": 13.890000000000002,
"eventListeners": 19,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333335,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "dom-widget-clipping",
"durationMs": 647.5770000000125,
"styleRecalcs": 11,
"styleRecalcDurationMs": 8.683,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 461.08399999999995,
"heapDeltaBytes": -6924480,
"heapUsedBytes": 62140436,
"domNodes": 18,
"jsHeapTotalBytes": 6029312,
"scriptDurationMs": 166.603,
"eventListeners": 0,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333335,
"p95FrameDurationMs": 16.699999999999818
},
{
"name": "dom-widget-clipping",
"durationMs": 643.8930000000482,
"styleRecalcs": 10,
"styleRecalcDurationMs": 6.6499999999999995,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 443.70500000000004,
"heapDeltaBytes": 18477460,
"heapUsedBytes": 82232004,
"domNodes": 16,
"jsHeapTotalBytes": 5505024,
"scriptDurationMs": 159.749,
"eventListeners": 2,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "large-graph-idle",
"durationMs": 2078.9530000000127,
"styleRecalcs": 5,
"styleRecalcDurationMs": 6.319999999999999,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 650.5780000000001,
"heapDeltaBytes": 13423364,
"heapUsedBytes": 87976720,
"domNodes": -269,
"jsHeapTotalBytes": -1880064,
"scriptDurationMs": 46.531000000000006,
"eventListeners": -183,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66999999999998,
"p95FrameDurationMs": 16.699999999999818
},
{
"name": "large-graph-idle",
"durationMs": 2037.6509999999826,
"styleRecalcs": 6,
"styleRecalcDurationMs": 5.469999999999999,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 596.4029999999999,
"heapDeltaBytes": -6686216,
"heapUsedBytes": 88459544,
"domNodes": -267,
"jsHeapTotalBytes": -1581056,
"scriptDurationMs": 40.535000000000004,
"eventListeners": -153,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "large-graph-pan",
"durationMs": 2626.150999999993,
"styleRecalcs": 62,
"styleRecalcDurationMs": 7.897999999999999,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 1788.4540000000002,
"heapDeltaBytes": 19918116,
"heapUsedBytes": 85692212,
"domNodes": 0,
"jsHeapTotalBytes": 749568,
"scriptDurationMs": 940.3670000000001,
"eventListeners": 6,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "large-graph-pan",
"durationMs": 2325.666999999953,
"styleRecalcs": 66,
"styleRecalcDurationMs": 11.498000000000001,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 1682.738,
"heapDeltaBytes": 19867940,
"heapUsedBytes": 85363768,
"domNodes": -272,
"jsHeapTotalBytes": 225280,
"scriptDurationMs": 873.962,
"eventListeners": 6,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "large-graph-zoom",
"durationMs": 3834.442000000024,
"styleRecalcs": 62,
"styleRecalcDurationMs": 12.194999999999997,
"layouts": 60,
"layoutDurationMs": 7.565,
"taskDurationMs": 1862.7849999999996,
"heapDeltaBytes": 16075600,
"heapUsedBytes": 81543492,
"domNodes": -278,
"jsHeapTotalBytes": 0,
"scriptDurationMs": 859.069,
"eventListeners": -181,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "large-graph-zoom",
"durationMs": 3566.6989999999714,
"styleRecalcs": 60,
"styleRecalcDurationMs": 9.728,
"layouts": 60,
"layoutDurationMs": 7.182,
"taskDurationMs": 1724.73,
"heapDeltaBytes": 12868184,
"heapUsedBytes": 80715064,
"domNodes": 0,
"jsHeapTotalBytes": 0,
"scriptDurationMs": 816.9269999999999,
"eventListeners": 8,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "legacy-node-drag",
"durationMs": 3127.5959999999827,
"styleRecalcs": 40,
"styleRecalcDurationMs": 5.099000000000003,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 1959.5130000000004,
"heapDeltaBytes": 18181192,
"heapUsedBytes": 85964600,
"domNodes": 0,
"jsHeapTotalBytes": 417792,
"scriptDurationMs": 978.8110000000001,
"eventListeners": 188,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666696,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "legacy-node-drag",
"durationMs": 3172.602999999981,
"styleRecalcs": 41,
"styleRecalcDurationMs": 5.787999999999998,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 2000.107,
"heapDeltaBytes": 19437172,
"heapUsedBytes": 86236548,
"domNodes": -276,
"jsHeapTotalBytes": 417792,
"scriptDurationMs": 997.6389999999999,
"eventListeners": 188,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "minimap-idle",
"durationMs": 1999.4570000000067,
"styleRecalcs": 2,
"styleRecalcDurationMs": 1.641,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 561.621,
"heapDeltaBytes": 23734628,
"heapUsedBytes": 89187140,
"domNodes": -274,
"jsHeapTotalBytes": 0,
"scriptDurationMs": 35.83800000000001,
"eventListeners": 6,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "minimap-idle",
"durationMs": 2071.611999999959,
"styleRecalcs": 3,
"styleRecalcDurationMs": 5.452999999999999,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 611.5730000000001,
"heapDeltaBytes": 12488760,
"heapUsedBytes": 88167316,
"domNodes": -274,
"jsHeapTotalBytes": -1880064,
"scriptDurationMs": 38.766,
"eventListeners": -185,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333335,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "subgraph-dom-widget-clipping",
"durationMs": 606.441000000018,
"styleRecalcs": 46,
"styleRecalcDurationMs": 10.682,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 430.73599999999993,
"heapDeltaBytes": 14561780,
"heapUsedBytes": 78767248,
"domNodes": 18,
"jsHeapTotalBytes": 4980736,
"scriptDurationMs": 145.55599999999998,
"eventListeners": 8,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "subgraph-dom-widget-clipping",
"durationMs": 589.2829999999094,
"styleRecalcs": 47,
"styleRecalcDurationMs": 11.412,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 408.52299999999997,
"heapDeltaBytes": 14827388,
"heapUsedBytes": 85941712,
"domNodes": 20,
"jsHeapTotalBytes": 5505024,
"scriptDurationMs": 143.458,
"eventListeners": 6,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "subgraph-idle",
"durationMs": 2006.7040000000134,
"styleRecalcs": 11,
"styleRecalcDurationMs": 9.790999999999999,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 481.37699999999995,
"heapDeltaBytes": -4246004,
"heapUsedBytes": 60956800,
"domNodes": -294,
"jsHeapTotalBytes": 4448256,
"scriptDurationMs": 6.855,
"eventListeners": -201,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333335,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "subgraph-idle",
"durationMs": 2038.9129999999795,
"styleRecalcs": 10,
"styleRecalcDurationMs": 9.544,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 497.37800000000004,
"heapDeltaBytes": 1701928,
"heapUsedBytes": 72952448,
"domNodes": -295,
"jsHeapTotalBytes": 4972544,
"scriptDurationMs": 10.822999999999999,
"eventListeners": -231,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.699999999999818
},
{
"name": "subgraph-mouse-sweep",
"durationMs": 1719.1779999999994,
"styleRecalcs": 77,
"styleRecalcDurationMs": 37.757,
"layouts": 18,
"layoutDurationMs": 4.1499999999999995,
"taskDurationMs": 812.0970000000001,
"heapDeltaBytes": -12058628,
"heapUsedBytes": 59165848,
"domNodes": -297,
"jsHeapTotalBytes": 6021120,
"scriptDurationMs": 108.878,
"eventListeners": -201,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "subgraph-mouse-sweep",
"durationMs": 1739.6250000000464,
"styleRecalcs": 78,
"styleRecalcDurationMs": 41.825,
"layouts": 18,
"layoutDurationMs": 5.367999999999999,
"taskDurationMs": 895.793,
"heapDeltaBytes": 5777856,
"heapUsedBytes": 70987228,
"domNodes": -294,
"jsHeapTotalBytes": 5758976,
"scriptDurationMs": 120.862,
"eventListeners": -233,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333335,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "subgraph-transition-enter",
"durationMs": 1384.0719999999465,
"styleRecalcs": 18,
"styleRecalcDurationMs": 32.266000000000005,
"layouts": 13,
"layoutDurationMs": 14.296,
"taskDurationMs": 930.6859999999999,
"heapDeltaBytes": -7500172,
"heapUsedBytes": 88281244,
"domNodes": 13671,
"jsHeapTotalBytes": 10485760,
"scriptDurationMs": 31.42,
"eventListeners": 2381,
"totalBlockingTimeMs": 137,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "viewport-pan-sweep",
"durationMs": 8854.891999999949,
"styleRecalcs": 246,
"styleRecalcDurationMs": 35.42,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 6236.457,
"heapDeltaBytes": -5018308,
"heapUsedBytes": 90813380,
"domNodes": -271,
"jsHeapTotalBytes": -569344,
"scriptDurationMs": 2940.481,
"eventListeners": -137,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.669999999999952,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "viewport-pan-sweep",
"durationMs": 8597.037999999997,
"styleRecalcs": 249,
"styleRecalcDurationMs": 36.024,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 6026.502,
"heapDeltaBytes": -5437404,
"heapUsedBytes": 90727756,
"domNodes": -265,
"jsHeapTotalBytes": 217088,
"scriptDurationMs": 2926.927,
"eventListeners": -137,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "vue-large-graph-idle",
"durationMs": 17887.25400000004,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 17101.533999999996,
"heapDeltaBytes": -29411052,
"heapUsedBytes": 179388092,
"domNodes": -6548,
"jsHeapTotalBytes": -438272,
"scriptDurationMs": 349.45500000000004,
"eventListeners": -7475,
"totalBlockingTimeMs": 0,
"frameDurationMs": 18.890000000000025,
"p95FrameDurationMs": 16.80000000000291
},
{
"name": "vue-large-graph-idle",
"durationMs": 17174.762999999984,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 16691.265000000003,
"heapDeltaBytes": -33129132,
"heapUsedBytes": 179269132,
"domNodes": -6548,
"jsHeapTotalBytes": 8667136,
"scriptDurationMs": 386.564,
"eventListeners": -7473,
"totalBlockingTimeMs": 12,
"frameDurationMs": 17.776666666666642,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "vue-large-graph-pan",
"durationMs": 21643.69099999999,
"styleRecalcs": 177,
"styleRecalcDurationMs": 19.399,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 21275.468,
"heapDeltaBytes": -30459740,
"heapUsedBytes": 179318940,
"domNodes": -6548,
"jsHeapTotalBytes": 1675264,
"scriptDurationMs": 1000.1340000000001,
"eventListeners": -7469,
"totalBlockingTimeMs": 224,
"frameDurationMs": 17.780000000000047,
"p95FrameDurationMs": 16.80000000000291
},
{
"name": "vue-large-graph-pan",
"durationMs": 21708.421000000046,
"styleRecalcs": 174,
"styleRecalcDurationMs": 19.640000000000047,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 21393.565000000002,
"heapDeltaBytes": -36693284,
"heapUsedBytes": 166923712,
"domNodes": -6548,
"jsHeapTotalBytes": -6975488,
"scriptDurationMs": 1035.801,
"eventListeners": -7469,
"totalBlockingTimeMs": 31,
"frameDurationMs": 17.77333333333336,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "workflow-execution",
"durationMs": 481.1329999999998,
"styleRecalcs": 19,
"styleRecalcDurationMs": 27.653000000000002,
"layouts": 3,
"layoutDurationMs": 1.5430000000000001,
"taskDurationMs": 137.23600000000002,
"heapDeltaBytes": 5435992,
"heapUsedBytes": 68353664,
"domNodes": 150,
"jsHeapTotalBytes": 524288,
"scriptDurationMs": 16.043000000000003,
"eventListeners": 99,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "workflow-execution",
"durationMs": 459.995000000049,
"styleRecalcs": 13,
"styleRecalcDurationMs": 21.63,
"layouts": 3,
"layoutDurationMs": 0.6170000000000001,
"taskDurationMs": 105.64099999999999,
"heapDeltaBytes": 5065708,
"heapUsedBytes": 71536124,
"domNodes": 119,
"jsHeapTotalBytes": 262144,
"scriptDurationMs": 8.786999999999999,
"eventListeners": 97,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
}
]
} |
Codecov Report✅ All modified and coverable lines are covered by tests. @@ Coverage Diff @@
## nathaniel/agent-v1/04-workflowtabs-pair #16226 +/- ##
===========================================================================
+ Coverage 82.76% 82.77% +0.01%
===========================================================================
Files 1970 1970
Lines 113835 113836 +1
Branches 33765 33765
===========================================================================
+ Hits 94215 94231 +16
+ Misses 19285 19268 -17
- Partials 335 337 +2
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
🔍 Cursor Review — Consolidated panel
Triggered by @christian-byrne.
Found 8 finding(s).
| Severity | Count |
|---|---|
| 🟠 High | 1 |
| 🟡 Medium | 5 |
| 🟢 Low | 2 |
Panel: 8/8 reviewers contributed findings.
| const names = await topbar.getTabNames() | ||
| await topbar.getTab(0).click() | ||
|
|
||
| await expect.poll(() => topbar.getActiveTabName()).toContain(names[0]) |
There was a problem hiding this comment.
🟠 High — This assertion cannot fail, so the test does not guard the regression it is named for: names[0] is 'Unsaved Workflow', which is a substring of 'Unsaved Workflow (2)', and toContain on a string is a substring check — so if clicking tab 0 never switches the active workflow, the still-active tab 1 name satisfies it. The pre-existing "Switching tabs changes active workflow" test disambiguates with an extra not.toContainText('(2)'); assert the exact name here (.toBe(names[0])) or add the same negative check. Raised by 6 of 8 reviewers (claude-opus-5-thinking-max adversarial, claude-opus-5-thinking-max edge-case, kimi-k3-max adversarial, kimi-k3-max edge-case, gpt-5.6-sol-max edge-case, gemini-3.1-pro edge-case).
| }) => { | ||
| const topbar = comfyPage.menu.topbar | ||
| await topbar.newWorkflowButton.click() | ||
| const names = await topbar.getTabNames() |
There was a problem hiding this comment.
🟡 Medium — getTabNames() uses allInnerTexts(), which does not auto-wait, and it is read immediately after newWorkflowButton.click(), so it can snapshot the list before the second tab renders — leaving a one-element names and making the following getTab(0).click() a no-op on the already-active tab. The same missing barrier precedes the indexed clicks at lines 51 and 62-63 (where closing a tab can also interleave with the third workflow's creation); add the await expect.poll(() => topbar.getTabNames()).toHaveLength(n) guard the first test uses on line 22. Raised by 5 of 8 reviewers (claude-opus-5-thinking-max adversarial, claude-opus-5-thinking-max edge-case, kimi-k3-max adversarial, kimi-k3-max edge-case, gemini-3.1-pro edge-case).
| const topbar = comfyPage.menu.topbar | ||
| await topbar.newWorkflowButton.click() | ||
| await topbar.getTab(1).click() | ||
| const activeName = await topbar.getActiveTabName() |
There was a problem hiding this comment.
🟡 Medium — getActiveTabName() is a bare innerText() read taken immediately after the click, and its result becomes the needle of toContain on line 67 — so a stale capture silently weakens the test instead of failing it. A .p-togglebutton-checked element already exists before the switch settles, so this can capture 'Unsaved Workflow', which is a substring of every default tab name, after which the post-reload assertion passes no matter which tab was restored. Compare against a literal expected name, or poll the capture with toBe before reloading. Raised by 5 of 8 reviewers (claude-opus-5-thinking-max adversarial, claude-opus-5-thinking-max edge-case, kimi-k3-max adversarial, kimi-k3-max edge-case, gemini-3.1-pro edge-case).
| }) => { | ||
| const topbar = comfyPage.menu.topbar | ||
| await topbar.newWorkflowButton.click() | ||
| await topbar.getTab(1).click() |
There was a problem hiding this comment.
🟡 Medium — This click is a no-op, so the reload test never crosses a tab boundary: creating a blank workflow already makes it the active tab at index 1, and onWorkflowChange in WorkflowTabs.vue early-returns when the clicked option equals the current selection. The test therefore only verifies that the newest/auto-activated tab survives a reload, which a regression that ignores the persisted active identity and just restores the last tab would also pass. Click getTab(0) instead so a user-selected identity is what gets reloaded. Raised by 3 of 8 reviewers (gpt-5.6-sol-max edge-case, claude-opus-5-thinking-max edge-case, claude-opus-5-thinking-max adversarial).
| await topbar.getTab(1).click() | ||
| const activeName = await topbar.getActiveTabName() | ||
|
|
||
| await comfyPage.workflow.reloadAndWaitForApp() |
There was a problem hiding this comment.
🟡 Medium — The reload is issued without first awaiting the debounced tab/draft persistence write, so it can race the write and restore a stale tab set for reasons unrelated to tab identity. Other reload specs in this repo gate on persistence first (comfyPage.workflow.waitForDraftPersisted() / waitForDraftIndexUpdatedSince(), or waitForWorkflowTabState in workflowPersistence.spec.ts) — either confirm reloadAndWaitForApp() already covers that or add the barrier. Raised by 2 of 8 reviewers (claude-opus-5-thinking-max adversarial, claude-opus-5-thinking-max edge-case).
| await topbar.closeWorkflowTab('Unsaved Workflow (2)') | ||
|
|
||
| await expect.poll(() => topbar.getTabNames()).toHaveLength(2) | ||
| await expect(topbar.getActiveTab()).toBeVisible() |
There was a problem hiding this comment.
🟡 Medium — toBeVisible() only checks that some tab is checked, so the neighbor-selection contract in the test name is not actually covered — activating an unrelated or non-adjacent workflow after the close still passes. Assert the resulting active tab's identity (e.g. toContainText('Unsaved Workflow (3)')). Raised by 3 of 8 reviewers (claude-opus-5-thinking-max edge-case, claude-opus-5-thinking-max adversarial, kimi-k3-max adversarial).
| await expect.poll(() => topbar.getTabNames()).toHaveLength(3) | ||
|
|
||
| await topbar.getTab(1).click() | ||
| await expect(topbar.getActiveTab()).toHaveAttribute( |
There was a problem hiding this comment.
🟢 Low — This assertion is tautological: getActiveTab() locates by .p-togglebutton-checked, and PrimeVue's ToggleButton derives aria-pressed="true" from that same checked state, so it restates its own selector and adds nothing beyond the toHaveCount(1) check below. Since the test never asserts which workflow is active, a regression where clicking tab 1 activates the wrong workflow passes silently — assert toContainText('Unsaved Workflow (2)') instead. Raised by 3 of 8 reviewers (claude-opus-5-thinking-max adversarial, claude-opus-5-thinking-max edge-case, kimi-k3-max edge-case).
| 'aria-pressed', | ||
| 'true' | ||
| ) | ||
| await expect( |
There was a problem hiding this comment.
🟢 Low — Consider moving this toHaveCount(1) check above the attribute assertion on line 25. getActiveTab() can resolve to multiple elements and toHaveAttribute is strict, so in the exact failure this test targets — two tabs checked at once — line 25 dies with a Playwright strict-mode violation and this clearer count failure is never reported. Raised by 1 of 8 reviewers (claude-opus-5-thinking-max edge-case).
8bd5ad5 to
5fb3fbe
Compare
|
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. |
## Summary Exit node-selection mode whenever the active workflow changes, including while the replacement graph is loading. ## Changes - **What**: Separate active-workflow identity handling from same-workflow graph restoration, and cover the workflow-swap race in component and browser tests. ## Review Focus The active workflow watcher is intentionally unconditional; the graph watcher retains the load guard needed for restoring a selection within one workflow. ## Evidence - Regression proof without the fix: focused component test failed at `isActive` (`expected true to be false`). - `pnpm test:unit src/workbench/extensions/agent/AgentPanelRoot.test.ts` — 114 passed. - `PLAYWRIGHT_TEST_URL=http://localhost:6258 PLAYWRIGHT_SETUP_API_URL=http://localhost:8188 PLAYWRIGHT_LOCAL=1 DISTRIBUTION=cloud DEV_SERVER_COMFYUI_URL=http://localhost:8188 pnpm exec start-server-and-test "pnpm exec vite --port 6258 --strictPort" http-get://localhost:6258 "pnpm exec playwright test browser_tests/tests/agent/agentPanel.spec.ts --project=cloud --timeout=60000 -g 'exits node selection when the active workflow changes'"` — 1 passed. - `pnpm exec oxfmt --check` and targeted ESLint for all three changed files — passed. - `pnpm typecheck` and `pnpm typecheck:browser` — passed. - Pre-push `pnpm knip --cache` — passed. - Dedupe: closed stack-reservation PR Comfy-Org#16226 was inspected and remains superseded; no open main-based PR carries this fix. <!-- authored-by:agent lane-qa-58 -->
Ports the four browser-level tests reserved by closed slice PR #16226 (single commit 063f2b7) onto current main, verbatim: exactly-one-active tab, path-backed active identity after a tab switch, neighbor activation on close, and tab identity across browser reload. All four fixture helpers already exist on main; no production code or fixture changes.
Ports the four browser-level tests reserved by closed slice PR #16226 (single commit 063f2b7) onto current main, verbatim: exactly-one-active tab, path-backed active identity after a tab switch, neighbor activation on close, and tab identity across browser reload. All four fixture helpers already exist on main; no production code or fixture changes.
Ports the four browser-level tests reserved by closed slice PR #16226 (single commit 063f2b7) onto current main, verbatim: exactly-one-active tab, path-backed active identity after a tab switch, neighbor activation on close, and tab identity across browser reload. All four fixture helpers already exist on main; no production code or fixture changes.
Ports the four browser-level tests reserved by closed slice PR #16226 (single commit 063f2b7) onto current main, verbatim: exactly-one-active tab, path-backed active identity after a tab switch, neighbor activation on close, and tab identity across browser reload. All four fixture helpers already exist on main; no production code or fixture changes.
Active workflow-tab E2E coverage reserved for slice 04 exact head
d015c5fc62749f83189e189fa18e16603fd78e22.Full context for agent readers
Splits the slice-04 cases from QA draft #16217 and activates them on the branch that owns the behavior. Covers single active identity, path-backed switching, close-neighbor selection, and reload persistence.
Validation:
git diff --checkpassed. Browser execution was not available in this dependency-free reservation clone.