Skip to content

fix(codemod): retain patch versions when classifying Zod upper bounds - #3051

Open
pacocartones wants to merge 1 commit into
modelcontextprotocol:mainfrom
pacocartones:codex/codemod-zod-patch-upper-bound
Open

pacocartones wants to merge 1 commit into
modelcontextprotocol:mainfrom
pacocartones:codex/codemod-zod-patch-upper-bound

Conversation

@pacocartones

@pacocartones pacocartones commented Oct 19, 2026 •

Copy link
Copy Markdown

Retain patch versions when the codemod classifies Zod upper bounds.

Motivation and Context

The migrator warns that >=4.2.0 <4.2.1 cannot satisfy Zod 4.2.0 because its upper-bound classifier discards the patch version. Retain that component so ranges admitting 4.2.0 do not receive the warning. This also keeps <4.0.1 in the Zod 4.0/4.1 diagnostic instead of the Zod 3 diagnostic.

How Has This Been Tested?

Eight manifest-level cases cover exclusive and inclusive bounds, partial versions and unchanged dependency ranges. Four cases fail without the fix. The codemod package's 653 tests, typecheck, lint, formatting and build pass. The whole SDK test matrix was not run locally; this was package-level validation, not an external application run.

Breaking Changes

None. Dependency ranges are unchanged; the fix corrects warning classification.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update

Checklist

  • I have read the MCP Documentation
  • My code follows the repository's style guidelines
  • New and existing tests pass locally
  • I have added appropriate error handling
  • I have added or updated documentation as needed

Additional context

A patch changeset is included. No SDK runtime or dependency changes. The general test checkbox remains unchecked because only the codemod package was validated locally. The change adjusts an existing diagnostic and adds no new error-handling path; no documentation changes were made.

@pacocartones
pacocartones requested a review from a team as a code owner October 19, 2026 21:11
@changeset-bot

changeset-bot Bot commented Oct 19, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 269b32b

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

This PR includes changesets to release 6 packages
Name Type
@modelcontextprotocol/codemod Patch
@modelcontextprotocol/client Patch
@modelcontextprotocol/core Patch
@modelcontextprotocol/server-legacy Patch
@modelcontextprotocol/server Patch
@modelcontextprotocol/core-internal 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

@pkg-pr-new

pkg-pr-new Bot commented Oct 19, 2026

Copy link
Copy Markdown

Open in StackBlitz

@modelcontextprotocol/client

npm i https://pkg.pr.new/@modelcontextprotocol/client@3051

@modelcontextprotocol/codemod

npm i https://pkg.pr.new/@modelcontextprotocol/codemod@3051

@modelcontextprotocol/core

npm i https://pkg.pr.new/@modelcontextprotocol/core@3051

@modelcontextprotocol/server

npm i https://pkg.pr.new/@modelcontextprotocol/server@3051

@modelcontextprotocol/server-legacy

npm i https://pkg.pr.new/@modelcontextprotocol/server-legacy@3051

@modelcontextprotocol/express

npm i https://pkg.pr.new/@modelcontextprotocol/express@3051

@modelcontextprotocol/fastify

npm i https://pkg.pr.new/@modelcontextprotocol/fastify@3051

@modelcontextprotocol/hono

npm i https://pkg.pr.new/@modelcontextprotocol/hono@3051

@modelcontextprotocol/node

npm i https://pkg.pr.new/@modelcontextprotocol/node@3051

commit: 269b32b

@claude claude Bot added the v2 Ideas, requests and plans for v2 of the SDK which will incorporate major changes and fixes label Oct 20, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

v2 Ideas, requests and plans for v2 of the SDK which will incorporate major changes and fixes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant