Skip to content

Conversation

Abbas-Asad
Copy link
Contributor

No description provided.

## 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.
Resolved all CI linting errors in lifecycle.py to comply with project style guidelines and unblock the failing lint check in CI.
@Abbas-Asad Abbas-Asad closed this Sep 9, 2025
@Abbas-Asad Abbas-Asad deleted the Abbas-Asad-patch-12 branch September 9, 2025 21:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant