Skip to content

fix: make workspace toolkit schemas compatible with Zod v4 record han…#1058

Merged
omeraplak merged 1 commit into
mainfrom
fix/zod-4-compatible-workspace-toolkit
Feb 12, 2026
Merged

fix: make workspace toolkit schemas compatible with Zod v4 record han…#1058
omeraplak merged 1 commit into
mainfrom
fix/zod-4-compatible-workspace-toolkit

Conversation

@omeraplak

@omeraplak omeraplak commented Feb 12, 2026

Copy link
Copy Markdown
Member

…dling - #1043

PR Checklist

Please check if your PR fulfills the following requirements:

Bugs / Features

What is the current behavior?

What is the new behavior?

fixes (issue)

Notes for reviewers


Summary by cubic

Updates workspace toolkit schemas to align with Zod v4 record handling, fixing runtime errors in sandbox and search indexing flows. Fixes #1043 and prevents “Cannot read properties of undefined (reading '_zod')”.

  • Bug Fixes
    • Sandbox toolkit: env schema now uses z.record(z.string(), z.string()).
    • Search indexing: metadata schema now uses z.record(z.string(), z.unknown()).

Written for commit b4267e9. Summary will update on new commits.

Summary by CodeRabbit

Bug Fixes

  • Fixed runtime errors in workspace sandbox execution and search indexing features to ensure stable, reliable operation across all supported configurations.

@changeset-bot

changeset-bot Bot commented Feb 12, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: b4267e9

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@voltagent/core Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@ghost

This comment has been minimized.

@coderabbitai

coderabbitai Bot commented Feb 12, 2026

Copy link
Copy Markdown
Contributor
📝 Walkthrough

Walkthrough

Updates workspace toolkit schemas to support Zod v4 by explicitly specifying key and value types in z.record() calls. The sandbox toolkit's env parameter now requires string values, and the search index's metadata parameter explicitly defines string keys with unknown values.

Changes

Cohort / File(s) Summary
Changeset Documentation
.changeset/khaki-worms-wave.md
Documents Zod v4 compatibility fixes for workspace toolkit schemas to prevent runtime errors in workflows.
Zod Schema Updates
packages/core/src/workspace/sandbox/toolkit.ts, packages/core/src/workspace/search/index.ts
Updated z.record() calls to explicitly specify both key and value types: env changed to z.record(z.string(), z.string()) and metadata changed to z.record(z.string(), z.unknown()).

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Possibly related PRs

Poem

🐰 A rabbit hops through schema land,
Where types now flow from Zod's command,
String to string, and unknown too,
Version four works bright and new! 🌟

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly describes the main change: updating workspace toolkit schemas for Zod v4 record handling compatibility, directly addressing issue #1043.
Description check ✅ Passed The description follows the template with all required sections completed: checklist items marked, current/new behavior documented, related issue linked, and additional context from cubic provided.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Merge Conflict Detection ✅ Passed ✅ No merge conflicts detected when merging into main

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/zod-4-compatible-workspace-toolkit

No actionable comments were generated in the recent review. 🎉


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 3 files

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying voltagent with  Cloudflare Pages  Cloudflare Pages

Latest commit: b4267e9
Status: ✅  Deploy successful!
Preview URL: https://915329f5.voltagent.pages.dev
Branch Preview URL: https://fix-zod-4-compatible-workspa.voltagent.pages.dev

View logs

@omeraplak omeraplak merged commit 480981a into main Feb 12, 2026
23 checks passed
@omeraplak omeraplak deleted the fix/zod-4-compatible-workspace-toolkit branch February 12, 2026 21:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] TypeError: Cannot read properties of undefined (reading '_zod') when using workspace toolkit tools with latest Zod and AI SDK

1 participant