Skip to content

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

Closed
@jihun-im-open

Description

@jihun-im-open

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

Activity

rm-openai

rm-openai commented on May 29, 2025

@rm-openai
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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @jihun-im-open@rm-openai

        Issue actions

          web_search_preview never triggers agents.lifecycle.AgentHooks.on_tool_start · Issue #778 · openai/openai-agents-python