Repository navigation
slice 13: gated agent runtime integration - #16286
christian-byrne wants to merge 304 commits into
Conversation
Rename the WorkflowUpload fields so the wire contract reads plainly: content -> graph (the prompt is already the top-level content field), and base_version -> last_seen_version (the draft version the client last received; draft_version would have collided with the existing WS event type of that name).
… action bar Draft applies now re-baseline the bound tab's change tracker to the canvas as loaded and clear isModified, on both the in-place and minted-new-tab paths. A minted tab's stored baseline carries an ensureWorkflowId id the canvas never adopts, so the first capture flipped isModified and every following draft_patch raised the conflict dialog with zero user edits. Manual edits still re-arm the dialog. The thumbs up/down + copy row under a completed agent message no longer hides until hover (V0: always display).
Adds the V0 FE metric set through the existing telemetry layer (typed events, optional provider methods, cloud PostHog provider): - app:agent_panel_opened / app:agent_panel_closed with source (topbar_button | close_button | flag_disabled) and open_duration_ms, so open-vs-closed share per session is computable - app:agent_entry_button_clicked (resulting_state) and app:agent_close_button_clicked for the raw clicks - app:agent_message_sent (attachment_count, node_tag_count), app:agent_node_tagged (mention_picker), app:agent_attach_button_clicked - app:agent_workflow_applied (workflow_id, new_tab | existing_tab) for agent-created vs agent-edited workflow attribution - app:agent_message_feedback now carries workflow_id (PM-98) The panel store owns open/close state, so it emits the state events with an idempotency guard (the flag gate re-syncs close on every evaluation). The entry/close click events are kept alongside the state events deliberately: the V0 metrics checklist names them as PM-queryable trackers, though the state events' sources make them derivable. Also hardens autosaveAppliedDraft: the tracker re-baselines with the RAW canvas serialization. A schema-validated baseline would diff against raw captures under strict graphEqual and re-raise the conflict dialog on an unedited canvas; a test pins validateComfyWorkflow to its single loadDraft call so the baseline can never route through the schema.
Adds the V0 FE metric set through the existing telemetry layer (typed events, optional provider methods, cloud PostHog provider): - app:agent_panel_opened / app:agent_panel_closed with source (topbar_button | close_button | flag_disabled) and open_duration_ms, so open-vs-closed share per session is computable - app:agent_entry_button_clicked (resulting_state) and app:agent_close_button_clicked for the raw clicks - app:agent_message_sent (attachment_count, node_tag_count), app:agent_node_tagged (mention_picker), app:agent_attach_button_clicked - app:agent_workflow_applied (workflow_id, new_tab | existing_tab) for agent-created vs agent-edited workflow attribution - app:agent_message_feedback now carries workflow_id (PM-98) The panel store owns open/close state, so it emits the state events with an idempotency guard (the flag gate re-syncs close on every evaluation).
…t regressions - MarkdownStream renders through the shared markdownRendererUtil; the agent copy (and its module-load DOMPurify hook that gave every host anchor target=_blank) is deleted. - The agent event source is now a thin adapter over the api singleton's typed custom-event dispatch: no second socket follower, no re-parse of every /ws frame, no "Unknown message type" throw noise. Zod payload validation and the malformed-event notice stay. - AgentPanelRoot loads via defineAsyncComponent, keeping the flag-gated subtree out of the GraphCanvas chunk. - Prompt-error cards show details only for the agent's own error types; host cards restored to pre-PR behavior, both pinned by tests.
- The agent REST client rides api.fetchApi (Firebase init-wait, auth headers, 401 remint, Comfy-User) instead of a hand-rolled fetch with workspace-token-only auth; zod parsing and AgentApiError stay. - Agent-local Button/Textarea forks replaced by the shared UI kit with variant mappings verified pixel-equivalent through tailwind-merge; dialogs inline reka primitives (the shared kit's entrance animations and sizing cannot be neutralized). ScrollArea/CollapsibleContent wrappers inlined per the sibling idiom. - WorkflowTabs CTA uses the shared Button. - agentTheme.css no longer redefines tw-animate-css collapsible keyframes (they globally retargeted three sharing-dialog consumers). - CodeBlock keeps the framed header + copy but renders plain monospace; the shiki dependency and catalog entry are removed. MarkdownStream tokenizes fences via marked.lexer, fixing the 4-backtick gap.
- Safety UI that nothing drives (ApprovalCard, LockBanner, RevertButton and their AgentPanel plumbing); ConflictDialog stays. - Dead message-part clusters: file/asset rendering and reasoning disclosure that no transport path constructs; the parts union and AgentMessage grouping shrink to text/tool/notice. - Unwired composer pieces (AssetTray, SelectionActionChips, useCloudAssets) with zero non-test importers. - Dead exports (createThread, history.upsert, useAgentFeatureGate fn, hasDraft, onboarding multi-step machinery) - each re-verified for zero production consumers on the current head; parseAgentWsEvent / isAgentEvent kept, they are live imports since the event rework. - Write-only token pipeline, info/warning notice machinery, and the transport's no-op finalize loop removed; finalize/abort merged into one settle().
- 17 locale keys with zero usages removed from en (other locales are lobe-i18n generated and never carried them); error-catalog and design-locked keys kept. - useAttachment strings go through i18n; the 20MB label derives from the named constant (max_upload_size flag exists but has no production consumer, so the constant stays). - A failed thread-list fetch now raises the shared error modal instead of silently showing empty history, with a regression test.
The trim deleted the collapsible keyframes as duplicates of tw-animate-css, but that package defines no collapsible-* keys, so the tool-disclosure animation silently no-opd. Restored under agent-* names: the globally-imported sheet can no longer retarget the host's animate-collapsible-* utilities (undefined on main) in sharing dialogs. Adds the three review-flagged test gaps: indented code stays prose, bare fences label as text, and the oversize-attachment message pins its i18n interpolation.
- ToolCallGroup: streaming auto-open, same-name merge, failure reopen, and the AgentMessage adjacent-merge branch with pluralized header. - WorkflowTabs: the Ask Comfy Agent CTA renders when enabled and toggles the panel (mock rewired ref-backed for storeToRefs). - useAgentSession: non-object and foreign host frames drop silently mid-turn. - MarkdownStream: fence label picks the first info-string word.
The client hardcoded person_profiles: 'identified_only' AFTER the posthog_config spread, silently overriding the server's explicit 'always' (live on /api/features). Under identified_only every event captured before identify() resolves is a person-less anonymous event that never attaches to the user, so early-session events (entry click, panel opened, first message) vanish from person-scoped PostHog views. The hardcode is now a default the server can override; before_send stays locked (PII stripping). Reverses the person_profiles half of the pin added in #12479, test updated accordingly. Also retries the posthog-js dynamic import once: a stale deploy can 404 the chunk, which previously disabled telemetry for the entire session after a single console.error.
The module map caches a failed module resolution, so re-importing the same specifier rejects from cache without refetching; the retry could never succeed. Stale-chunk failures are already handled app-wide by the vite:preloadError listener in App.vue.
The 2MB cap guarded a server limit that does not exist yet and silently skipped uploads for large graphs, which are normal on a video/image platform. The server owns its own limits.
The backend now seeds the thread's draft from the graph the client
sends each turn. Align to its shape and rules:
- The turn POST carries draft: { content: <serialize() save format>,
version: <last seen draft version | null> } (was the inert
workflow/graph/last_seen_version shape).
- Snapshots gate on canvas-non-empty, not workflow_id, so templates,
unsaved tabs, and new tabs seed correctly; skipping an unchanged
canvas stays as the server-blessed optimization.
- A 409 {error, version} means the agent's draft advanced: adopt the
returned version and retry the send once.
- autosaveAppliedDraft only reset the change tracker and isModified, but the tab dot renders whenever a workflow is not persisted, so agent-applied drafts always showed unsaved and lived only in memory - save through workflowService instead: temporary tabs use a silent saveWorkflowAs with a collision-safe filename (no prompt or overwrite dialog), persisted tabs re-save silently - rebind workflow_id to the tab current path in finally so service renames (collision bump, app extension mismatch) and failed saves never strand the binding on a dead path - known limit: host saveWorkflow drift handling can rarely toast or confirm on persisted tabs; reusing the canonical save path there is intentional - tests: failure isolation keeps the applied draft and surfaces no error, an app-mode collision bumps the filename and rebinds, a save that fails after rename still rebinds; binding tests now stub a valid empty threads page
Per the per-file consolidation audit (temp/plans/pr13472-file-consolidation-audit.md): safetyTypes -> ConflictDialog (SFC type export, ActiveTabStrip pattern), agentTranscript + useDraftCanvasApply -> AgentPanelRoot, ThinkingStatus -> AgentMessage, SuggestedPromptChip -> EmptyState, SelectionTagChip -> Composer, SessionBar -> AgentPanel. All moves byte-identical; net -9 files. agentTranscript's test is replaced by a stronger end-to-end copy test asserting the exact clipboard markdown. useDraftCanvasApply's tests were retired as redundant rather than merged: patch-to-canvas firing is covered end-to-end by the draft binding suite, rejection semantics are owned by agentDraftStore.test.ts, and the stop handle was unused API removed by the fold.
…JECT_TOKEN Deployed builds keep reading the token from the backend-injected __CONFIG__ (precedence unchanged); the env fallback only enables event verification from local dev servers, which otherwise have no key and silently queue forever.
- loadThread and newChat fired a server-side cancel for the in-flight
turn; the backend recorded it and the reply was lost ("Stopped
streaming..."). Panel unmount did the same. All implicit cancels are
removed; the explicit Stop button is the only cancel left
- switching away parks the live turn (message + event transport) in a
per-thread registry; events keep accumulating silently and cannot
bleed into the displayed chat; switching back re-attaches the turn
live with no lost text, or renders the finished reply from history
- a done landing during the return fetch keeps the parked entry so the
full reply still renders; overlapping or double-clicked history loads
are generation-gated; socket death and panel close settle parked
turns; remount refreshes a surviving thread from history
- draft patches from a backgrounded thread no longer drive the
displayed canvas (thread guard; version heartbeat unchanged)
- transport ignores events after settle; chat history date buckets
follow a reactive clock across midnight; onboarding coach gains
dialog semantics and Escape to dismiss; dead approval-flow fixtures
removed
Move the cascading rules (keyframes, .agent-shimmer-text, scoped reset) from globally imported agentTheme.css into agentPanel.css, loaded only by the lazy AgentPanelRoot chunk; agentTheme.css keeps the @theme blocks.
Handle agent_active_tab (activate the bound tab or mint, open, and autosave a named temporary tab; concurrent focus events serialize latest-wins), send the open_tabs and current_tab snapshot with each message, persist workflow-tab bindings, and resolve every open saved tab to its Cloud Ingest workflow id (paginated name index refreshed per send, binding fallback, never guesses on ambiguity). Reverse resolution activates existing tabs on switch_tab. Bound tabs send their bound id, unbound tabs adopt via the draft upload - no speculative ids. Draft uploads that 5xx degrade to plain chat and re-arm. Friendly labels for the tab and memory tools.
Extract the docked panel chrome (width container, resize handle, async panel root card) from the splitter overlay and GraphCanvas into DockedAgentPanel, and host it in both GraphCanvas and LinearView. Gate the graph-mode host on !linearMode so exactly one live panel root exists across mode switches; the splitter overlay is agent-agnostic again. FE-1298
Distinguishes the feedback affordance from agent chat next to the Ask Comfy Agent entry, on both the integrated tab bar and the legacy topbar button. FE-1283
Swap the back arrow to a left chevron and rename the tooltip key to backToPreviousChat per the dev-ready design. FE-1291
Persist the open state in localStorage and stop the PostHog flag gate from force-closing on sync, so a slow or transient flag read cannot wipe the stored preference. A rehydrated panel emits an opened event with source restored only once it actually docks, so flag-off users with stale state never produce phantom opens; the now-unused flag_disabled close source is dropped. FE-1284
Take the horizontal edge from the graph splitter panel so toasts no longer sit behind the docked agent panel, while the vertical offset keeps reading the canvas container so nothing shifts for flag-off users. Re-anchor on panel open and resize and on every toast shown, and skip hidden zero-size anchors so app mode keeps the last good position instead of pushing toasts off screen. FE-1287
Add a once-per-browser dismissible banner above the composer telling users the agent modifies the graph but only they can run it, and replace the caption under the composer with the AI-mistakes disclaimer, both with the design's exact copy. No auto-mode state is introduced; running from chat remains a separate open decision. FE-1307
The empty-state chip row spanned the full panel width and overflowed the 640px content column on a maximized panel; constrain it to the same column as the composer. FE-1288
Inserting a suggestion now focuses the textarea and flashes the accent border for a second, restarting on repeat clicks. The highlight carries its own focus-within variant because the insert focuses the field, which would otherwise let the muted focus border out-specify the accent. FE-1327
|
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 |
🎨 Storybook: ✅ Built — View Storybook🎭 Playwright: ❌ 1885 passed, 1 failed · 1 flaky❌ Failed Tests📊 Browser Reports
📦 Bundle Size
⚡ Performance Report
Absolute values
Raw data{
"timestamp": "2026-08-30T09:38:55.904Z",
"gitSha": "f471dc0414474894a81159cca864a113f1a432c0",
"branch": "christian-byrne/slice-13",
"measurements": [
{
"name": "canvas-idle",
"durationMs": 2027.8959999999984,
"styleRecalcs": 6,
"styleRecalcDurationMs": 4.655000000000003,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 446.832,
"heapDeltaBytes": -1318484,
"heapUsedBytes": 67260488,
"domNodes": -284,
"jsHeapTotalBytes": 4710400,
"scriptDurationMs": 8.368,
"eventListeners": -155,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "canvas-idle",
"durationMs": 1990.0460000000066,
"styleRecalcs": 9,
"styleRecalcDurationMs": 6.133999999999999,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 388.892,
"heapDeltaBytes": 13221780,
"heapUsedBytes": 82107580,
"domNodes": -283,
"jsHeapTotalBytes": 4710400,
"scriptDurationMs": 7.161999999999998,
"eventListeners": -155,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "canvas-mouse-sweep",
"durationMs": 1709.969000000001,
"styleRecalcs": 74,
"styleRecalcDurationMs": 29.296,
"layouts": 14,
"layoutDurationMs": 3.888,
"taskDurationMs": 715.56,
"heapDeltaBytes": -9194612,
"heapUsedBytes": 59998916,
"domNodes": -280,
"jsHeapTotalBytes": 5758976,
"scriptDurationMs": 115.78399999999999,
"eventListeners": -155,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.699999999999818
},
{
"name": "canvas-mouse-sweep",
"durationMs": 1757.975999999985,
"styleRecalcs": 73,
"styleRecalcDurationMs": 30.400999999999996,
"layouts": 14,
"layoutDurationMs": 3.9890000000000003,
"taskDurationMs": 713.068,
"heapDeltaBytes": 4299236,
"heapUsedBytes": 73525336,
"domNodes": -281,
"jsHeapTotalBytes": 4972544,
"scriptDurationMs": 117.06200000000001,
"eventListeners": -185,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "canvas-zoom-sweep",
"durationMs": 1662.9140000000007,
"styleRecalcs": 29,
"styleRecalcDurationMs": 12.794,
"layouts": 6,
"layoutDurationMs": 0.998,
"taskDurationMs": 284.779,
"heapDeltaBytes": 4420568,
"heapUsedBytes": 73513656,
"domNodes": 75,
"jsHeapTotalBytes": 5767168,
"scriptDurationMs": 9.111999999999998,
"eventListeners": 19,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.699999999999818
},
{
"name": "canvas-zoom-sweep",
"durationMs": 1697.2839999999678,
"styleRecalcs": 32,
"styleRecalcDurationMs": 15.339000000000002,
"layouts": 6,
"layoutDurationMs": 1.056,
"taskDurationMs": 304.574,
"heapDeltaBytes": 4422284,
"heapUsedBytes": 73495504,
"domNodes": 79,
"jsHeapTotalBytes": 4980736,
"scriptDurationMs": 9.924999999999999,
"eventListeners": 19,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "dom-widget-clipping",
"durationMs": 528.2739999999535,
"styleRecalcs": 12,
"styleRecalcDurationMs": 7.180999999999998,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 358.42400000000004,
"heapDeltaBytes": 18740932,
"heapUsedBytes": 88010736,
"domNodes": 20,
"jsHeapTotalBytes": 4456448,
"scriptDurationMs": 123.50500000000001,
"eventListeners": 2,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "dom-widget-clipping",
"durationMs": 529.3389999999363,
"styleRecalcs": 12,
"styleRecalcDurationMs": 6.571000000000001,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 355.442,
"heapDeltaBytes": 18478820,
"heapUsedBytes": 87632000,
"domNodes": 20,
"jsHeapTotalBytes": 4980736,
"scriptDurationMs": 120,
"eventListeners": 0,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.799999999999727
},
{
"name": "large-graph-idle",
"durationMs": 2030.3129999999783,
"styleRecalcs": 7,
"styleRecalcDurationMs": 5.103,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 479.21299999999997,
"heapDeltaBytes": -12777756,
"heapUsedBytes": 86896876,
"domNodes": -267,
"jsHeapTotalBytes": -1085440,
"scriptDurationMs": 28.407,
"eventListeners": -153,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "large-graph-idle",
"durationMs": 2021.0759999999937,
"styleRecalcs": 6,
"styleRecalcDurationMs": 4.218,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 480.77099999999996,
"heapDeltaBytes": -12819884,
"heapUsedBytes": 87182196,
"domNodes": -268,
"jsHeapTotalBytes": -1347584,
"scriptDurationMs": 28.30699999999999,
"eventListeners": -153,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "large-graph-pan",
"durationMs": 2083.0930000000194,
"styleRecalcs": 67,
"styleRecalcDurationMs": 10.775,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 1198.524,
"heapDeltaBytes": 21138712,
"heapUsedBytes": 86919580,
"domNodes": 10,
"jsHeapTotalBytes": 225280,
"scriptDurationMs": 581.314,
"eventListeners": 6,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "large-graph-pan",
"durationMs": 2119.4619999999986,
"styleRecalcs": 66,
"styleRecalcDurationMs": 10.331,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 1248.531,
"heapDeltaBytes": 18594044,
"heapUsedBytes": 84469380,
"domNodes": -270,
"jsHeapTotalBytes": 225280,
"scriptDurationMs": 602.4770000000001,
"eventListeners": 6,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333335,
"p95FrameDurationMs": 16.699999999999818
},
{
"name": "large-graph-zoom",
"durationMs": 3136.441999999988,
"styleRecalcs": 60,
"styleRecalcDurationMs": 9.315,
"layouts": 60,
"layoutDurationMs": 11.237,
"taskDurationMs": 1370.3719999999998,
"heapDeltaBytes": 13118084,
"heapUsedBytes": 80609620,
"domNodes": 0,
"jsHeapTotalBytes": 0,
"scriptDurationMs": 628.239,
"eventListeners": 6,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "large-graph-zoom",
"durationMs": 3209.1550000000097,
"styleRecalcs": 63,
"styleRecalcDurationMs": 12.758000000000003,
"layouts": 60,
"layoutDurationMs": 11.787,
"taskDurationMs": 1417.015,
"heapDeltaBytes": 9919948,
"heapUsedBytes": 76196688,
"domNodes": -272,
"jsHeapTotalBytes": 0,
"scriptDurationMs": 608.274,
"eventListeners": -149,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "legacy-node-drag",
"durationMs": 2335.6130000000235,
"styleRecalcs": 42,
"styleRecalcDurationMs": 6.406999999999999,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 1532.568,
"heapDeltaBytes": 14454636,
"heapUsedBytes": 81224600,
"domNodes": 4,
"jsHeapTotalBytes": 1728512,
"scriptDurationMs": 755.641,
"eventListeners": 186,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "legacy-node-drag",
"durationMs": 2566.9450000000325,
"styleRecalcs": 42,
"styleRecalcDurationMs": 6.277999999999999,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 1542.974,
"heapDeltaBytes": 13600632,
"heapUsedBytes": 80786020,
"domNodes": 4,
"jsHeapTotalBytes": 417792,
"scriptDurationMs": 762.3559999999999,
"eventListeners": 186,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "minimap-idle",
"durationMs": 2035.494999999969,
"styleRecalcs": 6,
"styleRecalcDurationMs": 4.119999999999998,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 470.39200000000005,
"heapDeltaBytes": -14286324,
"heapUsedBytes": 87214528,
"domNodes": -268,
"jsHeapTotalBytes": -1609728,
"scriptDurationMs": 28.848,
"eventListeners": -151,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.699999999999818
},
{
"name": "minimap-idle",
"durationMs": 2033.8130000000092,
"styleRecalcs": 7,
"styleRecalcDurationMs": 5.895000000000001,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 516.1819999999999,
"heapDeltaBytes": -14427424,
"heapUsedBytes": 86929000,
"domNodes": -264,
"jsHeapTotalBytes": -1085440,
"scriptDurationMs": 31.696,
"eventListeners": -151,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.699999999999818
},
{
"name": "subgraph-dom-widget-clipping",
"durationMs": 530.2470000000312,
"styleRecalcs": 47,
"styleRecalcDurationMs": 9.200000000000001,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 319.041,
"heapDeltaBytes": 14262216,
"heapUsedBytes": 85847184,
"domNodes": 20,
"jsHeapTotalBytes": 5767168,
"scriptDurationMs": 109.43499999999999,
"eventListeners": 6,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333335,
"p95FrameDurationMs": 16.799999999999727
},
{
"name": "subgraph-dom-widget-clipping",
"durationMs": 530.9210000000348,
"styleRecalcs": 47,
"styleRecalcDurationMs": 9.112,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 321.73799999999994,
"heapDeltaBytes": 14392508,
"heapUsedBytes": 85920892,
"domNodes": 20,
"jsHeapTotalBytes": 5505024,
"scriptDurationMs": 110.15700000000001,
"eventListeners": 8,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.699999999999818
},
{
"name": "subgraph-idle",
"durationMs": 2022.8529999999978,
"styleRecalcs": 11,
"styleRecalcDurationMs": 11.080000000000002,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 397.008,
"heapDeltaBytes": -6540756,
"heapUsedBytes": 64970584,
"domNodes": -295,
"jsHeapTotalBytes": 4972544,
"scriptDurationMs": 7.0749999999999975,
"eventListeners": -201,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333335,
"p95FrameDurationMs": 16.699999999999818
},
{
"name": "subgraph-idle",
"durationMs": 2018.54000000003,
"styleRecalcs": 11,
"styleRecalcDurationMs": 7.192,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 414.35999999999996,
"heapDeltaBytes": -10160108,
"heapUsedBytes": 61132696,
"domNodes": -293,
"jsHeapTotalBytes": 5234688,
"scriptDurationMs": 7.734000000000001,
"eventListeners": -201,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "subgraph-mouse-sweep",
"durationMs": 1734.1220000000135,
"styleRecalcs": 77,
"styleRecalcDurationMs": 29.081000000000003,
"layouts": 18,
"layoutDurationMs": 4.204,
"taskDurationMs": 708.35,
"heapDeltaBytes": -13033888,
"heapUsedBytes": 58185948,
"domNodes": -295,
"jsHeapTotalBytes": 6283264,
"scriptDurationMs": 86.07900000000001,
"eventListeners": -201,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "subgraph-mouse-sweep",
"durationMs": 1718.7829999999167,
"styleRecalcs": 77,
"styleRecalcDurationMs": 29.843,
"layouts": 18,
"layoutDurationMs": 4.496,
"taskDurationMs": 666.86,
"heapDeltaBytes": -11990996,
"heapUsedBytes": 59237872,
"domNodes": -295,
"jsHeapTotalBytes": 5758976,
"scriptDurationMs": 89.506,
"eventListeners": -201,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "subgraph-transition-enter",
"durationMs": 883.7159999999358,
"styleRecalcs": 20,
"styleRecalcDurationMs": 24.830000000000005,
"layouts": 16,
"layoutDurationMs": 12.119,
"taskDurationMs": 726.8960000000002,
"heapDeltaBytes": -5477980,
"heapUsedBytes": 91756156,
"domNodes": 13671,
"jsHeapTotalBytes": 10747904,
"scriptDurationMs": 20.924000000000007,
"eventListeners": 2381,
"totalBlockingTimeMs": 86,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "viewport-pan-sweep",
"durationMs": 8386.754999999994,
"styleRecalcs": 248,
"styleRecalcDurationMs": 35.323,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 4727.895,
"heapDeltaBytes": 13612088,
"heapUsedBytes": 88807716,
"domNodes": -270,
"jsHeapTotalBytes": 151552,
"scriptDurationMs": 2167.597,
"eventListeners": -165,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "viewport-pan-sweep",
"durationMs": 8303.728000000092,
"styleRecalcs": 248,
"styleRecalcDurationMs": 36.489,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 4654.4439999999995,
"heapDeltaBytes": -10777972,
"heapUsedBytes": 88798036,
"domNodes": -267,
"jsHeapTotalBytes": -1384448,
"scriptDurationMs": 2039.0790000000002,
"eventListeners": -137,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "vue-large-graph-idle",
"durationMs": 14556.671999999991,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 14086.389999999998,
"heapDeltaBytes": -39537988,
"heapUsedBytes": 176717056,
"domNodes": -6548,
"jsHeapTotalBytes": -3305472,
"scriptDurationMs": 203.254,
"eventListeners": -7473,
"totalBlockingTimeMs": 0,
"frameDurationMs": 17.219999999999953,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "vue-large-graph-idle",
"durationMs": 15046.508000000016,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 14627.166999999998,
"heapDeltaBytes": -45396756,
"heapUsedBytes": 175599532,
"domNodes": -6548,
"jsHeapTotalBytes": -8290304,
"scriptDurationMs": 264.88800000000003,
"eventListeners": -7473,
"totalBlockingTimeMs": 0,
"frameDurationMs": 17.223333333333237,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "vue-large-graph-pan",
"durationMs": 17338.62999999997,
"styleRecalcs": 148,
"styleRecalcDurationMs": 14.401999999999997,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 16964.409,
"heapDeltaBytes": -26050872,
"heapUsedBytes": 176244708,
"domNodes": -6548,
"jsHeapTotalBytes": 802816,
"scriptDurationMs": 709.7900000000001,
"eventListeners": -7469,
"totalBlockingTimeMs": 9,
"frameDurationMs": 17.223333333333358,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "vue-large-graph-pan",
"durationMs": 17426.58199999994,
"styleRecalcs": 145,
"styleRecalcDurationMs": 14.93,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 17089.432,
"heapDeltaBytes": -15393376,
"heapUsedBytes": 189540084,
"domNodes": -6548,
"jsHeapTotalBytes": 1781760,
"scriptDurationMs": 699.5610000000001,
"eventListeners": -7473,
"totalBlockingTimeMs": 9,
"frameDurationMs": 17.776666666666763,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "vue-node-resize-workload",
"durationMs": 5313.186999999971,
"styleRecalcs": 20,
"styleRecalcDurationMs": 61.92899999999998,
"layouts": 20,
"layoutDurationMs": 21.534,
"taskDurationMs": 5166.698,
"heapDeltaBytes": -25236488,
"heapUsedBytes": 175018516,
"domNodes": -6552,
"jsHeapTotalBytes": 12587008,
"scriptDurationMs": 86.701,
"eventListeners": -7473,
"totalBlockingTimeMs": 289,
"frameDurationMs": 17.216666666666665,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "vue-node-resize-workload",
"durationMs": 5335.3570000000445,
"styleRecalcs": 20,
"styleRecalcDurationMs": 59.07200000000002,
"layouts": 20,
"layoutDurationMs": 20.875000000000004,
"taskDurationMs": 5247.008,
"heapDeltaBytes": -25220684,
"heapUsedBytes": 185254452,
"domNodes": -6552,
"jsHeapTotalBytes": 18685952,
"scriptDurationMs": 87.14399999999999,
"eventListeners": -7469,
"totalBlockingTimeMs": 231,
"frameDurationMs": 17.220000000000013,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "workflow-execution",
"durationMs": 464.0239999999949,
"styleRecalcs": 14,
"styleRecalcDurationMs": 16.083,
"layouts": 2,
"layoutDurationMs": 0.5320000000000001,
"taskDurationMs": 90.63799999999999,
"heapDeltaBytes": 5079132,
"heapUsedBytes": 72279504,
"domNodes": 128,
"jsHeapTotalBytes": 262144,
"scriptDurationMs": 6.609999999999999,
"eventListeners": 97,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66999999999998,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "workflow-execution",
"durationMs": 78.40299999998024,
"styleRecalcs": 5,
"styleRecalcDurationMs": 9.494999999999997,
"layouts": 2,
"layoutDurationMs": 0.648,
"taskDurationMs": 51.586000000000006,
"heapDeltaBytes": 3153536,
"heapUsedBytes": 70541336,
"domNodes": 105,
"jsHeapTotalBytes": 524288,
"scriptDurationMs": 3.366000000000001,
"eventListeners": 49,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.663333333333338,
"p95FrameDurationMs": 16.700000000000273
}
]
} |
Codecov Report❌ Patch coverage is @@ Coverage Diff @@
## christian-byrne/integration-candidate-v2 #16286 +/- ##
============================================================================
+ Coverage 81.25% 83.24% +1.99%
============================================================================
Files 2402 2024 -378
Lines 123372 116932 -6440
Branches 33894 32426 -1468
============================================================================
- Hits 100246 97344 -2902
+ Misses 22527 19235 -3292
+ Partials 599 353 -246
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 385 files with indirect coverage changes 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
🔍 Cursor Review — Consolidated panel
Triggered by @christian-byrne.
Found 10 finding(s).
| Severity | Count |
|---|---|
| 🟠 High | 2 |
| 🟡 Medium | 4 |
| 🟢 Low | 4 |
Panel: 8/8 reviewers contributed findings.
| ) | ||
| ) | ||
| } catch (error) { | ||
| propagate(error) |
There was a problem hiding this comment.
🟠 High — stop() aborts requests, but this catch treats the resulting AbortError like a server failure, and start() always fires void refreshHistory(). Closing the panel (or a flag flip to off) while listThreads is still in flight therefore reaches onError -> surfaceAgentError -> executionErrorStore.showErrorOverlay(), popping a global agent_api_failed overlay after the panel is already gone. Swallow lifecycle aborts (error.name === 'AbortError', or bail when started is false) before propagating. Raised by 7 of 8 reviewers (claude-opus-5-thinking-max adversarial and edge-case, gpt-5.6-sol-max adversarial and edge-case, kimi-k3-max adversarial and edge-case, gemini-3.1-pro adversarial).
| function stop(): void { | ||
| if (!started) return | ||
| started = false | ||
| requests.abort() |
There was a problem hiding this comment.
🟠 High — The one shared controller is attached to every REST call, including the non-idempotent postMessage, cancelMessage, and uploadImage, so unmounting mid-send aborts a request the server may already have accepted. sendMessage's catch then records a failed-send entry in the persisted conversation store while setThreadId(ack.thread_id) never runs — the turn keeps running server-side, orphaned, and the user is invited to resend it — and an aborted cancelMessage silently leaves a turn uncancelled. Restrict the teardown abort to read-only requests, or let in-flight mutations settle. Raised by 6 of 8 reviewers (claude-opus-5-thinking-max adversarial and edge-case, gpt-5.6-sol-max adversarial and edge-case, kimi-k3-max adversarial and edge-case).
| }, | ||
| afterLoadGraph(app) { | ||
| const agentPanelStore = useAgentPanelStore() | ||
| if (!featureEnabled.value) return |
There was a problem hiding this comment.
🟡 Medium — beforeLoadGraph and afterLoadGraph each re-sample the mutable gate, so beginWorkflowLoad()/finishWorkflowLoad() are no longer paired: a feature_flags frame that flips the gate off during the awaited graph load makes this early return skip the settle, and the only other finishWorkflowLoad() call lives in the runtime component that flag-off just unmounted. isLoadingWorkflow then stays true for the rest of the session, keeping useCanvasSelection paused and the selection-save watcher inert even after the flag returns. Sample the gate once in beforeLoadGraph and have afterLoadGraph always finish a load it started. Raised by 7 of 8 reviewers (claude-opus-5-thinking-max adversarial and edge-case, gpt-5.6-sol-max adversarial and edge-case, kimi-k3-max adversarial and edge-case, gemini-3.1-pro adversarial).
| > | ||
| <Button | ||
| v-if="agentPanelStore.enabled" | ||
| v-if="agentFeatureEnabled" |
There was a problem hiding this comment.
🟡 Medium — The guard moved from agentPanelStore.enabled — only ever set by registerAgentPanelExtension, which src/extensions/core/index.ts calls under __DISTRIBUTION__ === 'cloud' — to the raw server flag, and useAgentFeatureGate has no distribution check. On a non-cloud build whose backend advertises agent-in-app-experience, the button renders but useAgentDockMount still returns DockedAgentPanel: null, so clicking it only persists isOpen and swaps the splitter's saved layout key with no panel ever appearing. Gate the button on isCloud as well. Raised by 5 of 8 reviewers (claude-opus-5-thinking-max adversarial and edge-case, gpt-5.6-sol-max adversarial and edge-case, kimi-k3-max edge-case).
| const height = canvas.canvas.height / window.devicePixelRatio | ||
| const coveredWidth = panel.enabled && panel.isOpen ? panel.width : 0 | ||
| let coveredWidth = 0 | ||
| if (useAgentFeatureGate().value) { |
There was a problem hiding this comment.
🟡 Medium — This is a plain function on the canvas fit/focus path, so useAgentFeatureGate() here builds a fresh computed (plus useFeatureFlags() state) on every invocation, outside any effect scope that could stop it. Each one subscribes to the global serverFeatureFlags ref and is never disposed, so subscribers accumulate and later flag updates get progressively more expensive. Read the flag directly with api.getServerFeature(ServerFeatureFlag.AGENT_IN_APP_EXPERIENCE, false), or hoist a single gate to module scope. Raised by 3 of 8 reviewers (gemini-3.1-pro adversarial and edge-case, gpt-5.6-sol-max adversarial).
| storage-key="Comfy.AgentPanel.onboarded" | ||
| /> | ||
| </div> | ||
| <AgentPanelRuntimeRoot v-if="enabled" /> |
There was a problem hiding this comment.
🟡 Medium — The entire runtime is now v-if'd on a live server-flag read with no latch or debounce, while each feature_flags frame replaces the whole api.serverFeatureFlags object. A partial payload or a reconnect to a backend that hasn't loaded the flag yet therefore unmounts AgentPanelRuntimeRoot mid-turn, aborting in-flight requests and discarding transcript and selection state; the removed PostHog source deliberately ignored errorsLoading deliveries for this reason. Consider latching the gate on for the session once enabled, or tearing down only on an explicit false. Raised by 1 of 8 reviewers (claude-opus-5-thinking-max adversarial).
| if (enabled) { | ||
| agentPanelStore ??= useAgentPanelStore() | ||
| agentPanelStore.enabled = true | ||
| agentPanelStore.gateSettled = true |
There was a problem hiding this comment.
🟢 Low — gateSettled is assigned only on the enabled branch, and the store is not constructed at all while the flag is off, so flag-off sessions leave it false forever. Combined with WorkflowTabs.vue deriving data-agent-gate-settled from agentFeatureEnabled, the signal collapses into a duplicate of "enabled" and can no longer express "gate resolved to off" — anything waiting for settlement before asserting the button is absent now waits forever. Either settle on both branches or drop the concept now that the gate is synchronous. Raised by 1 of 8 reviewers (claude-opus-5-thinking-max edge-case).
| const signal = options.signal?.() | ||
| const response = await api.fetchApi( | ||
| route, | ||
| signal === undefined ? init : { ...init, signal } |
There was a problem hiding this comment.
🟢 Low — { ...init, signal } unconditionally overwrites any signal a caller put in init, so a future per-request cancellation token would be silently replaced by the runtime-wide one. No current call site passes one, but signal: init.signal ?? signal (or combining both with AbortSignal.any) removes the trap. Raised by 3 of 8 reviewers (claude-opus-5-thinking-max adversarial and edge-case, gemini-3.1-pro edge-case).
| const { isOpen: agentPanelOpen } = storeToRefs(agentPanelStore) | ||
| const agentPanelOpen = computed(() => { | ||
| if (!agentFeatureEnabled.value) return false | ||
| agentPanelStore ??= useAgentPanelStore() |
There was a problem hiding this comment.
🟢 Low — Instantiating a Pinia store inside a computed getter is a side effect in a pure-read position: useAgentPanelStore() writes pinia.state.value[$id] mid-evaluation, which Vue explicitly disallows and which can cost an extra recompute or surface recursive-update warnings. The same lazy-init-inside-computed pattern repeats in GraphCanvas.vue, WorkflowTabs.vue, and useAgentDockMount.ts, and it saves no bundle weight here because the store module is a static import — hoist the useStore() call out of the getter. Raised by 2 of 8 reviewers (claude-opus-5-thinking-max adversarial and edge-case).
| options.onError?.(error) | ||
| } | ||
|
|
||
| async function refreshHistory(): Promise<void> { |
There was a problem hiding this comment.
🟢 Low — refreshHistory has no staleness guard but is invoked from three concurrent paths: start(), the @open-history handler, and onSelectHistory after loadThread. Overlapping listThreads calls resolve in completion order, so a slow earlier response can history.replaceAll over a newer one and leave the chat list stale; guard with an incrementing generation counter. Raised by 1 of 8 reviewers (claude-opus-5-thinking-max adversarial).
…resolves (Comfy-Org#14965) ## Summary Part of FE-1540 / PAY-004. Six Pylon tickets (Comfy-Org#16322, Comfy-Org#16286, Comfy-Org#16285, Comfy-Org#16284, Comfy-Org#16280, Comfy-Org#16274), one customer threatening a formal payment dispute. `canRunWorkflows` is `false` from the very first render — `isInitialized` starts `false`, `subscription` is `null`, and `canAccessSubscriptionFeatures` is `statusData.value?.is_active ?? false` (`useWorkspaceBilling.ts:127-129`). Neither `CloudRunButtonWrapper.vue` nor `LinearControls.vue` read `isInitialized`, `isLoading`, or `error`, so **the locked "Subscribe to run" button was the default render**, asserted on no data at all. A paying subscriber whose status fetch is slow, failing, or scoped to the wrong workspace saw a paywall over Run, with no recovery path — `CloudRunButtonWrapper`'s focus refetch is gated behind `refreshBillingOnFocus`, which is only set inside the payment-recovery dialog, so it never fires for a plain status desync. Worth stating because it contradicts an assumption made during triage: `canAccessSubscriptionFeatures` does not mean "this user has a paid subscription", it means "the last status response said `is_active: true`". Those differ during a desync, which is the incident. ## Change Adds `showsSubscribeToRunPrompt` to the billing context — it only claims the user needs to subscribe once billing status has resolved: ```ts const showsSubscribeToRunPrompt = computed( () => isInitialized.value && !canRunWorkflows.value ) ``` Consumed at the three render sites (`CloudRunButtonWrapper.vue:3`, `LinearControls.vue:182,246`) instead of each re-deriving the rule. During the unresolved window the normal Run button renders. Entitlement is still enforced by the backend on execution, and `useAccountPreconditionDialog` already handles that rejection, so failing open for that window is the safer direction — a subscriber who cannot run is a dispute, a non-subscriber who clicks Run gets a clear server-driven prompt. ## Scope Deliberately the low-risk half of FE-1540. **Not** included, because they change Run-button behaviour for all cloud users and want a human call during an active incident: - an unsolicited focus/visibility refetch on the Run path (what Robin asked for in-thread) - hardening `useWorkspaceBilling.ts:244` so a successful-but-stale response cannot silently downgrade a previously-active subscription Also not addressed here: `getBillingStatus()` sends no workspace parameter (`workspaceApi.ts:430-441`), so a subscription on a team workspace while Personal is active reads the wrong billing entirely. Tracked on FE-1540. ## Tests New case `keeps the run button while billing status is still resolving`, verified red against the old gate: ``` × keeps the run button while billing status is still resolving Tests 1 failed | 11 passed (12) ``` 275 tests pass across the 19 affected suites. `pnpm typecheck` exit 0, `pnpm knip` exit 0. - Part of FE-1540 Co-authored-by: Connor Byrne <c.byrne@comfy.org>
|
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. |
Full context for agent readers
What changed
agentRuntime.ts.AgentPanelRoot.vueto a synchronous canonical server-feature gate and moved the mounted UI composition intoAgentPanelRuntimeRoot.vue.Verification
pnpm typecheck: passpnpm typecheck:browser: passpnpm lint: pass (187 existing warnings, 0 errors)pnpm build: passknip --cache: passRuntime ownership
The runtime constructs exactly one REST client and one event source while enabled.
start()andstop()are idempotent; stop aborts pending requests, unregisters runtime watchers, unsubscribes session events/status, and settles active/background turns.Scope
No graph navigation/effects, lifetime-policy, telemetry/localization, server-schema, auth, model-routing, or CRDT-invariant changes are included.