Fix typecheck and lint errors for AI SDK v6 upgrade#214
Closed
sethconvex wants to merge 55 commits intomainfrom
Closed
Fix typecheck and lint errors for AI SDK v6 upgrade#214sethconvex wants to merge 55 commits intomainfrom
sethconvex wants to merge 55 commits intomainfrom
Conversation
Co-authored-by: zboyles <2215540+zboyles@users.noreply.github.com>
Co-authored-by: zboyles <2215540+zboyles@users.noreply.github.com>
Document version alignment strategy with AI SDK in CHANGELOG
Co-authored-by: zboyles <2215540+zboyles@users.noreply.github.com>
- Update LanguageModelV2 to LanguageModelV3 in mockModel.ts - Update example type declarations to use LanguageModelV3 - Add embeddingModel to Config (deprecate textEmbeddingModel) - Update Agent class to support both embeddingModel and textEmbeddingModel - Remove mode field from generateObject call (deprecated in v6) - Update search.ts and saveInputMessages.ts to support both embedding fields Co-authored-by: zboyles <2215540+zboyles@users.noreply.github.com>
Remove @openrouter/ai-sdk-provider dependency and migrate to AI SDK v3
Trigger pkg pr new build for the AI SDK v6 update
Co-authored-by: zboyles <2215540+zboyles@users.noreply.github.com>
…referred key Co-authored-by: zboyles <2215540+zboyles@users.noreply.github.com>
Update AI SDK packages to latest versions
Two fixes: 1. normalizeToolResult in mapping.ts was stripping the isError flag. Now preserves isError when transforming tool result parts. 2. createAssistantUIMessage in UIMessages.ts now checks contentPart.isError in addition to message.error when determining tool state. This ensures tool results with isError: true show "output-error" state instead of incorrectly showing "output-available". Fixes #162 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
…g in UIMessages
…mpatibility Co-authored-by: zboyles <2215540+zboyles@users.noreply.github.com>
Co-authored-by: zboyles <2215540+zboyles@users.noreply.github.com>
…-213 Merge upstream PRs #211, #212, and #213 created by @sethconvex
…and context handling - Introduced new types for tool execution and approval functions. - Added support for input examples, strict mode, and tool approval logic. - Updated the function signature to accommodate new properties and ensure compatibility with existing functionality.
…se types, update existing type definitions, and deprecate certain fields in favor of new alternatives.
…validators, updating serialization logic and deprecating the 'args' field in favor of 'input'.
- Updated component schema to use optional mediaType and mimeType - Updated files.ts addFile mutation to accept both mediaType and mimeType - Updated client files.ts to use mediaType when calling component - Updated getFile to support both mediaType and mimeType from database - Updated mapping.ts to return mediaType instead of mimeType - Maintained backwards compatibility throughout Co-authored-by: zboyles <2215540+zboyles@users.noreply.github.com>
Co-authored-by: zboyles <2215540+zboyles@users.noreply.github.com>
- Updated all file part definitions in generated component.ts - Changed mimeType from required to optional - Added mediaType as optional field - Resolved all TypeScript type errors related to mimeType/mediaType Co-authored-by: zboyles <2215540+zboyles@users.noreply.github.com>
Co-authored-by: zboyles <2215540+zboyles@users.noreply.github.com>
…t types Co-authored-by: zboyles <2215540+zboyles@users.noreply.github.com>
Co-authored-by: zboyles <2215540+zboyles@users.noreply.github.com>
…in generated types. Ran `convex codegen --component-dir ./src/component`.
…itions for consistency
Co-authored-by: zboyles <2215540+zboyles@users.noreply.github.com>
…esult output types Co-authored-by: zboyles <2215540+zboyles@users.noreply.github.com>
…plan Fix AI SDK v6 type errors: tool-call input/args union type and tool-result output types
[WIP] Update createTool to support AI SDK v5 and v6 features
- Implemented handling of `tool-approval-request` and `tool-approval-response` in `deltas.ts` to update tool state accordingly. - Enhanced tests in `deltas.test.ts` and `toUIMessages.test.ts` to verify the approval workflow, including state transitions for approval requests and responses. - Updated `UIMessages.ts` to manage tool approval states and responses, ensuring correct state updates for tool calls based on approval outcomes.
…t` and `tool-approval-response`.
…tToolApprovals`. Without the fix, the tool call was being filtered out because it had no tool-result, even though it had an approval response - which caused the SDK to fail at line 91 in `ai/src/generate-text/collect-tool-approvals.ts`.
…rove deprecation handling.
…result errors since stored messages have the complete data.
… tool approval, as stored messages contain complete context.
Tool approval flow is working to the point a call is approved, assuming the user sends the tool approval response (save message/start streaming), this will automatically execute the tool and save the results to messages and stops the response before sharing the results with the model. Need to investigate continuing the stream as in multi-step tool calls.
- Upgrade @convex-dev/rag from 0.6.1 to 0.7.0 RAG 0.7.0 uses ai@^6.0.0 (compatible with v6), while 0.6.x used AI SDK v5 types (EmbeddingModelV2) causing type conflicts - Fix unused type params in Output interface (src/client/types.ts) Prefix with _ to indicate intentionally unused for type signature compatibility - Remove unused vContent import (src/mapping.ts) Co-Authored-By: Claude <noreply@anthropic.com>
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the 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 |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Fixes typecheck and lint errors that block PR #208 (AI SDK v6 upgrade).
Changes
Upgrade @convex-dev/rag from 0.6.1 to 0.7.0
ai@^6.0.0(AI SDK v6 compatible)EmbeddingModelV2) causing type conflicts withEmbeddingModelV3Fix unused type params in
Outputinterface (src/client/types.ts)_to indicate intentionally unused for type signature compatibilityRemove unused import
vContent(src/mapping.ts)Verification (on top of #208)
npm run typecheckpassesnpm run lintpasses (0 errors, 0 warnings)npm testpasses (210 tests)🤖 Generated with Claude Code