Skip to content

fix #5829 - Bug: schema cleanup removes fields named default, minItems, or min_items - #5830

Open
Lucky-Lodhi2004 wants to merge 1 commit into
browser-use:mainfrom
Lucky-Lodhi2004:fix/schema-cleanup-bug
Open

Lucky-Lodhi2004 wants to merge 1 commit into
browser-use:mainfrom
Lucky-Lodhi2004:fix/schema-cleanup-bug

Conversation

@Lucky-Lodhi2004

@Lucky-Lodhi2004 Lucky-Lodhi2004 commented Sep 17, 2026 •

Copy link
Copy Markdown

Description

When structured output compatibility flags remove JSON Schema metadata, the cleanup pass also removes user properties whose names match those metadata keys. The resulting schema still lists the removed names in required, while additionalProperties is false, so the schema cannot be satisfied (from original issue).

Fixes

applied the exact same in_properties protection logic to the remove_forbidden_fields function that is already being used in the initial optimize_schema pass.

Specifically, in browser_use/llm/schema.py

Tests

All tests were passed locally.


Summary by cubic

Fixes schema cleanup so user-defined properties named default, minItems, or min_items are no longer removed when stripping metadata.

Bug Fixes

  • Applies the existing in_properties guard to remove_forbidden_fields in browser_use/llm/schema.py.
  • Prevents the cleanup from removing user properties that share names with metadata keys.

Written for commit 9fb0a30. Summary will update on new commits.

Review in cubic

@cubic-dev-ai cubic-dev-ai Bot left a comment

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.

No issues found across 1 file

Re-trigger cubic

@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

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

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants