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
Tracking issue for upgrading the monorepo from AI SDK v6 → v7 across every submodule that depends on it. AI SDK 7 shipped 2026-06 (blog, announce); we are currently all-v6 and nothing is broken — the deprecated v6 helpers keep working until v8, so there is no forced deadline. This issue coordinates the per-repo upgrade work and links out to the PR in each submodule.
Decision 2026-06-25 — marketing is removed from this migration (not upgraded). The PoC bump surfaced that marketing's AI SDK usage is entirely dead code: the hero chat demo was deleted in marketing#31, leaving lib/agent/* orphaned (imported by nothing), ai consumed only by that dead code, and @ai-sdk/react unused. YAGNI call (sweets): delete the dead code + drop the packages rather than upgrade them — which also kills the dependency-scan false positive that put marketing on this list. See marketing#33.
Goal
Every submodule that imports ai / @ai-sdk/* runs on v7 (ai@7, @ai-sdk/*@latest), builds clean (the gate), and passes its tests. Mechanical renames are applied via the official codemod; the one piece of genuine engineering is the agent context redesign in api and open-agents. Done means: all six repos bumped and green on their target branch, no remaining v6-only API calls, and the two deprecated stream-helper call sites either migrated or consciously left (they still work in v7).
🔄 open — all checks green (CI test/lint/format + Vercel build); awaiting merge
none yet
open-agents v7 bump + context redesign
main
⏳ not started
Merge sequencing — smallest blast radius first:chat → api → open-agents. (Dropped 2026-06-25, codebases no longer in use: bash, tasks. marketing was a dead-code removal, not an upgrade — see decision above.) api and open-agents are last because they carry the context-architecture work, not just a codemod pass. Rows get real PR links as each branch opens.
What shipped (context — current state, all v6)
Repo
ai
Surface
Module/Zod readiness
api
6.0.190
Large — full custom agent harness (lib/agent/tools/*, workflow runners)
"type": "module", Zod 4 ✅
open-agents
6.0.165
Large — packages/agent tool/agent harness + apps/web
agent pkg "type": "module", Zod 4 ✅
chat
6.0.165
Medium — generateText/generateObject, @ai-sdk/react useChat
no "type": "module", Zod 3⚠️
marketing
6.0.154
Removed from migration — the only AI SDK usage (lib/agent/* + ai/@ai-sdk/react) was dead code from the demo deleted in marketing#31. Deleted in marketing#33.
n/a
All repos are Next 16 / Node 22 era, so v7's Node 22+ minimum is already met.
Done
marketing — removed dead AI SDK demo code + 8 orphaned deps (NOT upgraded). (marketing#33)
✅ Shipped 2026-06-25 (squash-merged to main, merge commit 15507a3, by sweetmantech).
Deleted lib/agent/ (system-prompt.ts, tools/index.ts, tools/similar-artists.ts) and removed 8 orphaned packages — ai, @ai-sdk/react, streamdown, @streamdown/{cjk,code,math,mermaid}, use-stick-to-bottom, nanoid — all leftovers from the hero chat demo deleted in marketing#31. Kept zod (used by subscribe/book/valuation/lead routes + post-schema.ts). Net 296 deletions, 0 additions. The earlier scan flagged marketing for a v7 bump; in fact none of this code ran, so the YAGNI removal also kills that dependency-scan false positive.
Verified: tsc --noEmit clean (no module-not-found from the deletions = proof they were unused), next build compiles + typechecks, 67/67 vitest pass, and Vercel preview green (full prerender, real env). Browser regression on the preview: valuation artist-search flow works end-to-end (live /api/spotify/search autocomplete → select → "Value my catalog" enables), zero console errors — nothing the removed packages touched broke. verification.
Open — next up (in merge order; pick from the top)
Shipped (pending merge):ai 6.0.165→7.0.2; @ai-sdk/react/anthropic/google/openai 3→4, gateway 3→4, @ai-sdk/mcp 0.0.11→2; zod floor →^3.25.76. Codemod handled the mechanical renames (isToolOrDynamicToolUIPart→isToolUIPart, experimental_generateImage→generateImage, system→instructions). Manual fixes: kept useChat's onFinish (codemod wrongly applied the core onFinish→onEnd to the hook — @ai-sdk/react keeps onFinish); kept the local generateText/generateArray{ system } wrapper API and pass instructions: system inward; dropped content/createdAt from UIMessage test fixtures (v7 is parts-only). generateObject retained (alive in v7).
Verified:tsc clean, 72/72 vitest, CI unit tests green, full-env Vercel build green, CodeRabbit + cubic pass. verification.
Note: no system-in-messages[] rejection issue surfaced; chat's lone system: was the txt-email wrapper, handled above.
Done when: merged to test, then test→main per repo flow.
Open — the real work (do last; these are migrations, not codemod passes)
api — v7 bump + typed tool context. (api#716 — open, all checks green, awaiting merge)
Outcome — less scary than predicted: the agent harness survived v7 (ToolLoopAgent, the agent loop, context passthrough all still exist). It was a rename + typed-context migration, not a ground-up redesign, and not a Zod-duplication issue (a zod override tried during diagnosis was removed).
Build gotcha (will recur in open-agents — same gateway+Workflow stack): v7's @ai-sdk/gateway@4 pulls in @vercel/oidc, which does a runtime require('./get-vercel-oidc-token.js'). Turbopack refuses to bundle the dynamic require → switched to next build --webpack (matches chat/marketing); webpack then mis-resolved the internal require when bundled → added @vercel/oidc to serverExternalPackages + as a direct dep so Node loads it natively.
The real v7 change: v7 infers a tool's context as never unless declared, breaking both the tool() overloads (TS2769) and toolsContext. Fix: annotate every context-using tool's execute 2nd arg : ToolExecutionOptions<AgentContext>. v7 also split experimental_context into a per-tool-name toolsContext map ({ bash: ctx, glob: ctx, … }) — added lib/agent/tools/buildToolsContext.ts to fan the single AgentContext out per tool key; wired into runAgentStep + taskTool.
Also: usage token shape (nested inputTokenDetails/outputTokenDetails; addLanguageModelUsage codemod-doubling, ZERO_USAGE, recordCreditDeduction); GoogleProviderOptions→GoogleGenerativeAIProviderOptions; ToolLoopAgent 4th generic (RoutingDecision/ChatConfig); reverted codemod over-applications (local { system } wrappers, toolChain system→instructions types, webFetch discriminant/param-default). Test fixtures aligned to v7, no weakened assertions.
Verified: source tsc --noEmit0 errors, pnpm test3676 passed / 659 files. (~199 pre-existing __tests__ type-debt errors in unrelated domains left untouched; all tests pass at runtime.)
Done when: CI + full-env Vercel preview green, then merged to test → main per repo flow.
Why: Same shape as api — packages/agent/tools/* + subagents/* use experimental_context throughout (part of the 118-hit total above); apps/web/app/api/chat/_lib/request.ts too. Monorepo (packages/agent + apps/web), so bump the workspace catalog + both packages.
Fix: codemod across the workspace, bump ai/@ai-sdk/* in packages/agent and apps/web, manually rework context threading to v7 model, rerun the agent's own tests (packages/agent/tools/tools.test.ts).
Done when: workspace builds, packages/agent tests pass, an end-to-end agent run works on a preview deploy.
Architecture decisions
Codemod-first, then manual. Run npx @ai-sdk/codemod v7 per repo for the ~35 mechanical renames (system→instructions, experimental_output→output, experimental_telemetry→telemetry, stepCountIs→isStepCount, fullStream→stream, onFinish→onEnd, usage.reasoningTokens→usage.outputTokenDetails.reasoningTokens, GoogleGenerativeAI*→Google*, experimental_context→context, …). Treat the codemod output as a draft — the context redesign in api/open-agents is hand-written.
Build is the gate. Per repo convention, pnpm build (and pnpm exec tsc --noEmit in api) is the pass/fail gate; vitest where it exists. v6→v7 is not runtime-breaking for the deprecated helpers, so green build + a preview smoke test is the bar.
No forced deadline. v6 helpers (toUIMessageStream*, toTextStreamResponse, pipe*) are @deprecated in v7 but functional until v8. We migrate deliberately, smallest-risk-first, not under time pressure.
One PR per submodule, own branch. Each repo is an independent git repo; api/chat target test, the rest target main.
Accepted regressions / tradeoffs
The one remaining deprecated stream-helper call site — api/app/lib/workflows/runAgentStep.ts (toUIMessageStream) — may be left on the deprecated path initially to keep the v7 bump small; it works in v7 and only breaks in v8. Tracked here so it isn't forgotten before the v8 jump. (The marketing toUIMessageStreamResponse site noted in the original scan is gone — removed from main in marketing#31.)
Impact scan (2026-06-25): experimental_context = 118 hits / ~45 files across api + open-agents; deprecated stream helpers = 1 real call site on main (apirunAgentStep.ts; the marketing site was already removed in marketing#31).
Tracking issue for upgrading the monorepo from AI SDK v6 → v7 across every submodule that depends on it. AI SDK 7 shipped 2026-06 (blog, announce); we are currently all-v6 and nothing is broken — the deprecated v6 helpers keep working until v8, so there is no forced deadline. This issue coordinates the per-repo upgrade work and links out to the PR in each submodule.
Goal
Every submodule that imports
ai/@ai-sdk/*runs on v7 (ai@7,@ai-sdk/*@latest), builds clean (the gate), and passes its tests. Mechanical renames are applied via the official codemod; the one piece of genuine engineering is the agent context redesign inapiandopen-agents. Done means: all six repos bumped and green on their target branch, no remaining v6-only API calls, and the two deprecated stream-helper call sites either migrated or consciously left (they still work in v7).Reference: v6→v7 migration guide · codemod
npx @ai-sdk/codemod v7· guided skillnpx skills add vercel/ai --skill migrate-ai-sdk-v6-to-v7.PRs (updated 2026-06-25)
maintesttestmainWhat shipped (context — current state, all v6)
ai6.0.190lib/agent/tools/*, workflow runners)"type": "module", Zod 4 ✅6.0.165packages/agenttool/agent harness +apps/web"type": "module", Zod 4 ✅6.0.165generateText/generateObject,@ai-sdk/reactuseChat"type": "module", Zod 3marketing6.0.154lib/agent/*+ai/@ai-sdk/react) was dead code from the demo deleted in marketing#31. Deleted in marketing#33.All repos are Next 16 / Node 22 era, so v7's Node 22+ minimum is already met.
Done
✅ Shipped 2026-06-25 (squash-merged to
main, merge commit15507a3, by sweetmantech).Deleted
lib/agent/(system-prompt.ts,tools/index.ts,tools/similar-artists.ts) and removed 8 orphaned packages —ai,@ai-sdk/react,streamdown,@streamdown/{cjk,code,math,mermaid},use-stick-to-bottom,nanoid— all leftovers from the hero chat demo deleted in marketing#31. Keptzod(used bysubscribe/book/valuation/leadroutes +post-schema.ts). Net 296 deletions, 0 additions. The earlier scan flagged marketing for a v7 bump; in fact none of this code ran, so the YAGNI removal also kills that dependency-scan false positive.Verified:
tsc --noEmitclean (no module-not-found from the deletions = proof they were unused),next buildcompiles + typechecks, 67/67 vitest pass, and Vercel preview green (full prerender, real env). Browser regression on the preview: valuation artist-search flow works end-to-end (live/api/spotify/searchautocomplete → select → "Value my catalog" enables), zero console errors — nothing the removed packages touched broke. verification.Open — next up (in merge order; pick from the top)
ai6.0.165→7.0.2;@ai-sdk/react/anthropic/google/openai3→4,gateway3→4,@ai-sdk/mcp0.0.11→2;zodfloor →^3.25.76. Codemod handled the mechanical renames (isToolOrDynamicToolUIPart→isToolUIPart,experimental_generateImage→generateImage,system→instructions). Manual fixes: keptuseChat'sonFinish(codemod wrongly applied the coreonFinish→onEndto the hook —@ai-sdk/reactkeepsonFinish); kept the localgenerateText/generateArray{ system }wrapper API and passinstructions: systeminward; droppedcontent/createdAtfromUIMessagetest fixtures (v7 is parts-only).generateObjectretained (alive in v7).tscclean, 72/72 vitest, CI unit tests green, full-env Vercel build green, CodeRabbit + cubic pass. verification.messages[]rejection issue surfaced; chat's lonesystem:was the txt-email wrapper, handled above.test, thentest→mainper repo flow.Open — the real work (do last; these are migrations, not codemod passes)
api — v7 bump + typed tool context. (api#716 — open, all checks green, awaiting merge)
ToolLoopAgent, the agent loop, context passthrough all still exist). It was a rename + typed-context migration, not a ground-up redesign, and not a Zod-duplication issue (a zod override tried during diagnosis was removed).open-agents— same gateway+Workflow stack): v7's@ai-sdk/gateway@4pulls in@vercel/oidc, which does a runtimerequire('./get-vercel-oidc-token.js'). Turbopack refuses to bundle the dynamic require → switched tonext build --webpack(matches chat/marketing); webpack then mis-resolved the internal require when bundled → added@vercel/oidctoserverExternalPackages+ as a direct dep so Node loads it natively.neverunless declared, breaking both thetool()overloads (TS2769) andtoolsContext. Fix: annotate every context-using tool'sexecute2nd arg: ToolExecutionOptions<AgentContext>. v7 also splitexperimental_contextinto a per-tool-nametoolsContextmap ({ bash: ctx, glob: ctx, … }) — addedlib/agent/tools/buildToolsContext.tsto fan the singleAgentContextout per tool key; wired intorunAgentStep+taskTool.inputTokenDetails/outputTokenDetails;addLanguageModelUsagecodemod-doubling,ZERO_USAGE,recordCreditDeduction);GoogleProviderOptions→GoogleGenerativeAIProviderOptions;ToolLoopAgent4th generic (RoutingDecision/ChatConfig); reverted codemod over-applications (local{ system }wrappers, toolChainsystem→instructionstypes, webFetch discriminant/param-default). Test fixtures aligned to v7, no weakened assertions.tsc --noEmit0 errors,pnpm test3676 passed / 659 files. (~199 pre-existing__tests__type-debt errors in unrelated domains left untouched; all tests pass at runtime.)test→mainper repo flow.open-agents — v7 bump + context redesign. (target
main)api—packages/agent/tools/*+subagents/*useexperimental_contextthroughout (part of the 118-hit total above);apps/web/app/api/chat/_lib/request.tstoo. Monorepo (packages/agent+apps/web), so bump the workspace catalog + both packages.ai/@ai-sdk/*inpackages/agentandapps/web, manually rework context threading to v7 model, rerun the agent's own tests (packages/agent/tools/tools.test.ts).packages/agenttests pass, an end-to-end agent run works on a preview deploy.Architecture decisions
npx @ai-sdk/codemod v7per repo for the ~35 mechanical renames (system→instructions,experimental_output→output,experimental_telemetry→telemetry,stepCountIs→isStepCount,fullStream→stream,onFinish→onEnd,usage.reasoningTokens→usage.outputTokenDetails.reasoningTokens,GoogleGenerativeAI*→Google*,experimental_context→context, …). Treat the codemod output as a draft — the context redesign inapi/open-agentsis hand-written.pnpm build(andpnpm exec tsc --noEmitinapi) is the pass/fail gate; vitest where it exists. v6→v7 is not runtime-breaking for the deprecated helpers, so green build + a preview smoke test is the bar.toUIMessageStream*,toTextStreamResponse,pipe*) are@deprecatedin v7 but functional until v8. We migrate deliberately, smallest-risk-first, not under time pressure.api/chattargettest, the rest targetmain.Accepted regressions / tradeoffs
api/app/lib/workflows/runAgentStep.ts(toUIMessageStream) — may be left on the deprecated path initially to keep the v7 bump small; it works in v7 and only breaks in v8. Tracked here so it isn't forgotten before the v8 jump. (The marketingtoUIMessageStreamResponsesite noted in the original scan is gone — removed frommainin marketing#31.)Source references
npx @ai-sdk/codemod v7· guided skill:npx skills add vercel/ai --skill migrate-ai-sdk-v6-to-v7experimental_context= 118 hits / ~45 files acrossapi+open-agents; deprecated stream helpers = 1 real call site onmain(apirunAgentStep.ts; the marketing site was already removed in marketing#31).