Patch Changes
-
#10443
ff6822eThanks @christian-bromann! - fix(langchain): respect version:"v1" in afterModel router's pending tool call path -
#10446
888224cThanks @hntrl! - fix(agents): propagate store and configurable to ToolNode middleware runtime -
#10444
82d56cbThanks @christian-bromann! - fix(langchain/agents): dispatch tool calls via Send in afterModel router for version:"v2"Breaking change for
version: "v2"+afterModelmiddleware users.Previously, when
afterModelmiddleware was present,createAgentalways routed all tool calls from anAIMessageto a singleToolNodeinvocation — regardless of theversionoption. This meantversion: "v2"silently behaved likeversion: "v1"(parallel viaPromise.allin one node) wheneverafterModelmiddleware was used.#createAfterModelRouternow correctly respects#toolBehaviorVersion:version: "v1"— routes the fullAIMessageto a singleToolNodeinvocation; all tool calls run concurrently viaPromise.all(unchanged behaviour).version: "v2"— dispatches each tool call as a separateSendtask, matching the behaviour of#createModelRouterwhen noafterModelmiddleware is present, and matching Python LangGraph'spost_model_hook_router.
Migration: If you use
version: "v2"(the default) together withafterModelmiddleware and rely on the previous single-node parallel execution, switch toversion: "v1"to preserve that behaviour. See theversionJSDoc onCreateAgentParamsfor guidance on which option to choose.