Repository navigation
fix: rename parameters to inputSchema for AI SDK v5 compatibility - #776
Conversation
AI SDK v5 renamed the tool schema property from `parameters` to `inputSchema`. The integration and MCP tool converters still used the old name, causing `streamText()` to receive `undefined` schemas which AI providers rejected with `type: "None"` errors. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughRenames Changes
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related issues
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
📝 Coding Plan
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
packages/lib/src/integrations/converter/ai-sdk.ts (1)
250-264: Consider renaming local variable for clarity.The local variable
parameters(line 250) is assigned to theinputSchemaproperty (line 264). Renaming the local variable toinputSchemawould improve readability.♻️ Suggested rename
try { - const parameters = convertToolSchemaToZod(tool.inputSchema); + const inputSchema = convertToolSchemaToZod(tool.inputSchema); const override = grant.rateLimitOverride; const grantForRequest: ToolGrant = { @@ -261,7 +261,7 @@ tools[toolName] = { description: `[${connection.provider.name}] ${tool.description}`, - inputSchema: parameters, + inputSchema, execute: async (args: Record<string, unknown>) => {🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/lib/src/integrations/converter/ai-sdk.ts` around lines 250 - 264, Rename the local variable parameters to inputSchema to match its usage and improve clarity: change the result of convertToolSchemaToZod(tool.inputSchema) (currently assigned to parameters) to inputSchema and then use that inputSchema when building the tools[toolName] object (where inputSchema is assigned to the inputSchema property); ensure any other references in the surrounding scope (e.g., where parameters is used) are updated accordingly.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@packages/lib/src/integrations/converter/ai-sdk.ts`:
- Around line 250-264: Rename the local variable parameters to inputSchema to
match its usage and improve clarity: change the result of
convertToolSchemaToZod(tool.inputSchema) (currently assigned to parameters) to
inputSchema and then use that inputSchema when building the tools[toolName]
object (where inputSchema is assigned to the inputSchema property); ensure any
other references in the surrounding scope (e.g., where parameters is used) are
updated accordingly.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 093c6490-e028-4760-93fd-5482c6ad93df
📒 Files selected for processing (2)
apps/web/src/lib/ai/core/mcp-tool-converter.tspackages/lib/src/integrations/converter/ai-sdk.ts
The desktop app never imports this module — MCP tools from the desktop client are serialized and sent to the web server, where the web-side converter (apps/web/src/lib/ai/core/mcp-tool-converter.ts) handles the actual JSON Schema → Zod conversion for AI SDK. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…name local var - Remove mcp-tool-name-validation.test.ts and mcp-tool-naming-convention.test.ts which imported from the deleted mcp-tool-converter.ts (CI typecheck failure) - Rename local `parameters` variable to `inputSchema` in ai-sdk.ts converter for consistency (CodeRabbit review feedback) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
Addressed review feedback:
|
The mock CoreTool object in the test was still using the old `parameters` property name, causing the web typecheck CI job to fail. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Summary
parameters→inputSchemain the integration tool converter (CoreToolinterface + object literal) and MCP tool converter (return type + object literal)ai@5.0.54) renamed this property; using the old name causedstreamText()to receiveundefinedschemas, which AI providers rejected withtype: "None"errorsapps/desktop/src/main/mcp-tool-converter.ts) and its 3 test files — the desktop app never imported this module; MCP tools are serialized to the web server where the web-side converter handles conversionTest plan
packages/libintegration converter tests pass (19/19)🤖 Generated with Claude Code
Summary by CodeRabbit
Refactor
Removal
Tests