Skip to content

Conversation

rm-openai
Copy link
Collaborator

@rm-openai rm-openai commented Aug 28, 2025

No description provided.

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

Codex Review: Here are some suggestions.

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

About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. 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".

Comment on lines +579 to +589
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(

Choose a reason for hiding this comment

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

[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 the tool run.

Useful? React with 👍 / 👎.

@seratch seratch marked this pull request as draft August 28, 2025 23:21
@seratch seratch added enhancement New feature or request feature:core labels Aug 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request feature:core
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants