Skip to content

Fix(designer): consumption SKU agent runAfter bug — restore runAfter when re-adding agent loop#8663

Merged
rllyy97 merged 5 commits intoAzure:mainfrom
wgrooversoftie:fix/consumption-sku-agent-runafter-bug
Jan 26, 2026
Merged

Fix(designer): consumption SKU agent runAfter bug — restore runAfter when re-adding agent loop#8663
rllyy97 merged 5 commits intoAzure:mainfrom
wgrooversoftie:fix/consumption-sku-agent-runafter-bug

Conversation

@wgrooversoftie
Copy link
Contributor

@wgrooversoftie wgrooversoftie commented Dec 15, 2025

Commit Type

  • feature - New functionality
  • fix - Bug fix
  • refactor - Code restructuring without behavior change
  • perf - Performance improvement
  • docs - Documentation update
  • test - Test-related changes
  • chore - Maintenance/tooling

Risk Level

  • Low - Minor changes, limited scope
  • Medium - Moderate changes, some user impact
  • High - Major changes, significant user/system impact

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

  • Users: Bug fixed for users
  • Developers: Replaces equality-checks for workflowKind === 'agent' with isA2AWorkflow(state) helper; tests added. Reviewers should verify the helper's detection criteria and ensure no other code relies on the old equality check semantics.
  • System: No new runtime dependencies. Behavior change could modify how runAfter edges are added in some workflows — recommend testing migration/updating of existing workflows in staging.

Test Plan

  • Unit tests added/updated
  • E2E tests added/updated
  • Manual testing completed
  • Tested in:

Contributors

Screenshots/Videos

- 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
Copilot AI review requested due to automatic review settings December 15, 2025 20:30
Copy link
Contributor

Copilot AI left a 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 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)

@github-actions
Copy link

github-actions bot commented Dec 15, 2025

🤖 AI PR Validation Report

PR Review Results

Thank you for your submission! Here's detailed feedback on your PR title and body compliance:

PR Title

  • Current: Fix(designer): consumption SKU agent runAfter bug — restore runAfter when re-adding agent loop
  • Issue: Title is generally descriptive and scoped. Small suggestion: follow conventional casing for the commit-type prefix (lowercase fix) and make the scope explicit if you primarily changed both designer and designer-v2 (optional).
  • Recommendation: Keep as-is or consider: fix(designer): restore runAfter when re-adding agent loop for consumption SKU (A2A)

Commit Type

  • Properly selected (fix) in the body. Only one option checked which is correct.
  • Note: The PR title also uses Fix(...) — consider lowercase fix(...) to match conventional commit style.

⚠️ Risk Level

  • The PR body marks this as Low and the PR has the risk:low label.
  • Assessment: Based on the code changes, I advise risk:medium.
    • Reason: The change replaces multiple direct equality checks for workflowKind === 'agent' with a new helper isA2AWorkflow(state). This affects runAfter logic across several parser flows (add/delete/move/paste) and could change behavior for existing workflows (edge assignment and runAfter restoration). Although the PR adds comprehensive unit tests, the change has cross-cutting effects on workflow topology and could have user-visible behavior changes that warrant broader validation (integration/E2E / migration testing).
  • Recommendation: Update the PR label to risk:medium and include a short note in the body explaining why a medium risk rating is chosen (detection logic change impacting runAfter behavior broadly).

What & Why

  • Current: 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
  • Issue: The section is concise and sufficient.
  • Recommendation: Optionally expand one sentence to mention the new helper isA2AWorkflow and that detection now supports both Standard SKU and Consumption SKU heuristics (metadata and trigger patterns). Example: "Replaced direct equality checks with isA2AWorkflow helper to correctly detect A2A workflows across Standard and Consumption SKUs and restore runAfter edges when re-adding agent loops."

Impact of Change

  • The Impact section is present and mentions Users/Developers/System impacts.
  • Suggestion: Be explicit about the areas to validate in staging: e.g., existing workflows that may have runAfter edges removed/added during schema migrations, and any tools that rely on the old workflowKind equality check.
  • Recommendation:
    • Users: Bug fix for runAfter restoration in A2A (agent) workflows. Recommend testing a small set of production flows in staging to verify no regressions.
    • Developers: Note changed semantics: isA2AWorkflow(state) replaces workflowKind === 'agent' checks. Review other usages of workflowKind elsewhere to ensure no assumptions were relying on previous equality checks.
    • System: No new runtime deps, but behavior change to how runAfter edges are created — validate migration/updating of existing workflows in staging and consider adding an E2E test to catch regression in graph edge behavior.

Test Plan

  • The PR claims unit tests added/updated and manual testing completed.
  • Verification: The diff includes substantial unit tests added for isA2AWorkflow across both designer and designer-v2 test files. Good coverage for detection logic and many edge cases.
  • Recommendation: Add or run an integration/E2E scenario that exercises adding/deleting/re-adding an agent loop in real workflows to ensure runAfter restoration works end-to-end. If E2E isn't possible in this PR, document the manual test steps and results explicitly in the body.

⚠️ Contributors

  • Current: Section is empty.
  • Assessment: This is optional. If others contributed, please add them. If none, consider adding a short note acknowledging reviewers or saying "No additional contributors." This is not a blocker.

⚠️ Screenshots/Videos

  • Current: Not provided. This is fine because changes are internal/logic-focused.
  • Assessment: No screenshots required. If you test UI behaviors that changed visually, consider adding a short recording or screenshots in future PRs.

Summary Table

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 isA2AWorkflow helper 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

@hartra344 hartra344 changed the title Fix/consumption SKU agent runafter bug Fix: consumption SKU agent runAfter bug — restore runAfter when re-adding agent loop Dec 17, 2025
@rllyy97 rllyy97 added the risk:low Low risk change with minimal impact label Jan 23, 2026
@rllyy97 rllyy97 merged commit a141ef0 into Azure:main Jan 26, 2026
13 checks passed
@Eric-B-Wu Eric-B-Wu changed the title Fix: consumption SKU agent runAfter bug — restore runAfter when re-adding agent loop Fix(designer): consumption SKU agent runAfter bug — restore runAfter when re-adding agent loop Feb 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-validated risk:low Low risk change with minimal impact

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants