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
If your app uses additional VoltAgent packages, keep all `@voltagent/*` packages on the same major/prerelease line:
@@ -97,6 +97,14 @@ Common provider package upgrades:
97
97
|`@ai-sdk/amazon-bedrock`|`^5`|
98
98
|`@ai-sdk/google-vertex`|`^5`|
99
99
100
+
### Zod 4-only
101
+
102
+
VoltAgent 3 requires Zod 4. The framework packages now use `zod@^4` peer ranges, examples and templates install Zod 4, and the old Zod 3 JSON Schema/OpenAPI compatibility fallback has been removed.
103
+
104
+
```bash
105
+
pnpm add zod@^4
106
+
```
107
+
100
108
### Agent usage
101
109
102
110
The object-style call shape is the preferred API. AI SDK generation options stay at the top level, while VoltAgent runtime concerns live under `voltagent`.
@@ -232,7 +240,8 @@ console.log(result.output);
232
240
2. Set `"type": "module"` and replace CommonJS `require()` calls with ESM imports.
233
241
3. Upgrade all `@voltagent/*` packages together from the `next` channel.
234
242
4. Upgrade `ai` to `^7` and AI SDK provider packages to their v7-compatible majors.
235
-
5. Replace `stepCountIs` with `isStepCount`.
236
-
6. Prefer `result.stream` over `result.fullStream`.
237
-
7. Prefer `output` over `experimental_output`.
238
-
8. Prefer object-style agent calls for new code, with VoltAgent runtime options under `voltagent`.
243
+
5. Upgrade `zod` to `^4`.
244
+
6. Replace `stepCountIs` with `isStepCount`.
245
+
7. Prefer `result.stream` over `result.fullStream`.
246
+
8. Prefer `output` over `experimental_output`.
247
+
9. Prefer object-style agent calls for new code, with VoltAgent runtime options under `voltagent`.
Copy file name to clipboardExpand all lines: docs/ai-sdk-first-vnext-plan.md
+11-7Lines changed: 11 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -24,11 +24,12 @@ This means AI SDK primitives such as `model`, `prompt`, `messages`, `tools`, `ou
24
24
25
25
## vNext Platform Decision
26
26
27
-
Decision: VoltAgent vNext will target AI SDK 7, Node.js 22 or later, and ESM-only package output.
27
+
Decision: VoltAgent vNext will target AI SDK 7, Zod 4, Node.js 22 or later, and ESM-only package output.
28
28
29
29
This is an explicit compatibility boundary:
30
30
31
31
- Set the repository and published package engine requirement to `node >=22`.
32
+
- Set published Zod peer ranges to `^4.0.0` and remove Zod 3 fallback code paths.
32
33
- Remove CommonJS runtime exports from vNext packages that depend on AI SDK or packages that depend on those packages.
33
34
- Prefer `"type": "module"` and ESM package exports for new vNext package metadata.
34
35
- Keep TypeScript declaration output for ESM consumers.
@@ -45,6 +46,7 @@ Migration consequence:
45
46
46
47
- Users on Node.js 20 must stay on the previous VoltAgent major or upgrade Node before adopting vNext.
47
48
- Users using `require("@voltagent/core")` must migrate to ESM imports.
49
+
- Users pinned to Zod 3 must upgrade to Zod 4 before adopting VoltAgent 3.
48
50
- Docs, examples, package exports, and migration guide must call this out clearly.
49
51
50
52
## Protected Feature Surface
@@ -932,6 +934,7 @@ Each PR should include focused tests and avoid mixing refactors with behavior ch
932
934
| Model retry/fallback behavior changes | High | Keep VoltAgent retry loop and add retry/fallback tests |
933
935
| CommonJS users break on vNext | High | Make ESM-only and Node.js 22 requirements explicit in package metadata and migration docs |
934
936
| Package exports or publint fail after removing CJS output | High | Update export maps package-by-package and run `pnpm publint:all`|
937
+
| Zod 3 compatibility fallback hides broken app dependencies | Medium | Make VoltAgent 3 Zod 4-only in peer deps, examples, templates, docs, and converter code paths |
935
938
| Third-party providers are not AI SDK 7 compatible | Medium | Audit third-party providers, document incompatibilities, and isolate unsupported provider builders |
936
939
| Provider dependency decoupling expands scope | Medium | Deferred; keep existing router and provider dependency behavior unchanged in this plan |
937
940
| Server request schemas diverge from core API | Medium | Update schemas and processAgentOptions in same slice |
@@ -949,7 +952,7 @@ Each PR should include focused tests and avoid mixing refactors with behavior ch
949
952
-[x] Phase 6 ecosystem packages are updated.
950
953
-[x] Phase 7 docs are available; executable codemods are deferred to a separate follow-up.
951
954
-[x] Phase 8 release gates are green.
952
-
-[ ] Phase 9 AI SDK 7, Node.js 22, ESM-only, and AI SDK-style tool support is complete.
955
+
-[ ] Phase 9 AI SDK 7, Zod 4, Node.js 22, ESM-only, and AI SDK-style tool support is complete.
953
956
954
957
## Current Recommendation
955
958
@@ -964,10 +967,11 @@ Proceed in this order:
964
967
7. Finish docs/codemod decisions and run release gates.
965
968
8. Apply the Node.js 22 and ESM-only package boundary.
966
969
9. Upgrade AI SDK dependencies to v7-compatible ranges.
967
-
10. Run and review AI SDK v7 codemods.
968
-
11. Update the core AI SDK boundary for v7 option, stream, callback, usage, and tool approval changes.
969
-
12. Add AI SDK-style `tool()` and direct `ToolSet` support while preserving VoltAgent tool features.
970
-
13. Update server, protocol, memory, scorer, docs, examples, and templates.
971
-
14. Re-run the full release gates for the AI SDK 7 scope.
970
+
10. Move Zod support to Zod 4-only across peers, examples, templates, and compatibility code.
971
+
11. Run and review AI SDK v7 codemods.
972
+
12. Update the core AI SDK boundary for v7 option, stream, callback, usage, and tool approval changes.
973
+
13. Add AI SDK-style `tool()` and direct `ToolSet` support while preserving VoltAgent tool features.
974
+
14. Update server, protocol, memory, scorer, docs, examples, and templates.
975
+
15. Re-run the full release gates for the AI SDK 7 scope.
972
976
973
977
This order keeps the vNext direction moving while minimizing the chance of losing existing framework features. Phase 8 was green before the AI SDK 7 scope was added; Phase 9 intentionally reopens the release-gate work for the new runtime and dependency boundary.
0 commit comments