Skip to content

Conversation

@threepointone
Copy link
Contributor

since we updated to zod v4, the schedule schema was broken. ai sdk's .jsonSchema function doesn't correctly work on tools created with zod v4. The fix, is to use the v3 version of zod for the schedule schema.

since we updated to zod v4, the schedule schema was broken. ai sdk's .jsonSchema function doesn't correctly work on tools created with zod v4. The fix, is to use the v3 version of zod for the schedule schema.
@changeset-bot
Copy link

changeset-bot bot commented Dec 22, 2025

🦋 Changeset detected

Latest commit: a0ffa6d

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

This PR includes changesets to release 1 package
Name Type
agents 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

@claude
Copy link

claude bot commented Dec 22, 2025

Claude Code Review

Status: Functional but creates technical debt

The fix works but introduces an architectural inconsistency:

Issues:

  1. Codebase inconsistency: schedule.ts:1 is now the ONLY file importing from zod/v3 - all 8+ other files import from zod directly. This creates a maintenance burden and could confuse developers.

  2. Workaround vs. fix: The PR description correctly identifies that "ai sdk's .jsonSchema function doesn't correctly work on tools created with zod v4", but this is patching symptoms rather than addressing the root cause. Consider:

    • Filing an issue with the AI SDK project about zod v4 compatibility
    • Adding a code comment explaining WHY this file uses v3 (currently no explanation)
    • Tracking this as technical debt to remove once AI SDK fixes their zod v4 support
  3. Missing test coverage: The eval in evals/scheduling.eval.ts tests schema parsing but doesn't verify the schema actually works with AI SDK's tool system where the bug manifests.

Recommendation:

The fix is acceptable for unblocking scheduling functionality, but add a comment documenting why this file uses v3 instead of v4. This helps future maintainers understand the technical debt.

@pkg-pr-new
Copy link

pkg-pr-new bot commented Dec 22, 2025

Open in StackBlitz

npm i https://pkg.pr.new/cloudflare/agents@747

commit: a0ffa6d

@threepointone threepointone merged commit 17a0346 into main Dec 22, 2025
5 checks passed
@threepointone threepointone deleted the fix-scheduling branch December 22, 2025 01:34
@github-actions github-actions bot mentioned this pull request Dec 22, 2025
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.

1 participant