LangGraph agent executions reach recursion limit across basic and provider-backed configurations
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 420
- Forks
- 60
- Avg merge
- 9h 30m
- Merged PRs (30d)
- 4
Description
Description
Multiple LangGraph agent execution tests load successfully but do not terminate. Instead, execution repeatedly traverses the graph until LangGraph raises:
langgraph.errors.GraphRecursionError:
Recursion limit of 800 reached without hitting a stop condition.
The affected test groups are:
- Basic agent execution.
- VLLM execution.
- OpenAI execution.
- OpenAI-compatible execution.
Representative tests include:
tests/agent/validation/test_valid_configs_agent.pytests/llms/execution/test_execution_llmconfig_with_agent.py
The affected LLM configurations include:
vllmconfig_with_agent.yamlopenaiconfig_with_agent.yamlopenaicompatibleconfig_with_agent.yaml
The LangGraph CTS runtime explicitly sets:
{"configurable": {"thread_id": "1"}, "recursion_limit": 800}
in langgraphruntime/runtime.py:101-103.
The logs show that the graph reaches this limit without reaching a terminal state. This occurs across multiple model-provider paths, which suggests a shared graph-construction, response-normalization, or termination issue rather than an isolated provider failure.
The LangGraph adapter builds the agent graph through _create_react_agent_with_given_info() and configures the graph with:
- The converted model.
- Converted tools.
- The Agent Spec system prompt.
- The Agent Spec output model.
- The LangGraph state schema.
- The configured checkpointer.
Relevant construction code is in _langgraphconverter.py:1143-1193.
Possible failure modes include:
- A normal assistant response is incorrectly interpreted as an incomplete continuation.
- A model response is repeatedly classified as a tool call.
- The graph routing condition does not recognize the terminal response.
- The response format or structured-response extraction prevents the stop condition.
- The provider-specific response shape is not normalized into the message format expected by the graph.
- A tool or model node returns state that causes the graph to re-enter the same node.
The Ollama execution failure should be tracked separately unless the endpoint is first made available, because its log reports connection refusal rather than recursion. OCI cases should also be handled separately because they fail during authentication/configuration setup.
Expected behavior
For a valid model endpoint and valid credentials, a basic request such as:
calculate 3x6 ?
should execute once, reach a terminal assistant response, and return a valid CTS execution status containing either:
- Non-empty
agent_messages, or - Non-empty
outputs.
The graph should not require increasing the recursion limit to hide the failure.
Relevant code
agent-spec/conformance_test_suite/runtimes/langgraphruntime/src/langgraphruntime/runtime.py:101-126agent-spec/conformance_test_suite/runtimes/langgraphruntime/src/langgraphruntime/runtime.py:127-162agent-spec/pyagentspec/src/pyagentspec/adapters/langgraph/_langgraphconverter.py:1143-1193agent-spec/pyagentspec/src/pyagentspec/adapters/langgraph/_node_execution.py:549-568agent-spec/pyagentspec/src/pyagentspec/adapters/langgraph/_node_execution.py:922-942agent-spec/conformance_test_suite/tests/llms/execution/test_execution_llmconfig_with_agent.py
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Run the representative agent tests in tests/agent/validation/test_valid_configs_agent.py and tests/llms/execution/test_execution_llmconfig_with_agent.py, then trace runtime.py:101-162 and _langgraphconverter.py:1143-1193. Compare node execution in _node_execution.py:549-568 and :922-942 with the configured response and routing behavior. Done means valid endpoints reach a terminal response and return non-empty agent_messages or outputs without raising GraphRecursionError.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- ai, backend-api-design, testing
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100