-
Notifications
You must be signed in to change notification settings - Fork 95
fix(designer): Enable nesting Agent Loop nodes in FOREACH/UNTIL control flows in designer #8648
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
Conversation
Remove the root-level restriction that prevented Agent Loop nodes from being added inside FOREACH/UNTIL loops in agentic workflows.
🤖 AI PR Validation ReportPR Review ResultsThank you for your submission! Here's detailed feedback on your PR title and body compliance:✅ PR Title
✅ Commit Type
✅ Risk Level
|
| Section | Status | Recommendation |
|---|---|---|
| Title | ✅ | Keep as-is. |
| Commit Type | ✅ | Keep as-is. |
| Risk Level | ✅ | Keep risk:low, but review version gating note. |
| What & Why | Fix the bundle-version inconsistency (1.115.0 vs 2.0.0) and document placeholder if intended. | |
| Impact of Change | ✅ | Add one-line clarifying default behavior for users. |
| Test Plan | Add unit tests for selector + search/menu behavior; consider E2E. | |
| Contributors | Add contributors or a short note if none. | |
| Screenshots/Videos | ✅ | N/A is fine. |
Final notes & actionable recommendations
- Version gating mismatch (HIGH priority to fix before release):
- Update BundleVersionRequirements.NESTED_AGENT_LOOPS to the intended min bundle version (e.g.,
1.115.0) or clearly mark the2.0.0value as a placeholder in the PR body and create a follow-up to set the final value. - Ensure PR body What & Why and the code agree on the version requirement — this avoids rollout surprises where the feature remains blocked (if code requires 2.0.0) or is enabled earlier than intended.
- Update BundleVersionRequirements.NESTED_AGENT_LOOPS to the intended min bundle version (e.g.,
- Tests (recommended before larger rollout):
- Add unit tests for the new selector and the conditional logic in SearchView and EdgeContextualMenu.
- If not possible in this PR, create an issue linking to automated test coverage to add soon.
- Localization change:
- You updated the localization id for the "Add an MCP server (preview)" string (moved from JTy5al to kIei9R). Confirm this is intentional and inform localization owners so translations are preserved/merged correctly.
- Small UX/PR body improvements:
- Add the short sentence clarifying default behavior (nested loops off unless hostOption true and version matches).
- Add contributors list or a short note that none need to be credited.
Please update the PR body to either correct the version constant or call out the placeholder explicitly, and add or track tests for the new gating logic. Once the version mismatch is clarified and tests are planned/added, this PR is in good shape to land.
Overall: This PR passes the PR-body/title checks with one important action item: reconcile the bundle version number between the PR description and the code (or document the placeholder) and add/track tests for the gating behavior. Thanks for the clear description and good structure!
Last updated: Mon, 15 Dec 2025 18:24:35 GMT
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.
Pull request overview
This PR removes the restriction that prevented Agent Loop nodes from being nested inside regular control flow loops (FOREACH, UNTIL) in agentic and A2A workflows. Previously, Agent Loop nodes could only be added at the root level; now they can be placed anywhere within these workflow types.
Key Changes:
- Simplified the filtering logic to only check workflow type (agentic/A2A) instead of both workflow type and node position
- Removed the
isRootcondition that was preventing nested Agent Loop nodes
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| libs/designer/src/lib/ui/panel/recommendation/searchView.tsx | Updated agent operation filter to remove root position check |
| libs/designer-v2/src/lib/ui/panel/recommendation/searchView.tsx | Updated agent operation filter to remove root position check (v2 implementation) |
Remove the root-level restriction from the EdgeContextualMenu that prevented the "Add an agent" button from appearing inside loops.
Add enableNestedAgentLoops hostOption that requires bundle version >= 1.115.0 to allow Agent Loop nodes inside regular loops. Changes: - Add enableNestedAgentLoops to hostOptions interface (designer/designer-v2) - Add useEnableNestedAgentLoops selector hook - Update searchView.tsx to check the flag before showing Agent in search - Update EdgeContextualMenu.tsx to check the flag before showing Agent button - VS Code apps calculate the flag based on bundle version
Add BundleVersionRequirements constant object in version.ts to centralize minimum version requirements for features: - MULTI_VARIABLE: '1.114.22' - NESTED_AGENT_LOOPS: '1.115.0' Update VS Code apps to use constants instead of hardcoded strings.
Commit Type
Risk Level
What & Why
Previously, Agent Loop nodes could only be added at the root level of agentic/A2A workflows. This change removes that restriction with a version gate:
Changes:
searchView.tsx): Agent operations now checkenableNestedAgentLoopsflag when not at rootEdgeContextualMenu.tsx): "Add an agent" button visibility now checks the flag when not at rootenableNestedAgentLoopshostOption that requires bundle version >= 1.115.0Files modified:
libs/designer/src/lib/core/state/designerOptions/designerOptionsInterfaces.ts- Added new hostOptionlibs/designer/src/lib/core/state/designerOptions/designerOptionsSelectors.ts- Added selector hooklibs/designer/src/lib/ui/panel/recommendation/searchView.tsx- Check flag in filterlibs/designer/src/lib/ui/common/EdgeContextualMenu/EdgeContextualMenu.tsx- Check flag for button visibilitylibs/designer-v2/apps/vs-code-react/src/app/designer/app.tsx&appV2.tsx- Version check usingisVersionSupportedImpact of Change
enableNestedAgentLoopshostOption availableTest Plan
Contributors
Screenshots/Videos