deepagents-planning-to…
Use the write_todos tool effectively for task planning and decomposition in Deep Agents. Use when users want to (1) implement…
Implement LangGraph error handling with current v1 patterns. Use when users need to classify failures, add RetryPolicy for transient issues, build LLM recovery loops with Command routing, add human-in-the-loop with interrupt()/resume, handle ToolNode errors, or choose a safe
Claude Code
$ npx -y skills add soba-labs/langchain-agent-skills --skill langgraph-error-handling --agent claude-code
Codex
$ npx skills add soba-labs/langchain-agent-skills --skill langgraph-error-handling -a codex -y
Cursor
$ npx skills add soba-labs/langchain-agent-skills --skill langgraph-error-handling -a cursor -y
Gemini CLI
$ npx skills add soba-labs/langchain-agent-skills --skill langgraph-error-handling -a gemini-cli -y
GitHub Copilot
$ npx skills add soba-labs/langchain-agent-skills --skill langgraph-error-handling -a github-copilot -y
OpenCode
$ npx skills add soba-labs/langchain-agent-skills --skill langgraph-error-handling -a opencode -y
Windsurf
$ npx skills add soba-labs/langchain-agent-skills --skill langgraph-error-handling -a windsurf -y
name: langgraph-error-handling description: Implement LangGraph error handling with current v1 patterns. Use when users need to classify failures, add RetryPolicy for transient issues, build LLM recovery loops with Command routing, add human-in-the-loop with interrupt()/resume, handle ToolNode errors, or choose a safe strategy between retry, recovery, and escalation.
Use this order:
1. Transient/infrastructure issue (`429`, timeout, `5xx`, temporary DB lock) -> `RetryPolicy` 2. Recoverable by model/tool args correction -> store error in state and route back with `Command` 3. Needs user approval or missing info -> `interrupt()` + resume 4. Unknown/programming bug -> let it bubble up and debug
| Error Type | Owner | Primary Mechanism | |---|---|---| | Transient | System | `RetryPolicy` | | LLM-recoverable | LLM | State update + `Command(goto=...)` | | User-fixable | Human | `interrupt()` + `Command(resume=...)` | | Unexpected | Developer | Raise/log/debug |
For full taxonomy, load [references/error-types.md](references/error-types.md).
from langgraph.types import RetryPolicy
builder.add_node(
"call_api",
call_api,
retry_policy=RetryPolicy(max_attempts=3, initial_interval=1.0),
)builder.addNode("callApi", callApi, {
retryPolicy: { maxAttempts: 3, initialInterval: 1.0 },
});Notes:
Use `MessagesState` in Python for message state.
from typing import Literal
from typing_extensions import NotRequired
from langgraph.graph import MessagesState
from langgraph.types import Command
class State(MessagesState):
error: NotRequired[str]
retry_count: NotRequired[int]
def agent(state: State) -> Command[Literal["tool", "__end__"]]:
if state.get("retry_count", 0) >= 3:
return Command(goto="__end__")
if state.get("error"):
return Command(goto="tool")
return Command(goto="tool")import { StateGraph, Command, END } from "@langchain/langgraph";
// If a node returns Command in JS, add `ends` on addNode.
builder.addNode("agent", agentNode, { ends: ["tool", END] });from langgraph.types import interrupt, Command
def human_review(state):
approved = interrupt({
"question": "Proceed?",
"payload": state["pending_action"],
})
return Command(goto="execute" if approved else "cancel")
# resume
graph.invoke(Command(resume=True), config={"configurable": {"thread_id": "t-1"}})import { Command, interrupt } from "@langchain/langgraph";
const approved = interrupt({ question: "Proceed?" });
// later
await graph.invoke(new Command({ resume: true }), {
configurable: { thread_id: "t-1" },
});Requirements:
For deep HITL patterns, load [references/human-escalation.md](references/human-escalation.md).
from langgraph.prebuilt import ToolNode tool_node = ToolNode(tools, handle_tool_errors=True) tool_node = ToolNode(tools, handle_tool_errors="Please try again.") tool_node = ToolNode(tools, handle_tool_errors=(ValueError, TypeError))
Use custom handlers when you need deterministic error shaping for model recovery. For broader tool-recovery design, load [references/llm-recovery.md](references/llm-recovery.md).
1. **Supersteps are transactional**: one failing parallel branch fails the whole superstep state update. 2. **RetryPolicy retries failing branches**, not successful siblings. 3. **`interrupt()` re-runs the node on resume**: side effects before interrupt must be idempotent, or moved after interrupt / separate node. 4. **JS `Command` routing requires `ends` metadata** on `addNode(...)`. 5. **Use explicit retry limits** (`max_attempts`, plus state counters for recovery loops).
Run from repo root:
uv run skills/langgraph-error-handling/scripts/classify_error.py TimeoutError --verbose uv run skills/langgraph-error-handling/scripts/wrap_with_retry.py call_llm --with-llm-recovery
| Symptom | Root Cause | Fix | |---|---|---| | `interrupt()` fails at runtime | no checkpointer | compile with checkpointer | | Resume starts new run | different `thread_id` | reuse same `thread_id` | | JS Command route not taken | missing `ends` | add `ends` to `addNode` | | Infinite loop | no termination counter/condition | add retry counter + terminal branch | | Retry never triggers | exception excluded by retry filter | set explicit `retry_on`/`retryOn` |
A comprehensive collection of agent-optimized skills for AI coding assistants working in the LangChain ecosystem.
Use the write_todos tool effectively for task planning and decomposition in Deep Agents. Use when users want to (1) implement…
Initialize, validate, and troubleshoot Deep Agents projects in Python or JavaScript using the `deepagents` package. Use when…
Implement multi-agent coordination patterns (supervisor-subagent, router, orchestrator-worker, handoffs) for LangGraph…
Initialize and configure LangGraph projects with proper structure, langgraph.json configuration, environment variables, and…
Design state schemas, implement reducers, configure persistence, and debug state issues for LangGraph applications. Use when…
Use this skill when you need to test or evaluate LangGraph/LangChain agents: writing unit or integration tests, generating test…
Use your assigned AgentMail inbox to read email tasks, explicitly send or reply, and check delivery. Provided automatically by…
Create a new Architecture Decision Record with sequential numbering and AgentDB registration