Skip to content

fix(llm): normalize OpenAI strict schemas#187

Merged
haasonsaas merged 1 commit into
mainfrom
codex/openai-schema-fix-20260526
May 27, 2026
Merged

fix(llm): normalize OpenAI strict schemas#187
haasonsaas merged 1 commit into
mainfrom
codex/openai-schema-fix-20260526

Conversation

@haasonsaas
Copy link
Copy Markdown
Contributor

Summary

  • Normalize OpenAI strict JSON schemas before json_schema response_format or strict tool-call transport.
  • Seal every object, require all remaining properties, strip unsupported validation keywords, fold trivial allOf refs, and rewrite definitions refs to $defs refs.
  • Inline direct property refs inside anyOf variants because the live OpenAI API rejects the browser action union when find_elements is only a nested $defs ref.

Testing

  • cargo test -p browser-use-llm openai_json_schema_mode_makes_schema_strict -- --nocapture
  • cargo test -p browser-use-llm
  • cargo fmt --all -- --check
  • cargo clippy --workspace --all-targets -- -D warnings
  • cargo test --workspace
  • python3 scripts/release-version.py --check
  • python3 scripts/release-version.py --self-test
  • python3 scripts/upstream-drift.py --self-test
  • python3 scripts/upstream-drift.py
  • git -c core.fsmonitor=false diff --check
  • MCP protocol smoke: initialize, ping, tools/list, browser_use_state
  • MCP OpenAI default browser_use_agent with gpt-4.1-mini: completed in one step with exact done text and all_errors: []
  • MCP OpenAI prompt-only agent smoke: completed in one step with exact done text and all_errors: []
  • MCP OpenAI tool-call agent smoke: completed in one step with exact done text and all_errors: []

Release-Impact: patch

Normalize schemas before sending OpenAI strict JSON Schema or tool-call requests: seal objects, require all properties, strip unsupported validation keywords, fold trivial refs, and inline anyOf property refs that OpenAI rejects in the browser action union.

Release-Impact: patch
@haasonsaas haasonsaas merged commit aa779b3 into main May 27, 2026
3 checks passed
@haasonsaas haasonsaas deleted the codex/openai-schema-fix-20260526 branch May 27, 2026 00:26
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