Skip to content

chore: upgrade zod from v3 to v4#99

Merged
mattpodwysocki merged 3 commits intomainfrom
chore/upgrade-zod-v4
Apr 13, 2026
Merged

chore: upgrade zod from v3 to v4#99
mattpodwysocki merged 3 commits intomainfrom
chore/upgrade-zod-v4

Conversation

@mattpodwysocki
Copy link
Copy Markdown
Contributor

Summary

  • Upgrades zod from ^3.25.42 to ^4.3.6
  • Migrates all z.record(valueSchema) calls to the v4-required two-argument form z.record(z.string(), valueSchema)
  • Updates ._def.shape access in test (v4 changed it from a function to a plain object)
  • Removes .default(1) from denoise in IsochroneTool input schema — v4 changed .default().optional() to always apply the default even for absent keys, which caused the value to appear in the API URL when not provided by the user

Test plan

  • All 719 tests pass (npm test)
  • TypeScript compiles cleanly (npx tsc --noEmit)

🤖 Generated with Claude Code

github-actions Bot and others added 2 commits April 1, 2026 16:51
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@mattpodwysocki mattpodwysocki requested a review from a team as a code owner April 13, 2026 19:04
expect(result.content[0]).toHaveProperty('type', 'text');
const errorText = (result.content[0] as TextContent).text;
expect(errorText).toContain('Required');
expect(errorText).toContain('invalid_type');
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.

Create token tool doesn't show any changes in this PR. Assume this is just a downstream effect of the version change, flagging it just in case.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Correct — this is a direct result of the zod v4 error message format change. In v3, missing required fields produced a 'Required' message. In v4 that changed to 'Invalid input: expected string, received undefined' (code invalid_type). The test assertion was updated to match the new format while still verifying that validation fails and the error references the correct field (feedback_id / note / scopes).

ctufts
ctufts previously approved these changes Apr 13, 2026
Copy link
Copy Markdown
Contributor

@ctufts ctufts left a comment

Choose a reason for hiding this comment

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

Approved, but left a quick comment on the create token tool test

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@mattpodwysocki mattpodwysocki dismissed ctufts’s stale review April 13, 2026 20:34

The merge-base changed after approval.

@mattpodwysocki mattpodwysocki merged commit 7e9cbc3 into main Apr 13, 2026
1 check passed
@mattpodwysocki mattpodwysocki deleted the chore/upgrade-zod-v4 branch April 13, 2026 20:36
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.

2 participants