Skip to content

fix(DesignerV2): Fix Agent Activity tab disabled for MCP-only agent#9197

Merged
rllyy97 merged 2 commits into
mainfrom
riley/fix/agent-activity-tab-disabled
May 20, 2026
Merged

fix(DesignerV2): Fix Agent Activity tab disabled for MCP-only agent#9197
rllyy97 merged 2 commits into
mainfrom
riley/fix/agent-activity-tab-disabled

Conversation

@rllyy97
Copy link
Copy Markdown
Contributor

@rllyy97 rllyy97 commented May 20, 2026

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

The Agent Activity tab in the designer-v2 run history panel is permanently disabled for workflows where Agent actions only contain MCP client tools (e.g., McpClientTool).

useWorkflowHasAgentLoop checked state.workflow.nodesMetadata for nodes with subgraphType === SUBGRAPH_TYPES.AGENT_CONDITION. However, during deserialization, MCP client tools are assigned SUBGRAPH_TYPES.MCP_CLIENT — not AGENT_CONDITION. Workflows whose Agent actions have only MCP tools never produce an AGENT_CONDITION node, so the selector always returned false.

Changed the selector to check state.workflow.operations for any operation with type === 'agent', matching the v1 designer's existing implementation.

Fixes #9174

Impact of Change

  • Users: Agent Activity tab now correctly appears for all agent workflows, including those with only MCP client tools
  • Developers: No API changes
  • System: No performance or architecture impact — single selector change

Test Plan

  • Unit tests added/updated
  • E2E tests added/updated
  • Manual testing completed
  • Tested in: Traced through customer's workflow definition (Agent action with single McpClientTool) confirming old selector returns false and new selector returns true. Verified v1 designer already uses this approach.

Contributors

Screenshots/Videos

…workflows

useWorkflowHasAgentLoop checked nodesMetadata for AGENT_CONDITION subgraph
types, but MCP client tools (McpClientTool) get MCP_CLIENT subgraph type
instead. Workflows with only MCP tools (no regular agent conditions) would
never produce an AGENT_CONDITION node, leaving the Agent Activity tab
permanently disabled.

Changed the selector to check operations for type 'agent', matching the
v1 designer's existing implementation.

Fixes #9174
Copilot AI review requested due to automatic review settings May 20, 2026 16:18
@rllyy97 rllyy97 added the risk:low Low risk change with minimal impact label May 20, 2026
@rllyy97 rllyy97 enabled auto-merge (squash) May 20, 2026 16:26
Copy link
Copy Markdown
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.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 20, 2026

🤖 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(DesignerV2): Fix Agent Activity tab disabled for MCP-only agent
  • Issue: None — title is clear, follows conventional commit style, and explains the problem and area touched.
  • Recommendation: (No change needed.)

Commit Type

  • Properly selected (fix).
  • Only one option selected which is correct for this change.

Risk Level

  • Label risk:low is present on the PR and the PR body selected Low.
  • Assessment from the code diff (2 additions, 2 deletions — selector change only) also indicates low risk.

What & Why

  • Current: The body explains the bug (Agent Activity tab disabled when workflows only include MCP client tools) and why it happened (selector checked nodesMetadata for AGENT_CONDITION; MCP tools use MCP_CLIENT). It explains the fix (change selector to check operations for type 'agent').
  • Issue: None — explanation is concise and ties directly to code change.
  • Recommendation: (No change needed.)

Impact of Change

  • The PR body lists Users/Developers/System impact and correctly states there are no API or systemic changes beyond the selector logic.
  • Recommendation: (No change needed.)

⚠️ Test Plan

  • Assessment: Manual testing was completed and documented (including tracing a customer workflow and confirming behavior). No unit or E2E tests were added.
  • Issue: There are no unit tests or E2E tests added for this selector change. While the manual testing rationale is reasonable, this selector is core UI logic and is easy to cover with a small unit test.
  • Recommendation: Add a simple unit test for the selector/useWorkflowHasAgentLoop that covers at least:
    • A workflow where operations contain an operation with type: 'agent' (should return true).
    • A workflow where there are only MCP client nodes but no operation with type: 'agent' (should return false) — or vice versa depending on desired behavior. This will prevent regressions and remove ambiguity in future changes.
    • Update the Test Plan checkboxes in the PR body to mark unit tests added/updated once you include them.

⚠️ Contributors

  • Assessment: The Contributors section is blank.
  • Recommendation: Add contributors (PMs, designers, reviewers) if others provided input — helpful for credit tracking. This is optional and not a blocker.

⚠️ Screenshots/Videos

  • Assessment: No screenshots/videos included. This is fine since the change is a logic/selector change and not a visible UI layout change.
  • Recommendation: No action required unless you want to show before/after behavior in the designer UI.

Summary Table

Section Status Recommendation
Title None
Commit Type None
Risk Level None
What & Why None
Impact of Change None
Test Plan ⚠️ Add a small unit test for the selector; update checkboxes once added
Contributors ⚠️ Optional: add any contributors for credit
Screenshots/Videos ⚠️ Not required for this change

Final Message
Thanks — this PR is well-written and follows the template. The risk label matches the actual change in the code (low). The only actionable suggestion is to add a small unit test for the updated selector (useWorkflowHasAgentLoop) to prevent regressions and to update the Test Plan checkboxes in the PR body. Optionally, fill out the Contributors section if others assisted. Once you add the unit test (or leave a short rationale why a unit test is not applicable), this PR can be considered fully documented and well-covered. Thank you!


Last updated: Wed, 20 May 2026 18:55:31 GMT

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 20, 2026

📊 Coverage Check

The following changed files need attention:

⚠️ libs/designer-v2/src/lib/core/state/designerView/designerViewSelectors.ts - 61% covered (needs improvement)

Please add tests for the uncovered files before merging.

@rllyy97 rllyy97 merged commit 327858e into main May 20, 2026
18 checks passed
@rllyy97 rllyy97 deleted the riley/fix/agent-activity-tab-disabled branch May 20, 2026 17:05
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.

No agent log in designer v2

3 participants