Skip to content

fix(core): fail closed on empty tool arguments - #4545

Merged
seratch merged 1 commit into
openai:mainfrom
hsusul:fix/approval-empty-arguments-fail-closed
Aug 20, 2026
Merged

fix(core): fail closed on empty tool arguments#4545
seratch merged 1 commit into
openai:mainfrom
hsusul:fix/approval-empty-arguments-fail-closed

Conversation

@hsusul

@hsusul hsusul commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Summary

This pull request treats missing or blank function-tool argument strings as uninspectable for callable needs_approval policies.

parse_function_tool_arguments previously used arguments or \"{}\", so \"\" and None became an empty object. A content gate such as \"refund\" in params.get(\"subject\", \"\") then returned False and the tool ran without interruption. Invalid JSON already failed closed after #3867; empty/missing argument strings now do the same. An explicit \"{}\" payload is still a valid empty object.

The same helper is used by Runner tool execution and Realtime session tool calls.

Test plan

  • uv run pytest -q tests/test_hitl_error_scenarios.py::test_callable_function_approval_fails_closed_for_invalid_arguments tests/realtime/test_session.py::TestToolCallExecution::test_callable_function_approval_fails_closed_for_invalid_arguments
  • make format && make lint && make typecheck
  • Confirmed empty argument strings interrupt and do not invoke the approval predicate

Issue number

N/A

Checks

  • I've added new tests, if relevant
  • I've run .agents/skills/code-change-verification/scripts/run.sh
  • I've confirmed format, lint, typecheck, and focused approval tests pass
  • If using Codex, I've run /review before submitting this PR

Missing or blank argument strings were coerced to {} before callable
needs_approval ran, so content gates could skip interruption.
@seratch seratch changed the title fix(approvals): fail closed on empty tool arguments fix(core): fail closed on empty tool arguments Aug 20, 2026
@seratch seratch added this to the 0.22.x milestone Aug 20, 2026
@seratch
seratch merged commit 1b7eb28 into openai:main Aug 20, 2026
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants