Skip to content

fix(browser_console_messages): fix zod .default().describe() schema order#40360

Open
Will-hxw wants to merge 1 commit intomicrosoft:mainfrom
Will-hxw:fix-1429
Open

fix(browser_console_messages): fix zod .default().describe() schema order#40360
Will-hxw wants to merge 1 commit intomicrosoft:mainfrom
Will-hxw:fix-1429

Conversation

@Will-hxw
Copy link
Copy Markdown

Summary

  • Reorder zod chained calls: change .default('info').describe(...) to .describe(...).default('info') for the level parameter in console.ts

Why

Issue #1429: Gemini calls browser_console_messages and receives "parameters.level schema didn't specify the schema type field". When .default() appears before .describe() in zod chaining, zodToJSONSchema drops the description, causing schema validation failure.

Validation

  • Single line change in packages/playwright-core/src/tools/backend/console.ts
  • TypeScript compilation check passed

…sages level param

Fixes: microsoft/playwright-mcp#1429

When using zod with zodToJSONSchema, .describe() must come before
.default() to ensure the description is properly attached to the schema
before the JSON schema is generated.
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