Add: Debug logging for MCP skill startup time#50
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
dc35ff4 to
b452d71
Compare
b452d71 to
227e7d5
Compare
| transport.stderr.on("data", (chunk: Buffer) => { | ||
| console.log(`[MCP:${skill.name}:stderr] ${chunk.toString().trim()}`) | ||
| }) | ||
| } |
There was a problem hiding this comment.
Bug: Stderr listener attached before process starts, never receives data
The transport.stderr listener is attached at lines 79-82, but the child process isn't spawned until connect() is called at line 85. The StdioClientTransport.stderr property returns the spawned process's stderr stream, which is only available after start() (called internally by connect()). Since transport.stderr is null or undefined before the process starts, the if (transport.stderr) check fails silently, and the stderr listener is never attached. This defeats the main purpose of this PR - stderr output from the MCP skill will never be logged.
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