fix(mcp): webFetchInput emits 'URL is required' for missing url (#4510) - #4541
Merged
Merged
Conversation
) The omniroute_web_fetch input schema (#4510) used z.string().min(1, "URL is required") for the url field, but .min() only fires for an empty string. A MISSING url (webFetchInput.parse({})) fails the z.string() type check first and emitted the default Zod v4 message ("expected string, received undefined"), so the existing test 'webFetchInput rejects missing URL' (expecting /URL is required/) failed on the full unit suite — a latent base red on release/v3.8.33. Add the custom message to the type check: z.string({ error: "URL is required" }). Now both the missing-field and empty-string cases emit 'URL is required'; a valid url still passes. No other web_fetch behavior changes. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Contributor
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Merged
tkgo11
pushed a commit
to tkgo11/OmniRoute
that referenced
this pull request
Sep 23, 2026
…egosouzapw#4510) (diegosouzapw#4541) The omniroute_web_fetch input schema (diegosouzapw#4510) used z.string().min(1, "URL is required") for the url field, but .min() only fires for an empty string. A MISSING url (webFetchInput.parse({})) fails the z.string() type check first and emitted the default Zod v4 message ("expected string, received undefined"), so the existing test 'webFetchInput rejects missing URL' (expecting /URL is required/) failed on the full unit suite — a latent base red on release/v3.8.33. Add the custom message to the type check: z.string({ error: "URL is required" }). Now both the missing-field and empty-string cases emit 'URL is required'; a valid url still passes. No other web_fetch behavior changes. Co-authored-by: Diego Rodrigues de Sa e Souza <diego.souza@cdwasolutions.com.br> Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix latent base red:
webFetchInputmissing-url message (#4510)The
omniroute_web_fetchtool (#4510) defines its input as:.min(1, …)only fires for an empty string. Whenurlis missing(
webFetchInput.parse({})), Zod v4 fails the.string()type check first andemits the default message
Invalid input: expected string, received undefined—never reaching
.min(). So the existing testwebFetchInput rejects missing URL(which expects
/URL is required/) fails.This surfaced as a Fast Quality Gates failure on the full unit suite for PRs into
release/v3.8.33(the fast-path that landed #4510 did not run the full suite). It isunrelated to whichever feature PR happens to trigger the gate.
Fix
The
errorparam customizes the type-check message, so both the missing-field andthe empty-string cases emit
URL is required; a valid url still passes.Verification
tests/unit/mcp-web-fetch-tool.test.ts→ 13/13 (was 1 failing:webFetchInput rejects missing URL).{}→ "URL is required";{url:""}→ "URL is required";{url:"https://x.com"}→ OK.typecheck:coreclean ·eslint open-sse/mcp-server/schemas/tools.tsclean.One-line change; no behavior change to a valid web_fetch call.