Fix unable to open AI agent service when extra functions exist#2303
Fix unable to open AI agent service when extra functions exist#2303dan-niles wants to merge 1 commit into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThis PR updates ChangesAI Service Chat Resource Widget
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
ESLint skipped: no ESLint configuration detected in root package.json. To enable, add 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 |
|
@CodeRabbit review |
✅ Actions performedReview triggered.
|
There was a problem hiding this comment.
Pull request overview
Fixes navigation for AI Agent Service nodes in the component diagram by selecting the correct AI chat entry resource (resource function post chat) rather than defaulting to the first discovered function (which could be an unrelated remote function).
Changes:
- Replace “first function wins” selection with an exact match on
accessor === "post" && path === "chat". - Ensure the extra bottom port rendered for the AI service corresponds specifically to the
post chatresource.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| // ai:Listener entry point is fixed to `post chat`. | ||
| const chatResource = (model.node as CDService).resourceFunctions?.find( | ||
| (r) => r.accessor === "post" && r.path === "chat" | ||
| ); | ||
|
|
||
| const handleOnClick = () => { | ||
| if (serviceFunctions.length > 0) { | ||
| onFunctionSelect(serviceFunctions[0]); | ||
| if (chatResource) { | ||
| onFunctionSelect(chatResource); | ||
| } |
|
Actionable comments posted: 0 |
Summary
Fixes wso2/product-integrator#1525
The AI Agent Service entry node in the component diagram picked the first function (remotes first, then resources). A stray
remote function chat— e.g. one mistakenly generated by Copilot alongside the realresource function post chat— would be selected, sending navigation to a location no AI service artifact covers, so the editor failed to open.Now the click target is found by an exact match on
accessor === "post" && path === "chat", which is the only validai:Listenerentry point.Summary by CodeRabbit