Skip to content

fix(schema): handle field named 'required' in strict mode (#6209) - #6392

Open
user-Param wants to merge 2 commits into
browser-use:mainfrom
user-Param:fix/6209-schema-only
Open

user-Param wants to merge 2 commits into
browser-use:mainfrom
user-Param:fix/6209-schema-only

Conversation

@user-Param

@user-Param user-Param commented Nov 13, 2026 •

Copy link
Copy Markdown

Fixes #6209


Summary by cubic

Fixes strict-mode schema optimization for user fields literally named required. Previously the recursive walk skipped any dict/list value under a key named required (assuming it was the schema's required array), so a nested model under such a field never got its optional properties marked as required. The walk now iterates over values only, recursing into every dict/list regardless of key name, and adds a regression test for this case.

Written for commit 388391e. Summary will update on new commits.

View guided diff

…e#6209)

The _make_strict_compatible loop skipped dict/list values under a key
named 'required' (thinking it was the schema's required array). When a
user field is literally named 'required' and contains a nested model,
that nested model's properties were never processed for strict mode.

Changed the loop to iterate over schema.values() instead of
schema.items(), so every dict/list value is recursed into regardless of
its key name.

Also adds regression test test_optimizer_handles_field_named_required_in_strict_mode.

Fixes browser-use#6209.
@mintlify

mintlify Bot commented Nov 13, 2026 •

Copy link
Copy Markdown

Preview approval required

This pull request comes from a fork, so Mintlify won't build a preview until someone with write access approves commit 388391e.

Approve preview

@CLAassistant

CLAassistant commented Nov 13, 2026 •

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 all sign our Contributor License Agreement before we can accept your contribution.
0 out of 2 committers have signed the CLA.

❌ user-Param
❌ def-Param


def-Param seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

…e#6209)

resolve merge conflict with v1 main: keep schema.py fix since file was deleted in v1

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.

Bug: SchemaOptimizer skips strict-mode required for a nested model under a field named "required"

2 participants