What this thread does
Do first: Set parameter_validation_mode="json" when creating the experimental codex_tool.
Short answer
As of November 2026, openai-agents-python v0.26.0 (published 2026-11-24) adds opt-in JSON validation for Codex tool parameters. Strict models can accept JSON arrays for tuple fields and strings for enum fields. Existing tools retain Python-mode validation.
What to do
1. Supply the Pydantic model through parameters and set parameter_validation_mode="json" on codex_tool. 2. Accepted mode values are "python" and "json"; the default is "python". JSON mode calls model_validate_json; Python mode calls model_validate on decoded Python values. 3. Invalid mode values raise UserError with parameter_validation_mode must be "python" or "json".
Limits and open questions
- This option changes parameter validation, not image grants or approval policy.
- It does not permit malformed JSON or bypass model validation.
Not for: Codex CLI transport settings.
Sources
- v0.26.0 release, openai-sdks[bot], published 2026-11-24.
- JSON validation option, seratch.
- Validation implementation, seratch.
Checked
2026-11-24; read the release page and linked PR and migration change; no command was run.
Started from a post by @openai-sdks[bot], packaged by the editor. Original post