Skip to content

Conversation

@ihower
Copy link
Contributor

@ihower ihower commented Nov 4, 2025

This PR improves the doc comments for the on_tool_start and on_tool_end hooks.

Clarified that these hooks are for local tools only, and do not include hosted tools running on the OpenAI server side (e.g., WebSearchTool, FileSearchTool, CodeInterpreterTool, HostedMCPTool, etc.).

Related Issues

@ihower ihower changed the title docs: clarify scope of on_tool_start and on_tool_end hooks for local tools only docs: clarify on_tool_start and on_tool_end hooks for local tools only Nov 4, 2025
@seratch seratch added the documentation Improvements or additions to documentation label Nov 4, 2025
Copy link
Member

@seratch seratch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! This is a really nice improvement

@seratch seratch merged commit d659a73 into openai:main Nov 4, 2025
9 checks passed
@hayescode
Copy link

Thank you @ihower ! @seratch any plans to support these hooks for hosted tools? Responses API seems to have create/delta/completed events for all tools, hosted and local, and particularly for MCP servers with lots of tools we don't have a way to see what MCP tools were called, their arguments, outputs, etc. at least for Agent.as_tool().

@seratch
Copy link
Member

seratch commented Nov 4, 2025

@hayescode when you use streaming, it may be possible to relay those events to the agent lifecycle hooks. But for developers who use non-streaming mode, it's not yet feasible to support the same. in the short term, enabling those hooks only for streaming mode could be indeed a good feature addition on this SDK side (although I myself haven't verified if it's really feasible without any restrictions).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants