Files
langgraph/libs
jacoblee93 d7735fb0b2 fix(langgraph): merge configurable dicts across configs in ensure_config
Previously, when ensure_config was called with multiple configs (e.g.
Pregel.stream's ensure_config(self.config, config)), a later config's
configurable dict fully overwrote an earlier one. This caused values
bound via with_config({"configurable": {...}}) to be silently dropped
whenever the invoke-time config supplied any other configurable key.

Concretely, create_agent binds {configurable: {ls_agent_type: 'root'}}
via with_config, and any real invocation with a checkpointer supplies
{configurable: {thread_id: ...}} at invoke time. The bound ls_agent_type
was dropped, so no root-level runs were tagged with ls_agent_type='root'
in LangSmith.

Fix: merge the configurable dict across configs (stdlib merge_configs in
langchain_core already does this correctly; langgraph's merge_configs
helper in this same file also does this at line 109). Invoke-time values
still override bound values when keys collide.

Adds a regression test in tests/test_utils.py.
2026-04-19 03:28:51 -07:00
..
2026-04-17 10:13:03 -07:00
2026-04-17 19:41:13 +00:00