langchain-ai / langchain

🦜🔗 Build context-aware reasoning applications
https://python.langchain.com
MIT License
94.26k stars 15.24k forks source link

CallbackManager.merge(): Parent run IDs do not match warning when using subgraphs #25682

Open austinmw opened 2 months ago

austinmw commented 2 months ago

Checked other resources

Example Code

# Chatbot Graph
chatbot_graph = StateGraph(ChatbotGraphState, config_schema=GraphConfig)

# Chatbot Graph Nodes
chatbot_graph.add_node("router_llm", call_router_model)
chatbot_graph.add_node("chatbot_llm", call_chatbot_model)
chatbot_graph.add_node("generate_workout", workout_generator_system.compile())
chatbot_graph.add_node("reset_messages", reset_messages)

# Chatbot Graph Edges
chatbot_graph.add_edge(START, "router_llm")
chatbot_graph.add_conditional_edges("router_llm", route_response)
chatbot_graph.add_edge("generate_workout", "reset_messages")
chatbot_graph.add_edge("reset_messages", "chatbot_llm")
chatbot_graph.add_edge("chatbot_llm", END)

graph = chatbot_graph.compile()

# Note that `workout_generator_system` also has three subgraphs inside it.

Error Message and Stack Trace (if applicable)

CallbackManager.merge(): Parent run IDs do not match. Using the parent run ID of the first callback manager.


### Description

After refactoring my large graph into nested subgraphs, I get the above warning multiple times throughout the execution.

### System Info

System Information
------------------
> OS:  Darwin
> OS Version:  Darwin Kernel Version 23.5.0: Wed May  1 20:12:58 PDT 2024; root:xnu-10063.121.3~5/RELEASE_ARM64_T6000
> Python Version:  3.11.4 (main, Jun 20 2023, 17:23:00) [Clang 14.0.3 (clang-1403.0.22.14.1)]

Package Information
-------------------
> langchain_core: 0.2.33
> langchain: 0.2.14
> langchain_community: 0.2.12
> langsmith: 0.1.101
> langchain_aws: 0.1.16
> langchain_text_splitters: 0.2.2
> langgraph: 0.2.5

Optional packages not installed
-------------------------------
> langserve

Other Dependencies
------------------
> aiohttp: 3.10.5
> async-timeout: Installed. No version info available.
> boto3: 1.34.162
> dataclasses-json: 0.6.7
> httpx: 0.27.0
> jsonpatch: 1.33
> langgraph-checkpoint: 1.0.3
> numpy: 1.26.4
> orjson: 3.10.7
> packaging: 24.1
> pydantic: 2.8.2
> PyYAML: 6.0.2
> requests: 2.32.3
> SQLAlchemy: 2.0.32
> tenacity: 8.5.0
> typing-extensions: 4.12.2
gbaian10 commented 2 months ago

I have same issue.

Even running the examples from the documentation results in similar warnings.

It seems to be an issue that appeared after version 0.2.

vbarda commented 2 months ago

this issue is caused by a change in langchain-core==0.2.33. we're looking into it, in the meantime using 0.2.32 should help