Skip to content

Improve tool schema diagnostic errors#3560

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

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant