You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This splits out the non-controversial fixes from #1148 as requested. Includes the client-pool timeout/dedup logic + tests, and defensive schema updates for auth.
The MCPClientPool addition (common/src/mcp/client-pool.ts) is the strong part of this PR: clean dedup-on-connect logic, timeout handling via withTimeout, and a leak-avoidance path that closes a stale connection if it resolves after a timeout fires. The four tests in client-pool.test.ts cover the real edge cases — concurrent dedup, retry-after-failure, partial/full close, and timeout-then-retry — and they read as if they'd actually catch a regression, not just pad coverage. This part is ready to be ported.
Two things worth tightening before/at port time:
This diff adds the pool but doesn't wire it into any existing MCP connection path. That's fine if the integration lives in the parent PR (feat: Hermes architecture, Agentic UI, and CLI optimizations #1148) and this really is just the isolated primitive, but as a standalone diff there's no way to see it's actually exercised by real callers. Worth saying explicitly in the PR body which call site will consume this.
cli/src/utils/auth.ts: relaxing name/email from z.string() to z.string().nullish() is a real behavior change with no test and no explanation of what response was failing validation. "Defensive" schema loosening on auth data is exactly the kind of change that can silently paper over a real upstream bug (e.g., a provider returning malformed user info) rather than fix it. Please include a repro or a comment on which auth flow produces null/missing name or email, and ideally a regression test in the same style as the pool tests.
Net: the pool code is a clean, mergeable-quality contribution. The auth.ts hunk is small but needs justification.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This splits out the non-controversial fixes from #1148 as requested. Includes the client-pool timeout/dedup logic + tests, and defensive schema updates for auth.