fix: remove_all_tools missing hosted tool types by javierdejesusda · Pull Request #2885 · openai/openai-agents-python · GitHub
Skip to content

fix: remove_all_tools missing hosted tool types#2885

Merged
seratch merged 1 commit intoopenai:mainfrom
javierdejesusda:fix/remove-all-tools-missing-hosted-types
Apr 15, 2026
Merged

fix: remove_all_tools missing hosted tool types#2885
seratch merged 1 commit intoopenai:mainfrom
javierdejesusda:fix/remove-all-tools-missing-hosted-types

Conversation

@javierdejesusda
Copy link
Copy Markdown
Contributor

Summary

remove_all_tools already strips function calls, computer calls, web/file/tool search calls, MCP items, and reasoning items, but it still leaves hosted tool calls and ToolApprovalItem in the handoff input. After a handoff that uses this filter, the next agent receives code_interpreter_call, image_generation_call, local_shell_call(_output), shell_call(_output), and apply_patch_call(_output) items in its raw input history, plus any unresolved ToolApprovalItem entries in pre_handoff_items and new_items.

This is the same gap #2700 closed for MCP and reasoning items, applied to the remaining hosted tool types.

Changes:

  • Add ToolApprovalItem to _remove_tools_from_items.
  • Add the eight hosted tool call type literals to _remove_tool_types_from_input.

Test plan

  • New test_removes_hosted_tool_types_from_input_history covering all eight new types in raw input history.
  • New test_removes_tool_approval_from_new_items covering ToolApprovalItem removal from pre_handoff_items and new_items.
  • uv run pytest tests/test_extension_filters.py — 36 passed.
  • make lint, make format, make typecheck on the touched files — all clean.

Checks

  • I've added new tests (if relevant)
  • I've added/updated the relevant documentation
  • I've run make lint and make format
  • I've made sure tests pass

@github-actions github-actions Bot added bug Something isn't working feature:extensions labels Apr 15, 2026
@seratch seratch added this to the 0.14.x milestone Apr 15, 2026
@seratch seratch merged commit 09ea6aa into openai:main Apr 15, 2026
9 checks passed
@javierdejesusda javierdejesusda deleted the fix/remove-all-tools-missing-hosted-types branch April 23, 2026 18:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working feature:extensions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants