Install any skill in seconds. Free to start, no credit card required.
Get Started Free →jeremylongshore/langchain-langgraph-subgraphs
Compose LangGraph 1.0 subgraphs correctly — shared state key propagation, Send / Command(graph=...) dispatch, callback scoping, per-subgraph recursion budgets, and testing each subgraph in isolation.
Passed 22 of 24 test cases with the skill, and 13 of 24 without it.
and 11 more in the full report
9 fixed13 passed either way2 still failing0 broke
Tokens, turns and time describe resource use, not a dollar price.
One of 9 test cases the skill fixed. Same model, same prompt, with and without the skill.
I am building a multi-agent system in Python using LangGraph where a supervisor graph delegates work to a child executor graph. Currently, when the child graph finishes, custom fields written inside the child disappear and return as None in the parent graph, and my LangChain tracing callbacks attached to the supervisor aren't recording tool calls made inside the executor. Can you help fix this architecture? Please provide Python code that defines both parent and child state definitions, builds both graphs using compiled subgraphs, demonstrates proper invocation with full tracing across all levels, and includes a standalone pytest function using a mock LLM to verify the executor graph in isolation.
| Checked | Without skill | With skill |
|---|---|---|
| The compiled child graph is added directly to parent_graph using parent_graph.add_node without wrapping child invocation inside a custom adapter function. | Missed | Passed |
| The standalone unit test function uses FakeListChatModel from langchain_core to mock model responses. | Missed | Passed |
| Tracing callbacks are provided inside the config dictionary argument passed to invoke instead of attaching them with with_config. | Missed | Passed |
The instructions your model reads when the skill loads.
A parent StateGraph invokes a compiled child subgraph as a node. The child
node writes state["answer"] = "42" and returns. The parent's next node reads
state["answer"] and gets None. No error, no warning, no deprecation notice —
just a silent None that surfaces as a wrong answer three nodes later when the
router picks the "couldn't find it" branch.
The cause is pain-catalog entry P21: LangGraph subgraphs run on an
independent state schema. Only keys declared in both the parent's
TypedDict and the child's TypedDict propagate across the subgraph boundary.
answer existed in the child schema but not the parent schema, so it was
discarded on return. The fix is to declare answer in both schemas (with
matching reducers, if the field is a list) or to use explicit
Command(graph=ParentGraph, update={"answer": "42"}) to bubble it up.
The second silent failure waits one step further. Attach a tracing callback to
the parent runnable via parent.with_config(callbacks=[tracer]) and invoke.
The tracer fires on parent nodes and never on child tool calls. This is
pain-catalog entry P28: LangGraph creates a fresh runtime per subgraph, so
callbacks bound at definition time do not inherit. The fix is to pass
callbacks at invocation time via config["callbacks"], which does propagate.
This skill walks through the shared-state contract, three dispatch patterns
(compiled subgraph as a node, Send fan-out, Command(graph=Parent) bubble-up),
callback scoping, per-subgraph recursion_limit budgets, and a testing pattern
that exercises every subgraph in isolation before composition. Pin:
langgraph 1.0.x, langchain-core 1.0.x. Pain-catalog anchors: P21, P28,
with supporting references to P18 (reducers), P19 (stream modes on nested
graphs), and P55 (recursion budget).
A planner-executor is typically 1 parent + 2-4 subgraphs; a hierarchical
agent team with a supervisor and N specialists is 1 parent + N subgraphs.
Each subgraph has its own independent recursion_limit (default 25) — a parent
at step 20 can still invoke a child that runs 25 of its own steps.
test cases passed, vs 13 / 24 without
More skills from the same source and nearby in the registry, with their headline benchmark lift.