mirror of
https://github.com/langchain-ai/langgraph.git
synced 2026-08-20 14:42:28 +02:00
Allow `pre_model_hook` and `post_model_hook` in `create_react_agent` to accept a list of `RunnableLike` callables in addition to a single hook. When a list is provided the hooks are composed in order: each hook receives the graph state merged with all prior hooks' updates, and the final merged update is returned to the graph. This mirrors the middleware-stack pattern familiar from HTTP frameworks (Express, FastAPI, Starlette) and allows hook logic to be written as small, reusable units that can be composed without manually threading state between them.