Fix TypeScript type assertion for MCP tools#8
Conversation
Patches `next` 16.2.2 → 16.2.4 (resolves GHSA-q4gf-8mx6-v5v3 DoS), pulls `vite` ≥8.0.5 via vitest (clears two high-severity advisories) and `picomatch` ≥4.0.4 via typescript-eslint (clears two high-severity extglob ReDoS advisories). Also bumps react/react-dom, postcss, prettier, kysely, @ai-sdk/mcp, and @next/eslint-plugin-next within their semver ranges. Tests (355) and lint pass. Typecheck/build fail on a pre-existing error in src/lib/server/llm/ai-sdk-fmp-mcp-tools.ts:234 that reproduces against the unmodified baseline — not introduced by these bumps. https://claude.ai/code/session_01R24hBDBmbRR6LqeRqQesjp
The FlexibleSchema generic in @ai-sdk/mcp's discovered-tools record doesn't structurally match the ai package's ToolSet, even though both shapes are runtime-compatible. Cast at the boundary so wrapToolsWith\ UsageTracking accepts it without restoring the previous typecheck/build failure. https://claude.ai/code/session_01R24hBDBmbRR6LqeRqQesjp
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (2)
📝 WalkthroughWalkthroughDependency version updates across multiple npm packages including Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~5 minutes Poem
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
Fix TypeScript type assertion for MCP tools
Summary
This PR fixes a TypeScript type error in the MCP tools initialization by adding an explicit type assertion for the discovered tools.
Changes
as ToolSetto thediscoveredToolsparameter inwrapToolsWithUsageTracking()call insrc/lib/server/llm/ai-sdk-fmp-mcp-tools.tsDetails
The
discoveredToolsobject returned fromclient.tools()needed an explicitToolSettype assertion to satisfy TypeScript's type checking. This ensures type safety when passing the tools to thewrapToolsWithUsageTracking()function.https://claude.ai/code/session_01R24hBDBmbRR6LqeRqQesjp
Summary by CodeRabbit