Skip to content

Log MCP client close errors instead of silently swallowing them - #145

Closed
OpenGithubs wants to merge 1 commit into
CopilotKit:mainfrom
OpenGithubs:fix-close-log
Closed

OpenGithubs wants to merge 1 commit into
CopilotKit:mainfrom
OpenGithubs:fix-close-log

Conversation

@OpenGithubs

Copy link
Copy Markdown

Summary

Bug fix: client.close() failures in the MCP and Parallel web-search transports were completely swallowed with .catch(() => {}). This masked transport leaks and connection errors in production — operators had zero visibility into why MCP connections accumulated or refused to close cleanly.

Changes

  • src/server/connections.ts: log close() failure reason
  • src/server/parallel.ts: log close() failure reason

Commits

  • fix-close-log fix: log MCP client close errors instead of silently swallowing them

client.close() failures were completely suppressed with an empty catch. This
masked MCP connection leaks and transport errors in server logs. Now we log
the failure reason so operators can diagnose stuck connections.

Copy link
Copy Markdown
Collaborator

Thanks for working on this. We're consolidating MCP close-error logging in #158, which covers the same cleanup paths, handles non-Error rejection values safely, and adds regression coverage. Closing this duplicate so implementation and review can continue there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants