ref(openai-agents): Use first class tool hooks when available - #6994
Open
alexander-alderman-webb wants to merge 13 commits into
Open
ref(openai-agents): Use first class tool hooks when available#6994alexander-alderman-webb wants to merge 13 commits into
alexander-alderman-webb wants to merge 13 commits into
Conversation
Contributor
Codecov Results 📊✅ 95162 passed | ⏭️ 6343 skipped | Total: 101505 | Pass Rate: 93.75% | Execution Time: 352m 59s 📊 Comparison with Base Branch
All tests are passing successfully. ✅ Patch coverage is 94.59%. Project has 2514 uncovered lines. Files with missing lines (2)
Coverage diff@@ Coverage Diff @@
## main #PR +/-##
==========================================
+ Coverage 89.88% 89.90% +0.02%
==========================================
Files 193 193 —
Lines 24834 24889 +55
Branches 8912 8936 +24
==========================================
+ Hits 22321 22375 +54
- Misses 2513 2514 +1
- Partials 1417 1419 +2Generated by Codecov Action |
alexander-alderman-webb
marked this pull request as ready for review
August 3, 2026 14:21
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Want reviews to match your repository better? Bugbot Learning can learn team-specific rules from PR activity. A team admin can enable Learning in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit bb76a15. Configure here.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Description
Register a
RunHooksinstance or patch a user-provided hooks instance if it exists. Inject the resulting instance as thehookskeyword-only argument toAgentRunner.run()andAgentRunner.run_streamed().Note that the hooks are only added starting with
openai-agentsversion 0.3.2 as tool call arguments are unavailable in prior versions.The
openai-agents/patches/tools.pyfile can be removed in the next major due to redundancy with the hooks.Rename
responses_tool_call_model_responsesby prefixing the fixture withnonstreaming_, and add a minimal equivalent streaming fixture. Add a variant of thetest_tool_execution_spantest that callsAgentRunner.run_streamed()instead ofAgentRunner.run().Issues
Closes #6988
Reminders
uv run ruff.feat:,fix:,ref:,meta:)