You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Bug: schema cleanup removes fields named default, minItems, or min_items #5829
main d8110c5 (also present in browser-use 0.13.10)
Bug Description, Steps to Reproduce, Screenshots
Problem
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.
Steps to reproduce
Use a Pydantic output model containing fields named default, minItems, or min_items.
Generate its schema with remove_defaults=True and/or remove_min_items=True.
Inspect the generated properties and required entries.
Expected
The compatibility flags remove only Schema metadata (a field default or minItems annotation). User property names with those strings remain present and valid.
Actual
The final recursive cleanup in browser_use/llm/schema.py pops these keys from every dictionary, including properties maps. The names remain in required after strict compatibility is applied, producing an unsatisfiable schema.
This is a follow-up to #5605: its first traversal protects property names, but the later cleanup traversal does not.
Failing Python Code
frompydanticimportBaseModelfrombrowser_use.llm.schemaimportSchemaOptimizerclassOutput(BaseModel):
default: boolminItems: strmin_items: stroptional_value: str='fallback'schema=SchemaOptimizer.create_optimized_json_schema(
Output,
remove_defaults=True,
remove_min_items=True,
)
print(schema['properties'].keys())
print(schema['required'])
# Expected: all four fields are in properties.# Actual on main/0.13.10: default, minItems, and min_items are removed# while they remain required.
LLM Model
No LLM call; schema generation is local
Operating System & Browser Versions
Python 3.14.6, Pydantic 2.13.4
Full DEBUG Log Output
Not applicable: the failure occurs while building the local JSON schema, before any provider request.
Activity
Lucky-Lodhi2004 commentedon Sep 17, 2026
hi! I made a PR for this issue, but it isn't tagged here for some reason. What's wrong here? Am i missing something?
Here is my PR #5830