Skip to content

fix: filter custom_tool_call types in remove_all_tools handoff filter#3095

Merged
seratch merged 1 commit intoopenai:mainfrom
Quratulain-bilal:test/handoff-filter-custom-tool-coverage-v2
May 4, 2026
Merged

fix: filter custom_tool_call types in remove_all_tools handoff filter#3095
seratch merged 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
@seratch
Copy link
Copy Markdown
Member

seratch commented May 4, 2026

@codex review

@chatgpt-codex-connector
Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 👍

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@seratch seratch merged commit 4bb4400 into openai:main May 4, 2026
10 checks passed
@seratch seratch added this to the 0.15.x milestone May 4, 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.

2 participants