Skip to content

web_search_preview never triggers agents.lifecycle.AgentHooks.on_tool_start #778

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
jihun-im-open opened this issue May 28, 2025 · 1 comment
Labels
bug Something isn't working

Comments

@jihun-im-open
Copy link

jihun-im-open commented May 28, 2025

Please read this first

Yes

Describe the bug

These functions are not called when the tool is web_search_preview

  • agents.lifecycle.AgentHooks.on_tool_start
  • agents.lifecycle.AgentHooks.on_tool_end
  • agents.agent.Agent.tool_use_behavior (A function)

Debug information

  • Agents SDK version: v0.0.15
  • Python version: Python 3.11

Repro steps

Ideally provide a minimal python script that can be run to reproduce the bug.
https://gist.github.com/jihun-im-open/a3892127a0e406500df7e05ff708f090

Expected behavior

The hooks should be triggered for web_search_preview.
As it's tool input is a union of all tools

@jihun-im-open jihun-im-open added the bug Something isn't working label May 28, 2025
@rm-openai
Copy link
Collaborator

I should document this better (and we should have named it better), but the on_tool_start is for local tools

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants