Skip to content

fix(mcp): webFetchInput emits 'URL is required' for missing url (#4510) - #4541

Merged
diegosouzapw merged 1 commit into
release/v3.8.33from
fix/web-fetch-missing-url-message
Jun 21, 2026
Merged

diegosouzapw merged 1 commit into
release/v3.8.33from
fix/web-fetch-missing-url-message

Conversation

@diegosouzapw

Copy link
Copy Markdown
Owner

Fix latent base red: webFetchInput missing-url message (#4510)

The omniroute_web_fetch tool (#4510) defines its input as:

url: z.string().min(1, "URL is required")

.min(1, …) only fires for an empty string. When url is missing
(webFetchInput.parse({})), Zod v4 fails the .string() type check first and
emits the default message Invalid input: expected string, received undefined —
never reaching .min(). So the existing test webFetchInput 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 is
unrelated to whichever feature PR happens to trigger the gate.

Fix

url: z.string({ error: "URL is required" }).min(1, "URL is required")

The error param customizes the type-check message, so both the missing-field and
the 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).
  • Boundary sanity: {} → "URL is required"; {url:""} → "URL is required"; {url:"https://x.com"} → OK.
  • typecheck:core clean · eslint open-sse/mcp-server/schemas/tools.ts clean.

One-line change; no behavior change to a valid web_fetch call.

)

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>
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@diegosouzapw
diegosouzapw merged commit 4d3a9fd into release/v3.8.33 Jun 21, 2026
4 checks passed
@diegosouzapw
diegosouzapw deleted the fix/web-fetch-missing-url-message branch June 21, 2026 18:43
@diegosouzapw diegosouzapw mentioned this pull request Jun 22, 2026
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>
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