Skip to content

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: consumption SKU agent runAfter bug — restore runAfter when re-adding agent loop
  • Issue: None significant — title is clear and describes the bug and intent.
  • Recommendation: Keep as-is. Optionally you can prefix with the repository's conventional commit style if required (e.g., fix(designer): ...) to improve automation/routing.

Commit Type

  • Properly selected (fix).
  • Note: Only one commit type was selected which is correct for this change.

Risk Level

  • You marked the Risk Level as Low in the PR body, but the PR is missing the repository risk label (e.g. risk:low, risk:medium, risk:high). The PR currently only has the label: needs-pr-update.
  • Assessment: Based on the code diff (changes in multiple core parsers that alter runAfter behavior across both designer and designer-v2, and touching 10 files with 638 additions / 20 deletions), I advise a higher risk level than Low — Medium. This is a behavior-affecting change to workflow graph manipulation and runAfter edge logic and could impact existing workflows in some scenarios.
    • Recommendation: Add the corresponding repo label risk:medium (or change the PR body Risk Level to Medium and add the matching label). If you believe the change is truly Low risk, please add a note explaining why the behavior change is constrained and include evidence from testing (e.g., coverage of migration scenarios, thorough staging test results).

What & Why

  • Current: "Run after property wasn't being set properly for A2A workflows in consumption..."
  • Issue: None major — it explains the bug and cause succinctly.
  • Recommendation: Optionally add a one-line example of the user-observed failure (e.g., "When re-adding an agent loop, node X had no runAfter and caused Y"). This can help reviewers quickly reason about risk and tests.

Impact of Change

  • The Impact section is present and mentions Users, Developers, and System.
  • Issue: Consider calling out any migration or backward-compat concerns explicitly (you briefly recommended staging testing — good). Also clarify whether persisted workflows will be re-evaluated or if only in-editor behavior changes.
  • Recommendation:
    • Users: Clarify which user scenarios are fixed (e.g., re-adding agent loop in Consumption SKU A2A workflows — triggers' downstream nodes get runAfter restored).
    • Developers: Call out where other code might rely on the old equality check and if you scanned those files (you already suggested reviewers verify helper detection criteria — good).
    • System: Add note about whether this change alters saved workflow JSON or only the designer in-memory behavior.

Test Plan

  • Unit tests added/updated are present in both libs/designer and libs/designer-v2 test files (helper.spec.ts additions). Good.
  • E2E tests: none added. Manual testing: checked in PR body.
  • Recommendation: Add an E2E or integration test that covers the re-add-agent-loop scenario end-to-end, or include a short note explaining why E2E is unnecessary. Also include the test command(s) used and where these tests were executed (local / CI / environment) in the Test Plan to help reviewers reproduce.

⚠️ Contributors

  • Assessment: Empty.
  • Recommendation: Add contributor credits if PMs, designers, or other engineers helped. This is optional but appreciated.

Screenshots/Videos

  • Assessment: Not applicable for code change. No visual artifacts required.

Summary Table

Section Status Recommendation
Title Keep as-is or align with conventional commit prefix if used in repo
Commit Type None
Risk Level Add repo label risk:medium and/or update PR body risk to Medium and justify if you think Low is correct
What & Why Optionally add a short user-observed example
Impact of Change Clarify migration/backwards-compat details
Test Plan Add E2E/integration test or documented rationale for not adding one; include how/where tests ran
Contributors ⚠️ Consider adding credits
Screenshots/Videos Not required

Final message
Please address the risk-label mismatch and add the repo risk label (risk:medium) or update the PR body to justify keeping Low. Also consider adding an E2E/integration test (or a clear rationale for why none is needed) that validates the full re-add-agent-loop flow in a staging-like environment.

Quick actionable checklist to update PR before merging:

  • Add repo label: risk:medium (or risk:low with a detailed justification). This must match the "Risk Level" section in the PR body.
  • If you keep the PR Risk Level as Low, add a short explanation in the PR body explaining why this behavioral change is limited and why it cannot affect other workflows.
  • Add or reference an E2E/integration test covering re-adding an agent loop in Consumption SKU or explain why it is not necessary.
  • Optionally add contributor credits and a short repro example under "What & Why" to make the user impact clearer.

Thanks — once the risk label is added/updated and you either add an E2E test or justify its absence, this PR will be in much better shape for final review and merge.


Last updated: Tue, 06 Jan 2026 21:18:02 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant