Skip to content

Commit 1d8ba06

Browse files
yanmxaclaude
andcommitted
fix: restore correct context parameter for function tool hooks
- Function tools should use tool_context (ToolContext) - Computer/shell tools use context_wrapper (RunContextWrapper) - This maintains consistency with original codebase 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
1 parent ee80bd5 commit 1d8ba06

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/agents/_run_impl.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -546,9 +546,9 @@ async def run_single_tool(action: ToolRunFunction) -> Any:
546546
span_fn.span_data.input = tool_call.arguments
547547
try:
548548
_, _, result = await asyncio.gather(
549-
hooks.on_tool_start(context_wrapper, agent, action),
549+
hooks.on_tool_start(tool_context, agent, action),
550550
(
551-
agent.hooks.on_tool_start(context_wrapper, agent, action)
551+
agent.hooks.on_tool_start(tool_context, agent, action)
552552
if agent.hooks
553553
else _coro.noop_coroutine()
554554
),

0 commit comments

Comments
 (0)