Skip to content

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

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

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

Conversation

@dhruv1220

Copy link
Copy Markdown

Closes #145.

What changed

client.close() failures in the MCP session helper (src/server/connections.ts) and the Parallel web-search transport (src/server/parallel.ts) were swallowed with an empty .catch(() => {}). They now log the failure reason through console.error, matching the existing server-side diagnostic convention (see setup-telemetry.ts).

Why

Swallowed close errors masked transport leaks and connection errors in production — operators had zero visibility into why MCP connections accumulated or refused to close cleanly.

Testing

  • New regression test in tests/parallel.test.ts: a rejecting client.close() surfaces the reason via console.error while the successful result still returns (red-checked: fails on unpatched code).
  • tests/parallel.test.ts + tests/workspace.test.ts: 13/13 green.
  • Full suite: 343 passed; the only 2 failures are the pre-existing network-dependent tests/transport.test.ts cases, which fail identically on clean main.
  • tsc --noEmit, eslint, prettier --check clean; production build (npm run build) green.

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.

1 participant