---
type: email
from: Erik Anstine <notifications@github.com>
subject: [openai/openai-agents-python] fix(run hooks): Add on_llm_start and

 on_llm_end run hook support in Runner.run() (PR #1619)
received: 2026-03-06 07:17:41
date_header: Fri, 29 Aug 2025 14:03:03 -0700
priority: normal
status: awaiting_approval
uid: 29067
---

## Email Content

**From:** Erik Anstine <notifications@github.com>
**Subject:** [openai/openai-agents-python] fix(run hooks): Add on_llm_start and

 on_llm_end run hook support in Runner.run() (PR #1619)
**Date:** Fri, 29 Aug 2025 14:03:03 -0700

### Body (preview)

### Summary 

This PR introduces support for on_llm_start and on_llm_end run hooks within the Runner.run() lifecycle.

Both hooks are now triggered consistently across streaming and non-streaming flows, including `_get_new_response` and `_run_single_turn_streamed`.



### Changes

Added on_llm_start and on_llm_end run hook calls (in line with agent hook counterparts) in:

- _get_new_response

- _run_single_turn_streamed

- Ensured hooks are fired in both streaming and non-streaming execution paths.

- Updated relevant flow so hooks execute before/after LLM calls consistently. _Note: as implemented run hooks will fire &quot;outside&quot; of agent hooks - because `asyncio.gather()` returns results of awaitables in the order received, `on_llm_start` would have the order run hook followed by agent hook. For the other way, `on_llm_end` would have the order agent hook, followed by run hook._ 



Fixes #1612 

You can view, comment on, or merge this pull request online at:



  https://github.com/openai/openai-agents-python/pull/1619



-- Commit Summary --



  * fix: llm_start/_end not firing on Runner.run

  * add tests for run hooks



-- File Changes --



    M src/agents/run.py (62)

    A tests/test_run_hooks.py (146)



-- Patch Links --



https://github.com/openai/openai-agents-python/pull/1619.patch

https://github.com/openai/openai-agents-python/pull/1619.diff



-- 

Reply to this email directly or view it on GitHub:

https://github.com/openai/openai-agents-python/pull/1619

You are receiving this because you are subscribed to this thread.



Message ID: &lt;openai/openai-agents-python/pull/1619@github.com&gt;

---

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