Repository navigation
Accept AI SDK 7 in the ai peer range - #82
Open
madster456 wants to merge 1 commit into
Open
madster456 wants to merge 1 commit into
madster456 wants to merge 1 commit into
Conversation
The ai peer range was ^6.0.0-beta.150, so `npm install agentmail-toolkit ai@7` failed with ERESOLVE even though the adapter's tools already run on v7. Widen it to `^6.0.0-beta.150 || ^7.0.0` and add a test that drives the adapter through each major's real generateText tool loop (v7 via an `ai-v7` alias), covering the tool-result and native tool-error paths. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Author
|
A bit of context I should have included up front. I noticed I also checked the v7 changes that could matter for consumers:
Happy to update the example and the docs pin to v7 in a follow-up if you'd like to move them too. |
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
The
aipeer range is^6.0.0-beta.150, which excludes AI SDK 7 (current: 7.0.140). Installing the toolkit next to it fails before any code runs:The adapter itself already works on v7, so this widens the range to
^6.0.0-beta.150 || ^7.0.0. Nothing insrc/changes.The new docs (mintlify-docs
integrations/ai-sdk.mdx) currently tell readers to pinai@6 @ai-sdk/openai@3for this reason. Once this ships, that pin can be dropped in a one-line follow-up.Test
tests/ai-sdk-versions.test.tsruns the adapter's tools through each major's realgenerateTexttool loop with that major's mock model (MockLanguageModelV3for v6,MockLanguageModelV4for v7). The existing adapter tests only callexecute()directly. v7 comes from anai-v7devDependency alias (npm:ai@7.0.140), so it runs in the normalpnpm testwithout any CI change. For each major the test checks that:tool-resultwith normalized output (Date→ ISO string);AgentMailErrorproduces the SDK's nativetool-errorpart with the concise message (inbox not found (HTTP 404)), not a successful result.To confirm the test catches regressions, I made the adapter return the error string instead of throwing. Both
tool-errorcases failed on both majors.Checks
pnpm install --frozen-lockfile,pnpm lint,pnpm build,pnpm test: 677 passed (673 existing + 4 new).tsc --noEmitreports the same 5 errors asmain, none new.airesolved to 7.0.140,src/ai-sdk.tsand a consumer callinggenerateText({ tools: new AgentMailToolkit().getTools() })typecheck cleanly.pnpm pack, thennpm install <tarball> ai@7 zod@4in an empty project. It now resolves withai@7.0.140deduped (previously ERESOLVE), and a two-stepgenerateTextloop runslist_inboxesand finishes.