Repository navigation
refactor: remove parallel agent node selection state #20172
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
2beb335
refactor: remove parallel agent node selection state
DrJKL 1d20301
Merge branch 'main' into drjkl/fe-2616-remove-agent-node-selection-store
DrJKL e73fea3
fix: preserve sidebar state with canvas node picking
DrJKL 58484cb
test: use assertion narrowing for active workflow
christian-byrne eb1b104
fix: pause release toast timeout while node picking
christian-byrne 1d4d7cd
test(agent): cover composer reference lifecycle
christian-byrne File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
56 changes: 56 additions & 0 deletions
56
docs/adr/AGENT-SELECTION-0040-composer-owns-node-references.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
| # ADR-AGENT-SELECTION-0040: Composer Owns Node References | ||
|
|
||
| Date: 2026-10-05 | ||
|
|
||
| ## Status | ||
|
|
||
| Proposed | ||
|
|
||
| ## Context | ||
|
|
||
| Canvas selection and prompt references have different lifetimes. A reference | ||
| can outlive picking, panel closure, or a graph reload. Keeping another copy | ||
| in `agentNodeSelectionStore`, keyed by workflow path, required a restore | ||
| handshake with canvas selection and broke when a workflow was renamed. | ||
|
|
||
| ## Decision | ||
|
|
||
| Use `agentComposerStore` as the only owner of draft node references. Scope | ||
| them by the workflow's session-stable `instanceId`, not its mutable path. | ||
| After a graph load, revalidate matching references against the root graph, | ||
| including subgraph locators, without restoring canvas selection. | ||
|
|
||
| Keep transient picking state in `canvasStore`. The existing injected | ||
| interaction-mode reader continues to enforce select-only behavior. Stop | ||
| tracking before deselecting so exiting does not erase prompt references. | ||
| The banner owns Escape; presentation derives visibility without changing | ||
| minimap or sidebar preferences. | ||
|
|
||
| This replaces the store ownership specified in | ||
| [ADR-CANVAS-INTERACTION-0035](CANVAS-INTERACTION-0035-agent-node-picking-policy.md), | ||
| not its input guards. Canvas selection remains owned as specified in | ||
| [ADR-CANVAS-SELECTION-0028](CANVAS-SELECTION-0028-single-selection-store.md). | ||
|
|
||
| ## Alternatives considered | ||
|
|
||
| - Repair path-key migration in the old store. This fixes rename but keeps | ||
| two writable copies of draft references and the restore handshake. | ||
| - Use canvas selection as the draft. This loses references when selection | ||
| is cleared or the visible graph changes. | ||
| - Keep a separate picker store. After removing persistence and preference | ||
| restoration, its remaining state belongs to the existing canvas owner. | ||
|
|
||
| ## Consequences | ||
|
|
||
| ### Positive | ||
|
|
||
| - Rename and graph reload no longer require a parallel reference cache. | ||
| - Closing the panel does not prevent reference revalidation. | ||
| - Picking does not write user preferences that later need restoration. | ||
|
|
||
| ### Negative | ||
|
|
||
| - Graph-load integration still needs to know which workflow owns the draft. | ||
| - The minimap remains hidden throughout picking, even if its preference is | ||
| toggled; the current preference takes effect when picking ends. | ||
| - `instanceId` is a session identity, not a cross-reload persistence key. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win
Assert canvas selection before clearing it.
The Control-click can clear a selected node. The first
selectedNodesassertion runs after that click, so this test can miss a regression that selects the canvas node when the reference is inserted. Assert thatselectedNodeshas count zero immediately after inserting the reference. Keep the post-reload assertion.As per coding guidelines, “Assert on return values, rendered output, emitted events, persisted state, and user-visible effects.” As per path instructions, assess changed tests for behavior coverage.
🤖 Prompt for AI Agents
Sources: Coding guidelines, Path instructions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@DrJKLUnderstood. I won’t pursue this suggestion further.🧠 Learnings used
You are interacting with an AI system.