Copy of CompiledStateGraph request mandatory to explicit "update={}" #279

Closed
opened 2026-02-20 17:35:02 -05:00 by yindo · 0 comments
Owner

Originally created by @SimoneDArco on GitHub (Oct 11, 2024).

Checked other resources

  • I added a very descriptive title to this issue.
  • I searched the LangGraph/LangChain documentation with the integrated search.
  • I used the GitHub search to find a similar question and didn't find it.
  • I am sure that this is a bug in LangGraph/LangChain rather than my code.
  • I am sure this is better as an issue rather than a GitHub discussion, since this is a LangGraph bug and not a design question.

Example Code

from typing import TypedDict

class AgentState(TypedDict):
    hello_msg: str

def node__entry_point(agent_state: AgentState):
    agent_state["hello_msg"] = "Hello, World!"
    return agent_state

def node__END(agent_state: AgentState):
    return agent_state

from langgraph.graph import StateGraph, END


workflow = StateGraph(AgentState)

workflow.add_node("entry_point", node__entry_point)
workflow.add_node("END", node__END)

workflow.add_edge("entry_point", "END")
workflow.add_edge("END", END)

workflow.set_entry_point("entry_point")

app = workflow.compile()

# This does not work
copy_app = app.copy()
# And this works
copy_app = app.copy(update={})

Error Message and Stack Trace (if applicable)

Traceback (most recent call last):
  File "c:\Users\sdarco\OneDrive - CAMOZZI GROUP SPA\Desktop\test.py", line 29, in <module>
    copy_app = app.copy()
               ^^^^^^^^^^
TypeError: Pregel.copy() missing 1 required positional argument: 'update'

Description

Yesterday 10/10, while updating langgraph to latest version I had this exception on my code. Older versions works with app.copy(), actually works only with app.copy(update={}).

Also no documentation is available on this parameter (see on pregel/__init__.py, line 255)

System Info

langgraph==0.2.35
platform Windows 10 Enterprise LTSC
python 3.11.10

Originally created by @SimoneDArco on GitHub (Oct 11, 2024). ### Checked other resources - [X] I added a very descriptive title to this issue. - [X] I searched the [LangGraph](https://langchain-ai.github.io/langgraph/)/LangChain documentation with the integrated search. - [X] I used the GitHub search to find a similar question and didn't find it. - [X] I am sure that this is a bug in LangGraph/LangChain rather than my code. - [X] I am sure this is better as an issue [rather than a GitHub discussion](https://github.com/langchain-ai/langgraph/discussions/new/choose), since this is a LangGraph bug and not a design question. ### Example Code ```python from typing import TypedDict class AgentState(TypedDict): hello_msg: str def node__entry_point(agent_state: AgentState): agent_state["hello_msg"] = "Hello, World!" return agent_state def node__END(agent_state: AgentState): return agent_state from langgraph.graph import StateGraph, END workflow = StateGraph(AgentState) workflow.add_node("entry_point", node__entry_point) workflow.add_node("END", node__END) workflow.add_edge("entry_point", "END") workflow.add_edge("END", END) workflow.set_entry_point("entry_point") app = workflow.compile() # This does not work copy_app = app.copy() # And this works copy_app = app.copy(update={}) ``` ### Error Message and Stack Trace (if applicable) ```shell Traceback (most recent call last): File "c:\Users\sdarco\OneDrive - CAMOZZI GROUP SPA\Desktop\test.py", line 29, in <module> copy_app = app.copy() ^^^^^^^^^^ TypeError: Pregel.copy() missing 1 required positional argument: 'update' ``` ### Description Yesterday 10/10, while updating langgraph to latest version I had this exception on my code. Older versions works with app.copy(), actually works only with app.copy(update={}). Also no documentation is available on this parameter (see on pregel/__init__.py, line 255) ### System Info langgraph==0.2.35 platform Windows 10 Enterprise LTSC python 3.11.10
yindo closed this issue 2026-02-20 17:35:02 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langchain-ai/langgraph#279