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 — the title is descriptive and explains the fix. (Optional: some repos prefer omitting the Fix: prefix in titles; adjust to repo convention if needed.)
  • Recommendation: Keep as-is, or optionally use: Restore runAfter when re-adding agent loop for consumption SKU to avoid the prefix.

⚠️ Commit Type

  • Properly selected (fix).
  • Only one selection is checked, which is correct.

⚠️ Risk Level

  • Assessment: PR body and labels declare Low risk and risk:low label is present.
  • Issue: Based on the code diff this PR modifies runAfter handling across multiple parser modules in both libs/designer and libs/designer-v2 (10 files changed, +638 additions / -20 deletions). The change replaces direct equality checks (workflowKind === 'agent') with a new helper (isA2AWorkflow) which alters runtime behavior for when runAfter edges are added/reassigned.
  • Recommendation: Update the PR risk to Medium (and change/add label to risk:medium) because this is a behavioral change that affects workflow edge handling and could impact existing workflows in staging/production. The tests added mitigate risk, but this still warrants a Medium label and targeted staging verification.

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: None — explanation is concise and clear.
  • Recommendation: Optionally add a short sentence noting that a new helper isA2AWorkflow was introduced and why it's preferred over direct equality checks (i.e., accounts for both Standard and Consumption detection heuristics).

Impact of Change

  • Impact is documented and highlights users/developers/system.
  • Recommendation: Add one concrete QA step to the Impact section: e.g., "Verify runAfter edges for existing consumption A2A workflows in staging, and confirm no regressions for standard workflows."
    • Users: Existing consumption A2A workflows may observe changes to runAfter behavior — validate in staging.
    • Developers: The equality-check usage has been replaced by the isA2AWorkflow helper; ensure other code paths don't rely on the old semantics.
    • System: No new runtime dependencies, but behavior change in edge handling — perform regression testing, and consider adding a short migration verification plan.

⚠️ Test Plan

  • Assessment: Unit tests were added/updated (helper.spec.ts additions are present). Manual testing is also checked.
  • Issue: No E2E tests were added. Given this is a behavioral change across parsers that affects edges/runAfter, consider adding an E2E test or an explicit QA checklist that verifies behavior in staging.
  • Recommendation: Either add an E2E test that exercises deleting and re-adding agent loops in a consumption workflow, or document a clear manual test plan for reviewers/QA to follow.

⚠️ Contributors

  • Assessment: Section is blank in PR body.
  • Recommendation: Add names/handles of contributors (PM, designers, reviewers) who helped. If there truly are none, add a short note (e.g., "No additional contributors"). This helps with credit and review traceability.

Screenshots/Videos

  • Assessment: Not applicable (no visual changes) — acceptable to leave blank.

Summary Table

Section Status Recommendation
Title Keep current title or drop Fix: prefix if repo prefers.
Commit Type Correct (fix).
Risk Level ⚠️ Change to Medium (update PR body + labels) due to behavioral changes across multiple parser files.
What & Why Add a one-line note about the new isA2AWorkflow helper.
Impact of Change Add a staging QA step to verify runAfter edges for consumption A2A workflows.
Test Plan ⚠️ Unit tests present — please add E2E or an explicit QA checklist.
Contributors ⚠️ Add contributors or note none.
Screenshots/Videos N/A — acceptable.

Final Notes

  • Advised risk: Medium (higher than the submitter's Low). Please update the PR body selection and the repo label to risk:medium to reflect the behavioral scope.
  • Tests: Unit tests for the helper are included (good). Please either:
    1. add an E2E test that covers deleting and re-adding an agent loop in a consumption workflow and verifies runAfter restoration; or
    2. add a clear manual QA checklist and mark which environments/staging scenarios were validated.
  • Contributors: Add the names/handles of contributors or annotate if none.

Please update the PR risk label and the Test Plan (E2E or QA checklist) and re-submit — thanks for the thorough tests and clear PR description!

(PR diff summary: 10 files changed, +638 additions, -20 deletions.)


Last updated: Fri, 23 Jan 2026 23:28:08 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
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