TypeError with 'checkpoint_during' in Pregel.astream() when using langgraph dev with langgraph==0.4.5 #631

Closed
opened 2026-02-20 17:41:02 -05:00 by yindo · 2 comments
Owner

Originally created by @Roger-Parkinson-EHP on GitHub (May 18, 2025).

Checked other resources

  • This is a bug, not a usage question. For questions, please use GitHub Discussions.
  • I added a clear and detailed title that summarizes the issue.
  • I read what a minimal reproducible example is (https://stackoverflow.com/help/minimal-reproducible-example).
  • I included a self-contained, minimal example that demonstrates the issue INCLUDING all the relevant imports. The code run AS IS to reproduce the issue.

Example Code

# File: my_minimal_agent.py
from typing import Annotated
from typing_extensions import TypedDict
from langgraph.graph import StateGraph, START, END
from langgraph.graph.message import add_messages
from langchain_core.messages import AIMessage, BaseMessage

class MinimalState(TypedDict):
    messages: Annotated[list[BaseMessage], add_messages]

def minimal_echo_node(state: MinimalState):
    # Ensure messages list is not empty and access content correctly
    if not state["messages"]:
        return {"messages": [AIMessage(content="Error: No messages in state")]}
    
    last_message = state["messages"][-1]
    last_message_content = ""
    if hasattr(last_message, 'content'):
        last_message_content = str(last_message.content)
    else: # Handle tuple case if direct input was (role, content)
        last_message_content = str(last_message)


    response = f"Minimal Echo: {last_message_content}"
    print(f"[MINIMAL_ECHO] Responding with: {response}")
    return {"messages": [AIMessage(content=response)]}

builder = StateGraph(MinimalState)
builder.add_node("echo", minimal_echo_node)
builder.add_edge(START, "echo")
builder.add_edge("echo", END)
graph = builder.compile()

print("Minimal graph compiled.")

# To run this:
# 1. Save as my_minimal_agent.py
# 2. Create langgraph.json in the same directory:
#    {
#      "graphs": {
#        "minimal_test_agent": "my_minimal_agent:graph"
#      },
#      "dependencies": ["."]
#    }
# 3. Create a venv: uv venv .venv --python 3.11
# 4. Activate: .\.venv\Scripts\activate (Windows)
# 5. Install: uv pip install langgraph==0.4.5 langchain-core==0.3.60
# 6. Run server: uv run langgraph dev --port 2025
# 7. Send request (see curl/PowerShell example in description)

Error Message and Stack Trace (if applicable)

[dev:agent] 2025-05-19T00:55:36.976601Z [error    ] Background run failed. Exception: Pregel.astream() got an unexpected keyword argument 'checkpoint_during' [langgraph_api.worker] ... (include assistant_id, graph_id, etc. if relevant from your logs) ...
[dev:agent] Traceback (most recent call last):
[dev:agent]   File "C:\Users\roger\AppData\Local\Programs\Python\Python312\Lib\site-packages\langgraph_api\worker.py", line 148, in worker
[dev:agent]     await asyncio.wait_for(consume(stream, run_id), BG_JOB_TIMEOUT_SECS)
[dev:agent]   File "C:\Users\roger\AppData\Local\Programs\Python\Python312\Lib\asyncio\tasks.py", 
line 520, in wait_for
[dev:agent]     return await fut
[dev:agent]            ^^^^^^^^^
[dev:agent]   File "C:\Users\roger\AppData\Local\Programs\Python\Python312\Lib\site-packages\langgraph_api\stream.py", line 295, in consume
[dev:agent]     raise e from g
[dev:agent]   File "C:\Users\roger\AppData\Local\Programs\Python\Python312\Lib\site-packages\langgraph_api\stream.py", line 284, in consume
[dev:agent]     async for mode, payload in stream:
[dev:agent]   File "C:\Users\roger\AppData\Local\Programs\Python\Python312\Lib\site-packages\langgraph_api\stream.py", line 212, in astream_state
[dev:agent]     graph.astream(
[dev:agent] TypeError: Pregel.astream() got an unexpected keyword argument 'checkpoint_during'

Description

  • I'm trying to use langgraph dev to serve a very simple LangGraph graph (Python langgraph==0.4.5).
  • When a streaming request is made to this server (e.g., via curl/Invoke-RestMethod or the @langchain/langgraph-sdk JS client), the langgraph_api component within langgraph dev fails.
  • The error is TypeError: Pregel.astream() got an unexpected keyword argument 'checkpoint_during'. This error occurs on the server side within the langgraph_api/stream.py file when it attempts to call graph.astream().
  • This happens even when the client (e.g., curl) sends a minimal, clean request body that does not contain any checkpoint_during argument itself. This suggests an internal issue within langgraph dev or langgraph==0.4.5 where the langgrSteps to Reproduce (Minimal):
    Set up a Python 3.11 environment.
    Install langgraph==0.4.5 and langchain-core==0.3.60 (these were the versions resolved by uv pip install langgraph).
    Create my_minimal_agent.py and langgraph.json as shown in the "Example Code" section.
    Run uv run langgraph dev --port 2025.
    Create a thread by sending a POST request to http://localhost:2025/threads with an empty JSON body {}. Note the returned thread_id.
    Send a streaming run request to the agent using curl or PowerShell Invoke-RestMethod:

Example PowerShell

$threadId = "YOUR_ACQUIRED_THREAD_ID"
$headers = @{ "Content-Type" = "application/json"; "Accept" = "text/event-stream" }
$body = @{ input = @{ messages = @( @{ type = "human"; content = "Hello" } ) }; assistant_id = "minimal_test_agent"; stream_mode = @("values", "messages") } | ConvertTo-Json -Depth 5
Invoke-RestMethod -Uri "http://localhost:2025/threads/$threadId/runs/stream" -Method Post -Headers $headers -Body $body
Use code with caution.
Powershell
Observe the TypeError in the langgraph dev server logs. The client will receive an error event.
Expected Behavior: The minimal echo agent should process the stream and return the echoed message.
Actual Behavior: The server throws a TypeError because checkpoint_during is being passed to Pregel.astream() by the langgraph_api's stream handling logic.aph_api is attempting to pass this argument to Pregel.astream() inappropriately.

System Info

python -m langchain_core.sys_info

System Information

OS: Windows
OS Version: 10.0.19045
Python Version: 3.12.9 (tags/v3.12.9:fdb8142, Feb 4 2025, 15:27:58) [MSC v.1942 64 bit (AMD64)]

Package Information

langchain_core: 0.3.60
langchain: 0.3.25
langsmith: 0.3.42
langchain_anthropic: 0.3.13
langchain_google_genai: 2.1.4
langchain_huggingface: 0.2.0
langchain_openai: 0.3.17
langchain_text_splitters: 0.3.8
langgraph_api: 0.2.27
langgraph_cli: 0.2.10
langgraph_license: Installed. No version info available.
langgraph_runtime: Installed. No version info available.
langgraph_runtime_inmem: 0.0.11
langgraph_sdk: 0.1.69

Optional packages not installed

langserve

Other Dependencies

anthropic<1,>=0.51.0: Installed. No version info available.
async-timeout<5.0.0,>=4.0.0;: Installed. No version info available.
blockbuster: 1.5.24
click: 8.2.0
cloudpickle: 3.1.1
cryptography: 44.0.3
filetype: 1.2.0
google-ai-generativelanguage: 0.6.18
httpx: 0.28.1
huggingface-hub>=0.30.2: Installed. No version info available.
jsonpatch<2.0,>=1.33: Installed. No version info available.
jsonschema-rs: 0.29.1
langchain-anthropic;: Installed. No version info available.
langchain-aws;: Installed. No version info available.
langchain-azure-ai;: Installed. No version info available.
langchain-cohere;: Installed. No version info available.
langchain-community;: Installed. No version info available.
langchain-core<1.0.0,>=0.3.51: Installed. No version info available.
langchain-core<1.0.0,>=0.3.58: Installed. No version info available.
langchain-core<1.0.0,>=0.3.59: Installed. No version info available.
langchain-deepseek;: Installed. No version info available.
langchain-fireworks;: Installed. No version info available.
langchain-google-genai;: Installed. No version info available.
langchain-google-vertexai;: Installed. No version info available.
langchain-groq;: Installed. No version info available.
langchain-huggingface;: Installed. No version info available.
langchain-mistralai;: Installed. No version info available.
langchain-ollama;: Installed. No version info available.
langchain-openai;: Installed. No version info available.
langchain-perplexity;: Installed. No version info available.
langchain-text-splitters<1.0.0,>=0.3.8: Installed. No version info available.
langchain-together;: Installed. No version info available.
langchain-xai;: Installed. No version info available.
langgraph: 0.2.76
langgraph-checkpoint: 2.0.26
langsmith-pyo3: Installed. No version info available.
langsmith<0.4,>=0.1.126: Installed. No version info available.
langsmith<0.4,>=0.1.17: Installed. No version info available.
openai-agents: Installed. No version info available.
openai<2.0.0,>=1.68.2: Installed. No version info available.
opentelemetry-api: Installed. No version info available.
opentelemetry-exporter-otlp-proto-http: Installed. No version info available.
opentelemetry-sdk: Installed. No version info available.
orjson: 3.10.18
packaging: 24.2
packaging<25,>=23.2: Installed. No version info available.
pydantic: 2.11.4
pydantic<3.0.0,>=2.7.4: Installed. No version info available.
pydantic>=2.7.4: Installed. No version info available.
pyjwt: 2.10.1
pytest: Installed. No version info available.
python-dotenv: 1.1.0
PyYAML>=5.3: Installed. No version info available.
requests: 2.32.3
requests-toolbelt: 1.0.0
requests<3,>=2: Installed. No version info available.
rich: Installed. No version info available.
sentence-transformers>=2.6.0: Installed. No version info available.
SQLAlchemy<3,>=1.4: Installed. No version info available.
sse-starlette: 2.1.3
starlette: 0.46.2
structlog: 25.3.0
tenacity: 9.1.2
tenacity!=8.4.0,<10.0.0,>=8.1.0: Installed. No version info available.
tiktoken<1,>=0.7: Installed. No version info available.
tokenizers>=0.19.1: Installed. No version info available.
transformers>=4.39.0: Installed. No version info available.
truststore: 0.10.1
typing-extensions>=4.7: Installed. No version info available.
uvicorn: 0.34.2
watchfiles: 1.0.5
zstandard: 0.23.0

Originally created by @Roger-Parkinson-EHP on GitHub (May 18, 2025). ### Checked other resources - [x] This is a bug, not a usage question. For questions, please use GitHub Discussions. - [x] I added a clear and detailed title that summarizes the issue. - [x] I read what a minimal reproducible example is (https://stackoverflow.com/help/minimal-reproducible-example). - [x] I included a self-contained, minimal example that demonstrates the issue INCLUDING all the relevant imports. The code run AS IS to reproduce the issue. ### Example Code ```python # File: my_minimal_agent.py from typing import Annotated from typing_extensions import TypedDict from langgraph.graph import StateGraph, START, END from langgraph.graph.message import add_messages from langchain_core.messages import AIMessage, BaseMessage class MinimalState(TypedDict): messages: Annotated[list[BaseMessage], add_messages] def minimal_echo_node(state: MinimalState): # Ensure messages list is not empty and access content correctly if not state["messages"]: return {"messages": [AIMessage(content="Error: No messages in state")]} last_message = state["messages"][-1] last_message_content = "" if hasattr(last_message, 'content'): last_message_content = str(last_message.content) else: # Handle tuple case if direct input was (role, content) last_message_content = str(last_message) response = f"Minimal Echo: {last_message_content}" print(f"[MINIMAL_ECHO] Responding with: {response}") return {"messages": [AIMessage(content=response)]} builder = StateGraph(MinimalState) builder.add_node("echo", minimal_echo_node) builder.add_edge(START, "echo") builder.add_edge("echo", END) graph = builder.compile() print("Minimal graph compiled.") # To run this: # 1. Save as my_minimal_agent.py # 2. Create langgraph.json in the same directory: # { # "graphs": { # "minimal_test_agent": "my_minimal_agent:graph" # }, # "dependencies": ["."] # } # 3. Create a venv: uv venv .venv --python 3.11 # 4. Activate: .\.venv\Scripts\activate (Windows) # 5. Install: uv pip install langgraph==0.4.5 langchain-core==0.3.60 # 6. Run server: uv run langgraph dev --port 2025 # 7. Send request (see curl/PowerShell example in description) ``` ### Error Message and Stack Trace (if applicable) ```shell [dev:agent] 2025-05-19T00:55:36.976601Z [error ] Background run failed. Exception: Pregel.astream() got an unexpected keyword argument 'checkpoint_during' [langgraph_api.worker] ... (include assistant_id, graph_id, etc. if relevant from your logs) ... [dev:agent] Traceback (most recent call last): [dev:agent] File "C:\Users\roger\AppData\Local\Programs\Python\Python312\Lib\site-packages\langgraph_api\worker.py", line 148, in worker [dev:agent] await asyncio.wait_for(consume(stream, run_id), BG_JOB_TIMEOUT_SECS) [dev:agent] File "C:\Users\roger\AppData\Local\Programs\Python\Python312\Lib\asyncio\tasks.py", line 520, in wait_for [dev:agent] return await fut [dev:agent] ^^^^^^^^^ [dev:agent] File "C:\Users\roger\AppData\Local\Programs\Python\Python312\Lib\site-packages\langgraph_api\stream.py", line 295, in consume [dev:agent] raise e from g [dev:agent] File "C:\Users\roger\AppData\Local\Programs\Python\Python312\Lib\site-packages\langgraph_api\stream.py", line 284, in consume [dev:agent] async for mode, payload in stream: [dev:agent] File "C:\Users\roger\AppData\Local\Programs\Python\Python312\Lib\site-packages\langgraph_api\stream.py", line 212, in astream_state [dev:agent] graph.astream( [dev:agent] TypeError: Pregel.astream() got an unexpected keyword argument 'checkpoint_during' ``` ### Description - I'm trying to use langgraph dev to serve a very simple LangGraph graph (Python langgraph==0.4.5). - When a streaming request is made to this server (e.g., via curl/Invoke-RestMethod or the @langchain/langgraph-sdk JS client), the langgraph_api component within langgraph dev fails. - The error is TypeError: Pregel.astream() got an unexpected keyword argument 'checkpoint_during'. This error occurs on the server side within the langgraph_api/stream.py file when it attempts to call graph.astream(). - This happens even when the client (e.g., curl) sends a minimal, clean request body that does not contain any checkpoint_during argument itself. This suggests an internal issue within langgraph dev or langgraph==0.4.5 where the langgrSteps to Reproduce (Minimal): Set up a Python 3.11 environment. Install langgraph==0.4.5 and langchain-core==0.3.60 (these were the versions resolved by uv pip install langgraph). Create my_minimal_agent.py and langgraph.json as shown in the "Example Code" section. Run uv run langgraph dev --port 2025. Create a thread by sending a POST request to http://localhost:2025/threads with an empty JSON body {}. Note the returned thread_id. Send a streaming run request to the agent using curl or PowerShell Invoke-RestMethod: # Example PowerShell $threadId = "YOUR_ACQUIRED_THREAD_ID" $headers = @{ "Content-Type" = "application/json"; "Accept" = "text/event-stream" } $body = @{ input = @{ messages = @( @{ type = "human"; content = "Hello" } ) }; assistant_id = "minimal_test_agent"; stream_mode = @("values", "messages") } | ConvertTo-Json -Depth 5 Invoke-RestMethod -Uri "http://localhost:2025/threads/$threadId/runs/stream" -Method Post -Headers $headers -Body $body Use code [with caution](https://support.google.com/legal/answer/13505487). Powershell Observe the TypeError in the langgraph dev server logs. The client will receive an error event. Expected Behavior: The minimal echo agent should process the stream and return the echoed message. Actual Behavior: The server throws a TypeError because checkpoint_during is being passed to Pregel.astream() by the langgraph_api's stream handling logic.aph_api is attempting to pass this argument to Pregel.astream() inappropriately. ### System Info python -m langchain_core.sys_info System Information ------------------ > OS: Windows > OS Version: 10.0.19045 > Python Version: 3.12.9 (tags/v3.12.9:fdb8142, Feb 4 2025, 15:27:58) [MSC v.1942 64 bit (AMD64)] Package Information ------------------- > langchain_core: 0.3.60 > langchain: 0.3.25 > langsmith: 0.3.42 > langchain_anthropic: 0.3.13 > langchain_google_genai: 2.1.4 > langchain_huggingface: 0.2.0 > langchain_openai: 0.3.17 > langchain_text_splitters: 0.3.8 > langgraph_api: 0.2.27 > langgraph_cli: 0.2.10 > langgraph_license: Installed. No version info available. > langgraph_runtime: Installed. No version info available. > langgraph_runtime_inmem: 0.0.11 > langgraph_sdk: 0.1.69 Optional packages not installed ------------------------------- > langserve Other Dependencies ------------------ > anthropic<1,>=0.51.0: Installed. No version info available. > async-timeout<5.0.0,>=4.0.0;: Installed. No version info available. > blockbuster: 1.5.24 > click: 8.2.0 > cloudpickle: 3.1.1 > cryptography: 44.0.3 > filetype: 1.2.0 > google-ai-generativelanguage: 0.6.18 > httpx: 0.28.1 > huggingface-hub>=0.30.2: Installed. No version info available. > jsonpatch<2.0,>=1.33: Installed. No version info available. > jsonschema-rs: 0.29.1 > langchain-anthropic;: Installed. No version info available. > langchain-aws;: Installed. No version info available. > langchain-azure-ai;: Installed. No version info available. > langchain-cohere;: Installed. No version info available. > langchain-community;: Installed. No version info available. > langchain-core<1.0.0,>=0.3.51: Installed. No version info available. > langchain-core<1.0.0,>=0.3.58: Installed. No version info available. > langchain-core<1.0.0,>=0.3.59: Installed. No version info available. > langchain-deepseek;: Installed. No version info available. > langchain-fireworks;: Installed. No version info available. > langchain-google-genai;: Installed. No version info available. > langchain-google-vertexai;: Installed. No version info available. > langchain-groq;: Installed. No version info available. > langchain-huggingface;: Installed. No version info available. > langchain-mistralai;: Installed. No version info available. > langchain-ollama;: Installed. No version info available. > langchain-openai;: Installed. No version info available. > langchain-perplexity;: Installed. No version info available. > langchain-text-splitters<1.0.0,>=0.3.8: Installed. No version info available. > langchain-together;: Installed. No version info available. > langchain-xai;: Installed. No version info available. > langgraph: 0.2.76 > langgraph-checkpoint: 2.0.26 > langsmith-pyo3: Installed. No version info available. > langsmith<0.4,>=0.1.126: Installed. No version info available. > langsmith<0.4,>=0.1.17: Installed. No version info available. > openai-agents: Installed. No version info available. > openai<2.0.0,>=1.68.2: Installed. No version info available. > opentelemetry-api: Installed. No version info available. > opentelemetry-exporter-otlp-proto-http: Installed. No version info available. > opentelemetry-sdk: Installed. No version info available. > orjson: 3.10.18 > packaging: 24.2 > packaging<25,>=23.2: Installed. No version info available. > pydantic: 2.11.4 > pydantic<3.0.0,>=2.7.4: Installed. No version info available. > pydantic>=2.7.4: Installed. No version info available. > pyjwt: 2.10.1 > pytest: Installed. No version info available. > python-dotenv: 1.1.0 > PyYAML>=5.3: Installed. No version info available. > requests: 2.32.3 > requests-toolbelt: 1.0.0 > requests<3,>=2: Installed. No version info available. > rich: Installed. No version info available. > sentence-transformers>=2.6.0: Installed. No version info available. > SQLAlchemy<3,>=1.4: Installed. No version info available. > sse-starlette: 2.1.3 > starlette: 0.46.2 > structlog: 25.3.0 > tenacity: 9.1.2 > tenacity!=8.4.0,<10.0.0,>=8.1.0: Installed. No version info available. > tiktoken<1,>=0.7: Installed. No version info available. > tokenizers>=0.19.1: Installed. No version info available. > transformers>=4.39.0: Installed. No version info available. > truststore: 0.10.1 > typing-extensions>=4.7: Installed. No version info available. > uvicorn: 0.34.2 > watchfiles: 1.0.5 > zstandard: 0.23.0
yindo closed this issue 2026-02-20 17:41:02 -05:00
Author
Owner

@hinthornw commented on GitHub (May 18, 2025):

In the "other dependencies" list above, you have "langgraph: 0.2.76" listed.

With uv, if you run uv run ..., it will use the version specified in hyour pyproject.toml file, even if you had done uv pip install ...

Are you sure you are actually running a version that supports checkpoint_during?

All the above indicate that the version that you're actually executing locally is out of date.

@hinthornw commented on GitHub (May 18, 2025): In the "other dependencies" list above, you have "langgraph: 0.2.76" listed. With uv, if you run `uv run ...`, it will use the version specified in hyour pyproject.toml file, even if you had done `uv pip install ...` Are you sure you are actually running a version that supports checkpoint_during? All the above indicate that the version that you're actually executing locally is out of date.
Author
Owner

@Roger-Parkinson-EHP commented on GitHub (May 20, 2025):

False positive.

@Roger-Parkinson-EHP commented on GitHub (May 20, 2025): False positive.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langchain-ai/langgraph#631