Skip to content

fix: filter custom_tool_call types in remove_all_tools handoff filter#3095

Open
Quratulain-bilal wants to merge 1 commit intoopenai:mainfrom
Quratulain-bilal:test/handoff-filter-custom-tool-coverage-v2
Open

fix: filter custom_tool_call types in remove_all_tools handoff filter#3095
Quratulain-bilal wants to merge 1 commit intoopenai:mainfrom
Quratulain-bilal:test/handoff-filter-custom-tool-coverage-v2

Conversation

@Quratulain-bilal
Copy link
Copy Markdown
Contributor

Summary

  • remove_all_tools strips hosted tool types from raw input history before a handoff so the next agent does not see the
    previous agent's tool plumbing. The hosted-types list omitted custom_tool_call and custom_tool_call_output, so
    custom tool calls (produced by CustomTool / ResponseCustomToolCall) leaked through after a handoff.
  • Add both types to the filter list in src/agents/extensions/handoff_filters.py.
  • Extend test_removes_hosted_tool_types_from_input_history to cover the two new types — without the source change the
    test fails.

Test plan

  • uv run pytest tests/test_extension_filters.py — 36 passed
  • uv run ruff check — clean
  • uv run ruff format --check — clean

remove_all_tools strips hosted tool types from raw input history before
a handoff so the next agent does not see the previous agent's tool
plumbing. The list omitted custom_tool_call and custom_tool_call_output,
so custom tool calls (used by CustomTool / ResponseCustomToolCall)
leaked through after a handoff.

Add the two types to the filter list and extend
test_removes_hosted_tool_types_from_input_history to cover them.
@github-actions github-actions Bot added bug Something isn't working feature:extensions labels May 2, 2026
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.

1 participant