Add: Skill lifecycle events for MCP startup debugging#51
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
| this._eventListener(event) | ||
| } | ||
| }) | ||
| } |
There was a problem hiding this comment.
Bug: Stderr listener attached before process spawn fails silently
The transport.stderr listener is attached before calling connect(), but StdioClientTransport.stderr only becomes available after the child process is spawned during the start() method (called internally by connect()). At this point, transport.stderr is undefined, so the if (transport.stderr) check fails silently and the listener is never attached. The skillStderr events will never be emitted. The listener needs to be attached after connect() returns, though this may miss early stderr output.
8d52d2e to
ff9f6e2
Compare
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
skillStartingevent emitted when MCP skill initialization beginsskillStderrevent to capture child process stderr outputconnectDurationMsandtotalDurationMsfields toskillConnectedeventBackground
initializeRuntimetoskillConnectedtakes approximately 7 seconds. These structured events help identify the bottleneck (binary startup time vs MCP handshake time).New Events
skillStartingskillStderrskillConnected(updated)Test plan
Closes #49
Note
Introduce
skillStartingandskillStderrevents and add connection timing fields toskillConnected, wiring them into MCP stdio initialization.packages/core/src/schemas/runtime.ts:skillStartingandskillStderrruntime events.skillConnectedwithconnectDurationMsandtotalDurationMs.packages/runtime/src/skill-manager/mcp.ts:skillStartingbefore launching MCP stdio skill (withcommandandargs).skillStderrevents.skillConnectedincluding connection timing metrics.@perstack/coreand@perstack/runtime.Written by Cursor Bugbot for commit ff9f6e2. This will update automatically on new commits. Configure here.