Skip to content

refactor(mcp): share the bundle client connection lifecycle - #122

Merged
vincentkoc merged 1 commit into
mainfrom
refactor/bundle-client-lifetime
Nov 20, 2026
Merged

vincentkoc merged 1 commit into
mainfrom
refactor/bundle-client-lifetime

Conversation

@vincentkoc

Copy link
Copy Markdown
Member

Summary

Bundle MCP discovery, tool calls, and resource or prompt requests each managed their own connection cleanup. They now share one connection deadline and one place that waits for the request to settle and closes the client. This keeps stdio, SSE, and streamable HTTP on the same lifecycle while preserving operation-specific request parameters and results.

The real stdio fixture exercises tool arguments, resource URIs, prompt arguments, and capability-based tool generation. Focused tests check that a stalled connection closes before dispatch, and that an asynchronous request failure reaches the caller after cleanup.

Compatibility

This covers Claude Code and Codex bundle MCP clients. Transport construction, advertised capabilities, pagination budgets, cancellation signals, and the generated tool contract retain their existing behavior. The emitted bundle declarations matched the base revision byte for byte.

Verification

  • Compared 144 base and branch traces using the installed SDK with controlled connection and operation outcomes. The traces matched across three transports, six operations, and eight outcomes, including timeout and cleanup errors.
  • Ran the full build and test gate with two workers. 390 tests passed and two platform-specific tests were skipped. Two stdio cases timed out on an initial local run and passed both on retry and in the full suite.
  • Ran the packed-consumer gate with the offline npm cache. CLI, MCP, runtime, declarations, and rollback passed.
  • Checked the diff for generated output, private paths, and credentials.

@vincentkoc vincentkoc self-assigned this Nov 20, 2026
@clawsweeper

clawsweeper Bot commented Nov 20, 2026

Copy link
Copy Markdown

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@vincentkoc
vincentkoc marked this pull request as ready for review November 20, 2026 15:59
@vincentkoc
vincentkoc merged commit f07430a into main Nov 20, 2026
15 of 16 checks passed
@vincentkoc
vincentkoc deleted the refactor/bundle-client-lifetime branch November 20, 2026 16:06
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