Skip to content

Improve tool schema diagnostic errors#3560

Closed
tarunag10 wants to merge 1 commit into
openai:mainfrom
tarunag10:codex/strict-schema-clear-ref-errors
Closed

Improve tool schema diagnostic errors#3560
tarunag10 wants to merge 1 commit into
openai:mainfrom
tarunag10:codex/strict-schema-clear-ref-errors

Conversation

@tarunag10
Copy link
Copy Markdown

Summary

  • raise a clear ValueError when strict schema $ref resolution points at a missing path instead of leaking KeyError
  • raise an actionable UserError when function tool parameters use Pydantic protected method names such as model_validate or model_dump
  • add regression coverage for both diagnostics

Fixes #3551.
Fixes #3549.

Validation

  • uv run pytest tests/test_strict_schema.py tests/test_function_schema.py -q
  • uv run ruff format --check src/agents/strict_schema.py src/agents/function_schema.py tests/test_strict_schema.py tests/test_function_schema.py
  • uv run ruff check src/agents/strict_schema.py src/agents/function_schema.py tests/test_strict_schema.py tests/test_function_schema.py

@seratch seratch added feature:core duplicate This issue or pull request already exists wontfix This will not be worked on labels Jun 4, 2026
@seratch seratch closed this Jun 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

duplicate This issue or pull request already exists feature:core wontfix This will not be worked on

Projects

None yet

2 participants