Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
a574099
feat(minimap): mark freshly agent-generated nodes
uytieu Sep 14, 2026
81779fa
feat(minimap): hold the agent mark as provenance, not recency
uytieu Sep 14, 2026
aaa48fd
feat(minimap): draw human-placed nodes in primary blue
uytieu Sep 14, 2026
a14e8c8
feat(minimap): bronze for human nodes, primary blue for the agent's
uytieu Sep 14, 2026
ed2cdef
Revert "feat(minimap): bronze for human nodes, primary blue for the a…
uytieu Sep 14, 2026
84ffb76
fix(agent): mark generated nodes off the subscription's own state
uytieu Sep 14, 2026
b0d94db
feat(agent): show graph activity while the agent writes nodes
uytieu Sep 15, 2026
dd27383
fix(agent-crdt): keep the catch-up pending until its batch commits
uytieu Sep 15, 2026
eebeac8
feat(agent): give the activity bar its copy, its nodes, and one shell
uytieu Sep 15, 2026
ecee17d
fix(agent): take the turn's baseline as the turn starts
uytieu Sep 15, 2026
edbc48d
fix(agent): drop a node's provenance when the node goes
uytieu Sep 15, 2026
dce8c4f
test: reproduce agent graph activity lifecycle failures
ampagent Sep 16, 2026
d66a597
fix: keep graph generation feedback in the agent extension
DrJKL Sep 16, 2026
b77dfe9
fix: preserve extension graph feedback across workflow and session li…
DrJKL Sep 16, 2026
58deb0f
test: cover agent minimap motion preferences and disposal
DrJKL Sep 16, 2026
0cf32db
fix: preserve agent feedback across rollback and focus mode
DrJKL Sep 16, 2026
9d8f513
fix: keep concurrent agent threads out of foreground reports
DrJKL Sep 16, 2026
f982870
fix: decouple agent activity presentation and repair CI fixtures
DrJKL Sep 16, 2026
2288fff
[automated] Update test expectations
invalid-email-address Sep 16, 2026
64e01b7
Merge remote-tracking branch 'refs/remotes/origin/main' into maint-17818
Sep 23, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
69 changes: 69 additions & 0 deletions docs/adr/AGENT-GRAPH-0031-extension-owned-graph-feedback.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# ADR-AGENT-GRAPH-0031: Extension-owned graph feedback

Date: 2026-09-16

## Status

Proposed

## Context

Agent-generated node feedback needs mutation provenance, turn completion, and
canvas presentation. Putting that policy in graph mutations, workflow-tab
activity, or the minimap couples application services to an optional extension.

Canvas components can unmount while a turn continues. Graph loading also clears
and reuses the canvas graph. Neither component lifetime nor node IDs alone can
identify the workflow that received a change.

## Decision

The agent extension owns provenance and reports. It observes successful node-store
actions and receives explicit turn events from the conversation store. Generic
canvas-overlay and minimap-layer registries expose presentation capabilities to
extensions without interpreting agent state. A shared viewport helper measures
host geometry from generic DOM attributes.

Marks use root graph, owning graph, and node identity. Workflow-load hooks retain
marks across tab switches only for the same workflow object with unchanged
incoming contents. Replacing contents or reopening a different object does not
inherit the report. Failed-load rollback retains the pending snapshot until the
original workflow loads again. Presentation remounts do not reset activity or
unregister the minimap layer; the extension store owns both registrations.

Live actors identify their thread separately from the frontend's message ID.
Different threads may write the same workflow concurrently, so gold provenance
includes both while a report excludes identified updates from other threads.
The backend permits only one active turn per thread. We use thread identity
because the send acknowledgment does not expose the backend turn UUID. Actorless
catch-up cannot distinguish historical writers and retains the existing
active-turn hydration behavior.

View opens the latest reported node's owning graph and frames reported nodes in
that graph. Combining bounds across graphs would combine unrelated coordinate
systems. Gold appears immediately; hydration staggers growth rather than initial
visibility. The extension owns reduced-motion policy and monotonic deadlines.

We rejected a host provenance service because actor classification belongs to
the extension. Component watchers cannot own turn history because remounting loses
the baseline. Path-keyed snapshots cannot distinguish replacement workflows.

## Consequences

### Positive

- Shared graph services do not import agent feedback policy.
- Deletion and graph reset remove live marks through existing node-store actions.
- Host framing and agent framing use the same visible canvas geometry.

### Negative

- Snapshot comparison clones workflow contents at load boundaries. Its cost grows
with workflow size, and harmless serialized changes can discard feedback.
- Feedback remains session-local and does not survive a page reload.
- View frames one owning graph at a time when a report spans subgraphs.

## Notes

This decision addresses the ownership and lifecycle findings in
[PR #17730](https://github.com/Comfy-Org/ComfyUI_frontend/pull/17730).
1 change: 1 addition & 0 deletions docs/adr/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ An Architecture Decision Record captures an important architectural decision mad
| ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------- | ---------- |
| [AGENT-BINDING-0035](AGENT-BINDING-0035-document-identity-gates-persisted-workflow-tab-bindings.md) | Document Identity Gates Persisted Workflow Tab Bindings | Proposed | 2026-09-19 |
| [AGENT-CONTEXT-0028](AGENT-CONTEXT-0028-separate-workflow-references-from-editor-tabs.md) | Separate Workflow References from Editor Tabs | Proposed | 2026-09-07 |
| [AGENT-GRAPH-0031](AGENT-GRAPH-0031-extension-owned-graph-feedback.md) | Extension-owned graph feedback | Proposed | 2026-09-16 |
| [AGENT-SESSION-0028](AGENT-SESSION-0028-compose-turn-origin-and-account-generation.md) | Compose Turn Origin and Account Generation | Proposed | 2026-09-05 |
| [ASSETS-DRAG-DROP-0035](ASSETS-DRAG-DROP-0035-asset-card-drag-uses-file-url.md) | Asset Card Drag-and-Drop Uses the File URL, Never the Preview URL | Proposed | 2026-09-19 |
| [AUTH-BILLING-0014](AUTH-BILLING-0014-billing-attempt-context-and-workspace-scope.md) | Billing Attempt Context and Workspace Scope | Proposed | 2026-07-28 |
Expand Down
28 changes: 28 additions & 0 deletions eslint.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -522,6 +522,34 @@ export default defineConfig([
}
},

{
files: [
'src/core/graph/**/*.{ts,vue}',
'src/renderer/extensions/minimap/**/*.{ts,vue}',
'src/stores/canvasOverlayStore.ts',
'src/stores/minimapLayerStore.ts',
'src/composables/canvas/visibleCanvasViewport.ts',
'src/components/graph/GraphCanvas.vue'
],
ignores: ['**/*.test.ts'],
rules: {
'import-x/no-restricted-paths': [
'error',
{
zones: [
{
target: './src/**',
from: './src/workbench/extensions/agent',
except: ['./composables/useAgentDockMount.ts'],
message:
'Agent graph feedback belongs in the agent extension. Register generic overlays and minimap layers instead of importing agent policy into the host.'
}
]
}
]
}
},

// src/lib/ holds vendored leaf libraries (litegraph). They may import from
// src/lib/ and from the shared base utilities, but never from an app layer —
// a vendored library depending on the app that vendors it is a dependency
Expand Down
1 change: 1 addition & 0 deletions src/components/LiteGraphCanvasSplitterOverlay.vue
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@
@resizestart="onResizestart"
>
<SplitterPanel
data-graph-viewport
class="graph-canvas-panel relative overflow-visible [anchor-name:--graph-canvas-panel]"
>
<slot name="graph-canvas-panel" />
Expand Down
13 changes: 13 additions & 0 deletions src/components/graph/GraphCanvas.vue
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,17 @@
"
class="pointer-events-auto"
/>
<div
v-if="showUI && !isBuilderMode"
class="contents"
@wheel="canvasInteractions.forwardEventToCanvas"
>
<component
:is="overlay"
v-for="(overlay, index) in canvasOverlayStore.components"
:key="index"
/>
</div>
<NodeSelectionModeBanner />
</template>
</LiteGraphCanvasSplitterOverlay>
Expand Down Expand Up @@ -181,6 +192,7 @@ import { useWorkflowStore } from '@/platform/workflow/management/stores/workflow
import { useWorkflowAutoSave } from '@/platform/workflow/persistence/composables/useWorkflowAutoSave'
import { useWorkflowPersistenceV2 as useWorkflowPersistence } from '@/platform/workflow/persistence/composables/useWorkflowPersistenceV2'
import { useNodeDataStore } from '@/stores/nodeDataStore'
import { useCanvasOverlayStore } from '@/stores/canvasOverlayStore'
import { useCanvasStore } from '@/renderer/core/canvas/canvasStore'
import { useCanvasInteractions } from '@/renderer/core/canvas/useCanvasInteractions'
import { arrangeForLegacyRender } from '@/renderer/core/canvas/litegraph/arrangeForLegacyRender'
Expand Down Expand Up @@ -228,6 +240,7 @@ const nodeSearchboxPopoverRef = shallowRef<InstanceType<
typeof NodeSearchboxPopover
> | null>(null)
const settingStore = useSettingStore()
const canvasOverlayStore = useCanvasOverlayStore()
const nodeDefStore = useNodeDefStore()
const workspaceStore = useWorkspaceStore()
const { isBuilderMode } = useAppMode()
Expand Down
3 changes: 3 additions & 0 deletions src/components/rightSidePanel/errors/ErrorGroupList.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,9 @@ function createCanvasFixture(pinia: Pinia, graph = ROOT_GRAPH) {
const canvasElement = document.createElement('canvas')
canvasElement.width = 900
canvasElement.height = 700
vi.spyOn(canvasElement, 'getBoundingClientRect').mockReturnValue(
new DOMRect(0, 0, 900, 700)
)
const canvas = fromPartial<LGraphCanvas>({
graph,
read_only: false,
Expand Down
1 change: 1 addition & 0 deletions src/components/sidebar/SideToolbar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<nav
ref="sideToolbarRef"
data-testid="side-toolbar"
data-graph-viewport-occluder
:inert="isHidden"
:aria-hidden="isHidden"
:class="
Expand Down
50 changes: 44 additions & 6 deletions src/composables/canvas/visibleCanvasViewport.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,49 @@
import type { ReadOnlyRect } from '@/lib/litegraph/src/interfaces'
import type { LGraphCanvas } from '@/lib/litegraph/src/litegraph'
import { useAgentPanelStore } from '@/workbench/extensions/agent/stores/agent/agentPanelStore'

const GRAPH_VIEWPORT_SELECTOR = '[data-graph-viewport]'
const GRAPH_VIEWPORT_OCCLUDER_SELECTOR = '[data-graph-viewport-occluder]'

function intersectsVertically(a: DOMRect, b: DOMRect): boolean {
return a.top < b.bottom && a.bottom > b.top
}

export function visibleCanvasViewport(canvas: LGraphCanvas): ReadOnlyRect {
const panel = useAgentPanelStore()
const width = canvas.canvas.width / window.devicePixelRatio
const height = canvas.canvas.height / window.devicePixelRatio
const coveredWidth = panel.isVisible ? panel.width : 0
return [0, 0, Math.max(width - coveredWidth, 0), height]
const canvasBounds = canvas.canvas.getBoundingClientRect()

Check failure on line 12 in src/composables/canvas/visibleCanvasViewport.ts

View workflow job for this annotation

GitHub Actions / test

src/composables/canvas/visibleCanvasViewport.test.ts > visibleCanvasViewport > T-06 / PM-669 / FE-1633 excludes the docked Agent panel width from Fit View

TypeError: canvas.canvas.getBoundingClientRect is not a function ❯ Module.visibleCanvasViewport src/composables/canvas/visibleCanvasViewport.ts:12:38 ❯ src/composables/canvas/visibleCanvasViewport.test.ts:34:12

Check failure on line 12 in src/composables/canvas/visibleCanvasViewport.ts

View workflow job for this annotation

GitHub Actions / test

src/composables/canvas/visibleCanvasViewport.test.ts > visibleCanvasViewport > T-06 / PM-669 / FE-1633 excludes the docked Agent panel width from Fit View

TypeError: canvas.canvas.getBoundingClientRect is not a function ❯ Module.visibleCanvasViewport src/composables/canvas/visibleCanvasViewport.ts:12:38 ❯ src/composables/canvas/visibleCanvasViewport.test.ts:34:12

Check failure on line 12 in src/composables/canvas/visibleCanvasViewport.ts

View workflow job for this annotation

GitHub Actions / test

src/composables/canvas/visibleCanvasViewport.test.ts > visibleCanvasViewport > T-06 / PM-669 / FE-1633 excludes the docked Agent panel width from Fit View

TypeError: canvas.canvas.getBoundingClientRect is not a function ❯ Module.visibleCanvasViewport src/composables/canvas/visibleCanvasViewport.ts:12:38 ❯ src/composables/canvas/visibleCanvasViewport.test.ts:34:12

Check failure on line 12 in src/composables/canvas/visibleCanvasViewport.ts

View workflow job for this annotation

GitHub Actions / test

src/composables/canvas/visibleCanvasViewport.test.ts > visibleCanvasViewport > uses the full CSS-pixel canvas while the Agent panel is closed

TypeError: canvas.canvas.getBoundingClientRect is not a function ❯ Module.visibleCanvasViewport src/composables/canvas/visibleCanvasViewport.ts:12:38 ❯ src/composables/canvas/visibleCanvasViewport.test.ts:21:12

Check failure on line 12 in src/composables/canvas/visibleCanvasViewport.ts

View workflow job for this annotation

GitHub Actions / test

src/composables/canvas/visibleCanvasViewport.test.ts > visibleCanvasViewport > uses the full CSS-pixel canvas while the Agent panel is closed

TypeError: canvas.canvas.getBoundingClientRect is not a function ❯ Module.visibleCanvasViewport src/composables/canvas/visibleCanvasViewport.ts:12:38 ❯ src/composables/canvas/visibleCanvasViewport.test.ts:21:12

Check failure on line 12 in src/composables/canvas/visibleCanvasViewport.ts

View workflow job for this annotation

GitHub Actions / test

src/composables/canvas/visibleCanvasViewport.test.ts > visibleCanvasViewport > uses the full CSS-pixel canvas while the Agent panel is closed

TypeError: canvas.canvas.getBoundingClientRect is not a function ❯ Module.visibleCanvasViewport src/composables/canvas/visibleCanvasViewport.ts:12:38 ❯ src/composables/canvas/visibleCanvasViewport.test.ts:21:12
const viewportBounds = document
.querySelector(GRAPH_VIEWPORT_SELECTOR)
?.getBoundingClientRect()

if (!viewportBounds) {
return [0, 0, canvasBounds.width, canvasBounds.height]
}

let left = viewportBounds.left
let right = viewportBounds.right
const occluders = document.querySelectorAll(GRAPH_VIEWPORT_OCCLUDER_SELECTOR)

for (const occluder of occluders) {
const bounds = occluder.getBoundingClientRect()
if (!intersectsVertically(viewportBounds, bounds)) continue

if (
bounds.left <= viewportBounds.left &&
bounds.right > viewportBounds.left
) {
left = Math.max(left, Math.min(bounds.right, viewportBounds.right))
}
if (
bounds.right >= viewportBounds.right &&
bounds.left < viewportBounds.right
) {
right = Math.min(right, Math.max(bounds.left, viewportBounds.left))
}
}

return [
left - canvasBounds.left,
viewportBounds.top - canvasBounds.top,
Math.max(right - left, 0),
viewportBounds.height
]
}
Loading
Loading