---
type: email
from: "chatgpt-codex-connector[bot]" <notifications@github.com>
subject: Re: [openai/openai-agents-python] [WIP] Tool guardrails (PR #1606)
received: 2026-03-06 07:16:22
date_header: Thu, 28 Aug 2025 13:13:36 -0700
priority: normal
status: awaiting_approval
uid: 28930
---

## Email Content

**From:** "chatgpt-codex-connector[bot]" <notifications@github.com>
**Subject:** Re: [openai/openai-agents-python] [WIP] Tool guardrails (PR #1606)
**Date:** Thu, 28 Aug 2025 13:13:36 -0700

### Body (preview)

@chatgpt-codex-connector[bot] commented on this pull request.



Codex Review: Here are some suggestions.



Reply with `@codex fix comments` to fix any unresolved comments.



<details> <summary>About Codex in GitHub</summary>



[Your team has set up Codex to review pull requests in this repo](http://chatgpt.com/codex/settings/general). Reviews are triggered when you open a pull request for review, mark a draft as ready, or 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 fix this CI failure" or "@codex address that feedback".

</details>



> +                    if final_result is None:

+                        # 2) Actually run the tool

+                        await asyncio.gather(

+                            hooks.on_tool_start(tool_context, agent, func_tool),

+                            (

+                                agent.hooks.on_tool_start(tool_context, agent, func_tool)

+                                if agent.hooks

+                                else _coro.noop_coroutine()

+                            ),

+                        )

+                        real_result = await func_tool.on_invoke_tool(



**[P1] Run tool start hooks concurrently with tool execution again**



The run pipeline now awaits both `hooks.on_tool_start` callbacks to finish before invoking the tool itself. The docstring for `RunHooksBase.on_tool_start` states that these callbacks are “called concurrently with tool invocation,” and prior code used `asyncio.gather` to dispatch the start hooks and the tool coroutine together. After the guardrail refactor, the call at lines 579‑588 completes before `func_tool.on_invoke_tool` is awaited, so any slow hook will delay the actual tool call and violate the documented contract. Please launch the tool invocation concurrently with the start hooks (as before) or otherwise ensure the hook cannot block

---

## Suggested Actions
- [ ] Reply
- [ ] Archive
- [ ] Escalate
