Duplicate subgraph task execution with identical run_id/request_id creates forked checkpoints #1130

Closed
opened 2026-02-20 17:43:11 -05:00 by yindo · 1 comment
Owner

Originally created by @MarkoApostoloski on GitHub (Jan 29, 2026).

Checked other resources

  • This is a bug, not a usage question. For questions, please use the LangChain Forum (https://forum.langchain.com/).
  • 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

recognition_graph = recognition_graph.compile(checkpointer=True)
# ... other subgraphs similarly compiled

primary_graph.add_node("recognition_agent", recognition_graph)
# ... other subgraph nodes

graph = primary_graph.compile()  # Parent graph without explicit checkpointer

Error Message and Stack Trace (if applicable)


Description

When using a multi-agent architecture with subgraphs compiled with checkpointer=True, a single user request is being processed multiple times, creating duplicate checkpoints that fork from the same parent checkpoint.

Reproduction:

  1. Send a single message to the graph via LangGraph Studio or API
  2. Observe checkpoint history - multiple checkpoints created from the same parent

Evidence:
Example 1: Subgraph Agent Fork
Two checkpoints created from identical parent, same run_id and request_id:
Both forks generate separate LLM responses, resulting in duplicate API calls and inconsistent state.

Example 2: Fork at Step 0 (Before Subgraph Entry)
Forking also occurs at the initial node before any subgraph is entered:
In this case, even the message IDs differ, suggesting the request itself is being processed twice.

Example 3: Schema Mismatch Causes KeyError in One Fork
When routing to a subgraph, one fork succeeds while the other fails with KeyError('{agent_name}') due to state schema differences between parent and subgraph.

Expected Behavior
A single request with one run_id and request_id should create exactly one execution path and one set of checkpoints.

Actual Behavior
The same request creates multiple parallel execution paths with:

  • Different task IDs
  • Different checkpoint IDs
  • Different checkpoint namespaces
  • Potential state inconsistencies

Additional Context

  • Only one LangGraph API container is running
  • No load balancer or proxy in front of the service
  • Issue occurs both via LangGraph Studio and direct API calls
  • Issue persists across different subgraphs (recognition, dev_plan, etc.)

State Dumps

Fork 1:

{
"values": {
"messages": [
{
"content": "hello",
"type": "human",
"id": "7ed36b66-64df-4382-9d73-ba4484d17ddb"
}
],
"dialog_state": ["recognition_agent"]
},
"next": ["recognition_agent"],
"tasks": [
{
"id": "20351ca0-5254-b48b-309f-f148705b4ae0",
"name": "recognition_agent",
"checkpoint": {
"thread_id": "f6fa5556-3910-434d-9fc5-30c76c742d72",
"checkpoint_ns": "recognition_agent:20351ca0-5254-b48b-309f-f148705b4ae0"
}
}
],
"metadata": {
"step": 1,
"run_id": "019bac31-ef16-77fb-9840-c55a65bd526d",
"langgraph_request_id": "1ed0253d-8ce4-45f4-9bb0-4649c2fb2c75",
"langgraph_version": "1.0.2"
},
"created_at": "2026-01-11T08:35:13.548498+00:00",
"checkpoint_id": "1f0eec87-2ce6-6921-8001-302cc3716cd4",
"parent_checkpoint_id": "1f0eec87-25fb-6322-8000-84326049837c"
}

Fork 2:

{
"values": {
"messages": [
{
"content": "hello",
"type": "human",
"id": "7ed36b66-64df-4382-9d73-ba4484d17ddb"
}
],
"dialog_state": ["recognition_agent"]
},
"next": ["recognition_agent"],
"tasks": [
{
"id": "e1c3460e-b7b9-00f6-79f0-8060350c0bc4",
"name": "recognition_agent",
"checkpoint": {
"thread_id": "f6fa5556-3910-434d-9fc5-30c76c742d72",
"checkpoint_ns": "recognition_agent:e1c3460e-b7b9-00f6-79f0-8060350c0bc4"
}
}
],
"metadata": {
"step": 1,
"run_id": "019bac31-ef16-77fb-9840-c55a65bd526d",
"langgraph_request_id": "1ed0253d-8ce4-45f4-9bb0-4649c2fb2c75",
"langgraph_version": "1.0.2"
},
"created_at": "2026-01-11T08:35:15.466804+00:00",
"checkpoint_id": "1f0eec87-3f31-6f06-8001-c91e87c87951",
"parent_checkpoint_id": "1f0eec87-25fb-6322-8000-84326049837c"
}

System Info

Environment
langgraph: 1.0.2
langgraph-checkpoint: 3.0.1
langgraph-checkpoint-postgres: 3.0.1
langgraph-api: 0.5.8
Deployment: Self-hosted LangGraph Server (Docker, single container)
Database: PostgreSQL (Azure)

Originally created by @MarkoApostoloski on GitHub (Jan 29, 2026). ### Checked other resources - [x] This is a bug, not a usage question. For questions, please use the LangChain Forum (https://forum.langchain.com/). - [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 recognition_graph = recognition_graph.compile(checkpointer=True) # ... other subgraphs similarly compiled primary_graph.add_node("recognition_agent", recognition_graph) # ... other subgraph nodes graph = primary_graph.compile() # Parent graph without explicit checkpointer ``` ### Error Message and Stack Trace (if applicable) ```shell ``` ### Description When using a multi-agent architecture with subgraphs compiled with checkpointer=True, a single user request is being processed multiple times, creating duplicate checkpoints that fork from the same parent checkpoint. __Reproduction__: 1. Send a single message to the graph via LangGraph Studio or API 2. Observe checkpoint history - multiple checkpoints created from the same parent __Evidence__: Example 1: Subgraph Agent Fork Two checkpoints created from identical parent, same run_id and request_id: Both forks generate separate LLM responses, resulting in duplicate API calls and inconsistent state. Example 2: Fork at Step 0 (Before Subgraph Entry) Forking also occurs at the initial node before any subgraph is entered: In this case, even the message IDs differ, suggesting the request itself is being processed twice. Example 3: Schema Mismatch Causes KeyError in One Fork When routing to a subgraph, one fork succeeds while the other fails with KeyError('{agent_name}') due to state schema differences between parent and subgraph. __Expected Behavior__ A single request with one run_id and request_id should create exactly one execution path and one set of checkpoints. __Actual Behavior__ The same request creates multiple parallel execution paths with: - Different task IDs - Different checkpoint IDs - Different checkpoint namespaces - Potential state inconsistencies __Additional Context__ - Only one LangGraph API container is running - No load balancer or proxy in front of the service - Issue occurs both via LangGraph Studio and direct API calls - Issue persists across different subgraphs (recognition, dev_plan, etc.) State Dumps Fork 1: { "values": { "messages": [ { "content": "hello", "type": "human", "id": "7ed36b66-64df-4382-9d73-ba4484d17ddb" } ], "dialog_state": ["recognition_agent"] }, "next": ["recognition_agent"], "tasks": [ { "id": "20351ca0-5254-b48b-309f-f148705b4ae0", "name": "recognition_agent", "checkpoint": { "thread_id": "f6fa5556-3910-434d-9fc5-30c76c742d72", "checkpoint_ns": "recognition_agent:20351ca0-5254-b48b-309f-f148705b4ae0" } } ], "metadata": { "step": 1, "run_id": "019bac31-ef16-77fb-9840-c55a65bd526d", "langgraph_request_id": "1ed0253d-8ce4-45f4-9bb0-4649c2fb2c75", "langgraph_version": "1.0.2" }, "created_at": "2026-01-11T08:35:13.548498+00:00", "checkpoint_id": "1f0eec87-2ce6-6921-8001-302cc3716cd4", "parent_checkpoint_id": "1f0eec87-25fb-6322-8000-84326049837c" } Fork 2: { "values": { "messages": [ { "content": "hello", "type": "human", "id": "7ed36b66-64df-4382-9d73-ba4484d17ddb" } ], "dialog_state": ["recognition_agent"] }, "next": ["recognition_agent"], "tasks": [ { "id": "e1c3460e-b7b9-00f6-79f0-8060350c0bc4", "name": "recognition_agent", "checkpoint": { "thread_id": "f6fa5556-3910-434d-9fc5-30c76c742d72", "checkpoint_ns": "recognition_agent:e1c3460e-b7b9-00f6-79f0-8060350c0bc4" } } ], "metadata": { "step": 1, "run_id": "019bac31-ef16-77fb-9840-c55a65bd526d", "langgraph_request_id": "1ed0253d-8ce4-45f4-9bb0-4649c2fb2c75", "langgraph_version": "1.0.2" }, "created_at": "2026-01-11T08:35:15.466804+00:00", "checkpoint_id": "1f0eec87-3f31-6f06-8001-c91e87c87951", "parent_checkpoint_id": "1f0eec87-25fb-6322-8000-84326049837c" } ### System Info Environment langgraph: 1.0.2 langgraph-checkpoint: 3.0.1 langgraph-checkpoint-postgres: 3.0.1 langgraph-api: 0.5.8 Deployment: Self-hosted LangGraph Server (Docker, single container) Database: PostgreSQL (Azure)
yindo added the bugpending labels 2026-02-20 17:43:11 -05:00
yindo closed this issue 2026-02-20 17:43:11 -05:00
Author
Owner

@MarkoApostoloski commented on GitHub (Jan 29, 2026):

Additional Critical Evidence: Fork at Step -1 (__start__ Node)

Finding

Two checkpoints are created at step -1 (the __start__ node) with parent_checkpoint: null for both forks. This proves the request is being duplicated before any graph code executes.

Fork 1 (Step -1):

{
  "values": {},
  "next": ["__start__"],
  "tasks": [{"id": "5e14aa9c-8cdf-f98a-7df6-0a20bd395e4a", "name": "__start__"}],
  "metadata": {
    "step": -1,
    "run_id": "019bac23-c7f9-73ae-be8b-98d6cc6a9fb7",
    "langgraph_request_id": "f9d65e63-c1f6-450f-8d41-55913fd0839d"
  },
  "parent_checkpoint": null
}

Fork 2 (Step -1):

{
  "values": {},
  "next": ["__start__"],
  "tasks": [{"id": "da0f4c14-6f56-3ed7-bc36-2fd75dd8f3b9", "name": "__start__"}],
  "metadata": {
    "step": -1,
    "run_id": "019bac23-c7f9-73ae-be8b-98d6cc6a9fb7",
    "langgraph_request_id": "f9d65e63-c1f6-450f-8d41-55913fd0839d"
  },
  "parent_checkpoint": null
}
@MarkoApostoloski commented on GitHub (Jan 29, 2026): ## Additional Critical Evidence: Fork at Step -1 (`__start__` Node) ### Finding Two checkpoints are created at **step -1** (the `__start__` node) with **`parent_checkpoint: null`** for both forks. This proves the request is being duplicated **before any graph code executes**. ### Fork 1 (Step -1): ```json { "values": {}, "next": ["__start__"], "tasks": [{"id": "5e14aa9c-8cdf-f98a-7df6-0a20bd395e4a", "name": "__start__"}], "metadata": { "step": -1, "run_id": "019bac23-c7f9-73ae-be8b-98d6cc6a9fb7", "langgraph_request_id": "f9d65e63-c1f6-450f-8d41-55913fd0839d" }, "parent_checkpoint": null } Fork 2 (Step -1): { "values": {}, "next": ["__start__"], "tasks": [{"id": "da0f4c14-6f56-3ed7-bc36-2fd75dd8f3b9", "name": "__start__"}], "metadata": { "step": -1, "run_id": "019bac23-c7f9-73ae-be8b-98d6cc6a9fb7", "langgraph_request_id": "f9d65e63-c1f6-450f-8d41-55913fd0839d" }, "parent_checkpoint": null }
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langchain-ai/langgraph#1130