---
type: email
from: Abbas Asad <notifications@github.com>
subject: [openai/openai-agents-python] Reorder hooks into chronological

 lifecycle order (PR #1677)
received: 2026-03-06 07:23:30
date_header: Sat, 06 Sep 2025 16:15:21 -0700
priority: normal
status: awaiting_approval
uid: 29663
---

## Email Content

**From:** Abbas Asad <notifications@github.com>
**Subject:** [openai/openai-agents-python] Reorder hooks into chronological

 lifecycle order (PR #1677)
**Date:** Sat, 06 Sep 2025 16:15:21 -0700

### Body (preview)

## Summary

This PR defines correct lifecycle order of hooks for both `RunHooksBase` and `AgentHooksBase`, aligning with the logical execution flow of an agent run.



## Changes Made

I have simply **reordered the hooks** to reflect their chronological execution sequence during an agent run.



### RunHooksBase 

```

on_agent_start

on_llm_start

on_llm_end

on_tool_start

on_tool_end

on_handoff

on_agent_end

```







### AgentHooksBase 

```

on_start

on_llm_start

on_llm_end

on_tool_start

on_tool_end

on_handoff

on_end

```







## Enhancement

- Establishes a clear and **logical sequence** for hook execution.

- Improves developer understanding by reflecting the **actual lifecycle**:

  - **Start → LLM Call → Tool Call  → Handoff (if any) → End**



This ordering provides consistency and clarity to understand the correct agent execution flow.

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



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



-- Commit Summary --



  * Reorder hooks into chronological lifecycle order



-- File Changes --



    M src/agents/lifecycle.py (74)



-- Patch Links --



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

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



-- 

Reply to this email directly or view it on GitHub:

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

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



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

---

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