Fix: Add explicit error when delegate expert not found#9
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
This PR is being reviewed by Cursor Bugbot
Details
You are on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle.
To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.
| const delegate = experts[delegateExpertName] | ||
| if (!delegate) { | ||
| throw new Error(`Delegate expert "${delegateExpertName}" not found in experts`) | ||
| } |
There was a problem hiding this comment.
Bug: Resource leak when delegate expert not found
When a delegate expert is not found, the error is thrown after MCP and interactive skill managers have already been initialized (via initSkillManagersWithCleanup calls at lines 59 and 68). Since the error escapes from within the .map() callback without any cleanup, these already-initialized managers are never closed. This can cause resource leaks such as unclosed MCP server connections. The allManagers array contains initialized managers that need close() called on them before throwing.
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
Summary
Test plan
Note
Add explicit error when a delegate expert is not found during skill manager initialization; update review report and changeset metadata.
packages/runtime/src/skill-manager/helpers.tsby throwingError("Delegate expert \"{name}\" not found in experts")when a delegate is missing duringgetSkillManagersinitialization.CODE_REVIEW_REPORT.mdto mark the issue as fixed and add commitcc23849."@perstack/runtime": patchin.changeset/fix-delegate-expert-not-found.md.Written by Cursor Bugbot for commit 3ea1452. This will update automatically on new commits. Configure here.