Skip to content

Merge upstream/main into MCP sampling branch#2

Merged
cbcoutinho merged 302 commits intofix/mcp-memory-leak-sampling-issuesfrom
claude-merge
Dec 13, 2025
Merged

Merge upstream/main into MCP sampling branch#2
cbcoutinho merged 302 commits intofix/mcp-memory-leak-sampling-issuesfrom
claude-merge

Conversation

@cbcoutinho
Copy link
Copy Markdown
Owner

Summary

This PR merges the latest changes from upstream/main into the fix/mcp-memory-leak-sampling-issues branch to bring it up-to-date before submitting upstream.

Merge Conflicts Resolved

Successfully resolved conflicts in 4 files while preserving both upstream improvements and our MCP sampling support:

1. packages/core/src/tools/mcp-client.ts

  • Upstream changes: Refactored connectToMcpServer to return Client directly (instead of {client, transport})
  • Upstream changes: Added resource support and tool refresh notifications
  • Our changes preserved: MCP sampling support with CreateMessageRequestSchema and cliConfig parameter
  • Integration: Updated connectAndDiscover to work with new return type, removed transport cleanup (now handled internally)

2. packages/core/src/tools/mcp-client-manager.ts

  • Upstream changes: Added onToolsUpdated callback parameter to McpClient constructor
  • Integration: Updated constructor call to pass the callback for tool refresh functionality

3. packages/core/src/utils/events.ts

  • Upstream changes: Refactored event system with cleaner structure
  • Our changes preserved: Added back McpSamplingRequest event and McpSamplingRequestPayload interface

4. packages/core/src/tools/mcp-client.test.ts

  • Upstream changes: Simplified test mock approach
  • Integration: Fixed all test calls to match new signatures and return types

Build Fixes

  • Removed unused imports that were causing linting errors
  • Fixed connectAndDiscover function to handle new Client return type
  • Updated all McpClient constructor calls in tests to pass correct parameters
  • Fixed all connectToMcpServer calls to match new 5-parameter signature

Testing

Build: All packages built successfully
Tests: All 194 test files passed (3644 tests passed)

Changes Summary

  • 4 files with merge conflicts resolved
  • Maintained compatibility with both upstream improvements and MCP sampling feature
  • All tests passing
  • Ready for upstream review

This PR was generated with the help of AI, and reviewed by a Human

joshualitt and others added 30 commits November 20, 2025 19:19
…emini#13488)

Co-authored-by: Vishvananda Abrams <vabrams@google.com>
adamfweidman and others added 29 commits December 10, 2025 21:53
…pport (google-gemini#14737)

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: Jacob Richman <jacob314@gmail.com>
# Conflicts:
#	packages/core/src/tools/mcp-client-manager.ts
#	packages/core/src/tools/mcp-client.test.ts
#	packages/core/src/tools/mcp-client.ts
#	packages/core/src/utils/events.ts
@cbcoutinho cbcoutinho merged commit 2d63c94 into fix/mcp-memory-leak-sampling-issues Dec 13, 2025
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.