Fix(designer): consumption SKU agent runAfter bug — restore runAfter when re-adding agent loop#8663
Conversation
- Replace workflowKind check with isA2AWorkflow() helper in parser files - Fixes bug where consumption SKU agents lose runAfter after deletion/recreation - Affects both conversational and autonomous agent workflows - Updated 8 parser files in designer and designer-v2 libraries The issue was that allowRunAfterTrigger only checked for Standard SKU (workflowKind === 'agent') and missed Consumption SKU which uses metadata.agentType === 'conversational'. This caused agents to have no runAfter connection to trigger, breaking handoff addition.
- Added 21 tests covering all detection paths (Standard SKU, Consumption metadata, trigger pattern) - Tests verify case-sensitive metadata check and case-insensitive trigger check - Tests cover edge cases: empty state, missing triggers, priority/short-circuit behavior - Tests added to both designer and designer-v2 libraries for consistency
There was a problem hiding this comment.
Pull request overview
This PR fixes a bug where the runAfter property wasn't being set correctly for Agent-to-Agent (A2A) workflows in Consumption SKU. The fix replaces a simple workflowKind check with a more comprehensive isA2AWorkflow() helper that detects A2A workflows across both Standard and Consumption SKUs.
Key Changes:
- Introduced
isA2AWorkflow()helper function to properly detect A2A workflows across both SKUs - Replaced direct
equals(state.workflowKind, 'agent')checks with the new helper in workflow manipulation functions - Added comprehensive test coverage for the new detection logic
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| libs/designer/src/lib/core/state/workflow/test/helper.spec.ts | Added comprehensive unit tests for isA2AWorkflow() function covering Standard SKU, Consumption SKU, and edge cases |
| libs/designer/src/lib/core/parsers/pasteScopeInWorkflow.ts | Updated to use isA2AWorkflow() helper instead of direct workflowKind check |
| libs/designer/src/lib/core/parsers/moveNodeInWorkflow.ts | Updated to use isA2AWorkflow() helper for both old and new graph locations |
| libs/designer/src/lib/core/parsers/deleteNodeFromWorkflow.ts | Updated to use isA2AWorkflow() helper when deleting nodes |
| libs/designer/src/lib/core/parsers/addNodeToWorkflow.ts | Updated to use isA2AWorkflow() helper when adding nodes |
| libs/designer-v2/src/lib/core/state/workflow/test/helper.spec.ts | Added identical comprehensive unit tests for designer-v2 library |
| libs/designer-v2/src/lib/core/parsers/pasteScopeInWorkflow.ts | Updated to use isA2AWorkflow() helper (designer-v2 version) |
| libs/designer-v2/src/lib/core/parsers/moveNodeInWorkflow.ts | Updated to use isA2AWorkflow() helper (designer-v2 version) |
| libs/designer-v2/src/lib/core/parsers/deleteNodeFromWorkflow.ts | Updated to use isA2AWorkflow() helper (designer-v2 version) |
| libs/designer-v2/src/lib/core/parsers/addNodeToWorkflow.ts | Updated to use isA2AWorkflow() helper (designer-v2 version) |
🤖 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
|
| Section | Status | Recommendation |
|---|---|---|
| Title | ✅ | Optionally normalize to conventional commit casing (fix(...)) |
| Commit Type | ✅ | Good |
| Risk Level | Change label to risk:medium and state reasoning in PR body |
|
| What & Why | ✅ | Optionally mention the new isA2AWorkflow helper in the section |
| Impact of Change | ✅ | Add explicit staging/migration validation steps |
| Test Plan | ✅ | Add E2E/integration test or document manual E2E steps/results |
| Contributors | Add contributors or a note if none | |
| Screenshots/Videos | Not required for this logic change |
Final message
This PR body is largely well-formed and compliant with the template. The primary item to address is the risk level: because you changed a cross-cutting detection used by multiple parsers (which can alter runAfter behavior across workflows), I recommend labeling this risk:medium and adding a short justification in the PR body explaining the broader impact and the testing you ran.
Actionable next steps (recommended):
- Update PR label to
risk:medium(and explain in the body why the increase). ✔️ - Add a brief sentence in "What & Why" mentioning
isA2AWorkflowhelper to make the change explicit. ✔️ - Add (or document) an integration/E2E test or manual testing steps that reproduce adding/deleting/re-adding an agent loop end-to-end and verify runAfter restoration. If E2E cannot be added here, add the manual test steps + results to the Test Plan. ✔️
- Consider a quick cross-check to ensure no other places rely on
equals(state.workflowKind, 'agent')semantics that were intentionally different. If any exist, either update them or call out why they are intentionally unchanged. ✔️
Please update the PR label and optionally the PR body with the suggested clarifications and testing notes, then mark ready. Thank you for the thorough tests and clear description — this looks like a strong fix; the only change is to increase the risk categorization to medium and document broader validation.
Last updated: Fri, 06 Feb 2026 17:54:22 GMT
Commit Type
Risk Level
What & Why
Run after property wasn't being set properly for A2A workflows in consumption. If the agent loop was deleted, re-adding it would not be valid because the runAfter would not get set back up
Impact of Change
Test Plan
Contributors
Screenshots/Videos