[GH-ISSUE #475] [langgraph]: need better docs for RemainingSteps managed value #46

Open
opened 2026-02-17 17:19:03 -05:00 by yindo · 1 comment
Owner

Originally created by @gauravvgat on GitHub (Jul 31, 2025).
Original GitHub issue: https://github.com/langchain-ai/docs/issues/475

Issue with current documentation:

From what I understand from documentation the RemainingSteps is central and applies to all subgraphs as well. https://langchain-ai.github.io/langgraph/how-tos/graph-api/?h=remaining#impose-a-recursion-limit

In my case I have a routing graph which calls two graphs (A & B). Graph B has 4 nodes, one of which is a create_react_agent. All 3 graphs have different states with some shared channels.

I was getting graphrecursionerror so I added remaining_steps: RemainingSteps to all states to check. In Langsmith trace, I see that the subgraph's remaining_steps starts from 0 and from where previous one ended.

Idea or request for content:

The exact usage of remaining steps to control recursion errors from prebuilt create_react_agent or persist state in case of recursion errors.

Originally created by @gauravvgat on GitHub (Jul 31, 2025). Original GitHub issue: https://github.com/langchain-ai/docs/issues/475 ### Issue with current documentation: From what I understand from documentation the RemainingSteps is central and applies to all subgraphs as well. https://langchain-ai.github.io/langgraph/how-tos/graph-api/?h=remaining#impose-a-recursion-limit In my case I have a routing graph which calls two graphs (A & B). Graph B has 4 nodes, one of which is a create_react_agent. All 3 graphs have different states with some shared channels. I was getting graphrecursionerror so I added remaining_steps: RemainingSteps to all states to check. In Langsmith trace, I see that the subgraph's remaining_steps starts from 0 and from where previous one ended. ### Idea or request for content: The exact usage of remaining steps to control recursion errors from prebuilt create_react_agent or persist state in case of recursion errors.
yindo added the langgraphexternal labels 2026-02-17 17:19:03 -05:00
Author
Owner

@gauravvgat commented on GitHub (Aug 3, 2025):

ALso when deployed to langgraph platform, the recusion_limit is reset to 25. Below is my code snippet for compiling graph.

Compile the graph

graph = workflow.compile().with_config({"recursion_limit": 50})

But on langsmith, I see it's back to 25.

And there seems no way to send this limit from useStream.

const submitOptions = {
// Enable all stream modes including custom events
streamMode: ['values', 'updates', 'events', 'custom'] as Array<'values' | 'updates' | 'events' | 'custom'>,
streamSubgraphs: true,
streamResumable: true,
config: { recursionLimit: 50 }
};

const submitPayload = {
  messages: [{
    type: "human",
    content: input.trim()
  }],
  project_id: projectId || `project-${Date.now()}`, // Use provided projectId or generate a new one
  user_id: user.id 
};

It's not reflecting in langsmith traces. I have added

remaining_steps: RemainingSteps

to my states and it shows 25 in the langsmith trace.

What am i doing wrong?

@gauravvgat commented on GitHub (Aug 3, 2025): ALso when deployed to langgraph platform, the recusion_limit is reset to 25. Below is my code snippet for compiling graph. # Compile the graph graph = workflow.compile().with_config({"recursion_limit": 50}) But on langsmith, I see it's back to 25. And there seems no way to send this limit from useStream. const submitOptions = { // Enable all stream modes including custom events streamMode: ['values', 'updates', 'events', 'custom'] as Array<'values' | 'updates' | 'events' | 'custom'>, streamSubgraphs: true, streamResumable: true, config: { recursionLimit: 50 } }; const submitPayload = { messages: [{ type: "human", content: input.trim() }], project_id: projectId || `project-${Date.now()}`, // Use provided projectId or generate a new one user_id: user.id }; It's not reflecting in langsmith traces. I have added remaining_steps: RemainingSteps to my states and it shows 25 in the langsmith trace. What am i doing wrong?
yindo changed title from [langgraph]: need better docs for `RemainingSteps` managed value to [GH-ISSUE #475] [langgraph]: need better docs for `RemainingSteps` managed value 2026-06-05 17:24:44 -04:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langchain-ai/docs#46