Render agent tool on diagram when connections are missing#1579
Render agent tool on diagram when connections are missing#1579
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review infoConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughAdds defensive guards and optional chaining across diagram components and a utility; also creates connector nodes for tools missing mediators in the visitor, preventing runtime errors and unrepresented tools. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 1 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (1 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In
`@workspaces/mi/mi-diagram/src/components/nodes/AIAgentNode/AiAgentNodeWidget.tsx`:
- Around line 302-305: The guard in AiAgentNodeWidget that checks for
connectorData exits early but never clears the loading flag, leaving the circle
icon stuck in loading; in the block that currently logs the error for missing
connectorData (the if (!connectorData) check referencing stNode.tag), call the
component's state setter to unset isLoading (e.g., setIsLoading(false)) before
returning so the UI exits loading mode, and ensure any related cleanup (timeouts
or effects watching isLoading) is also handled if present.
In
`@workspaces/mi/mi-diagram/src/components/nodes/ConnectorNode/ConnectorNodeWidget.tsx`:
- Around line 170-172: The GetConnectorIconRequest requires a non-null
connectorName but the ConnectorNodeWidget currently passes
node.stNode?.connectorName ?? (node.stNode as any).mediator?.connectorName which
can be undefined; before calling getConnectorIcon (or building the
GetConnectorIconRequest) check for a valid connectorName extracted from
node.stNode or mediator and if absent either skip the RPC call (avoid calling
getConnectorIcon) or supply a safe fallback name/icon; update the code around
ConnectorNodeWidget to guard the getConnectorIcon invocation and only
construct/send GetConnectorIconRequest when connectorName is a non-empty string.
ℹ️ Review info
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
workspaces/mi/mi-diagram/src/components/nodes/AIAgentNode/AiAgentNodeWidget.tsxworkspaces/mi/mi-diagram/src/components/nodes/ConnectorNode/ConnectorNodeWidget.tsxworkspaces/mi/mi-diagram/src/utils/commons.tsworkspaces/mi/mi-diagram/src/visitors/NodeFactoryVisitor.ts
Purpose
Goals
Approach
UI Component Development
npm run storybookfrom the root directory to view current components.Manage Icons
User stories
Release note
Documentation
Training
Certification
Marketing
Automation tests
Security checks
Samples
Related PRs
Migrations (if applicable)
Test environment
Learning
Summary by CodeRabbit
Bug Fixes
Improvements