Skip to content

feat(langgraph): publish child graphs as core child agents - #1678

Merged
blove merged 29 commits into
mainfrom
blove/langgraph-core-subagents
Nov 20, 2026
Merged

blove merged 29 commits into
mainfrom
blove/langgraph-core-subagents

Conversation

@blove

@blove blove commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Summary

The LangGraph session now publishes its child graphs as the core contract's child agents in snapshot.subagents. A component written for core sessions sees child agents on LangGraph the same way it does on AG-UI.

#1677 has merged, so this PR now targets main directly and its diff is only its own change.

What changed

  • snapshot.subagents: one child agent for each entry in snapshot.subgraphs, in the same order.
    • id is the namespace path as JSON, so it stays unique whatever a segment contains. parentId is the enclosing child graph's id. namespace is kept alongside.
    • name is the node that started the child (the last segment before its :).
    • messages and toolCalls are the child graph's own, the same references as in subgraphs.
    • status is error for a failed child and running while the root run is going. After the run, a child whose last message succeeded is complete, one a pause stopped is still running, and any other is unknown.
  • subgraphs[].toolCalls: each child graph now lists its own tool calls. They were already reduced internally but not published, so a child's Message.toolCallIds pointed at nothing.
  • The children are derived when the snapshot is owned, so they always agree with the published child graphs, and each keeps its reference while its child graph and status are unchanged.

Not included

  • toolCallId and description are never set: LangGraph does not relate a child graph to a tool call.
  • React Chat does not read snapshot.subagents yet.

Verification

  • nx run-many -t runtime-quality,runtime-type-tests,test,type-tests,lint -p core,langgraph,react,angular passes.
  • All cockpit React apps type-check against source. inventory.mjs --check --drift warn passes.
  • Mutation check: reporting a succeeded child as unknown fails the new test.
  • Not run locally: the package verifiers and Playwright e2e.

🤖 Generated with Claude Code

blove and others added 24 commits November 17, 2026 20:12
AgentSession and AgentSnapshot take a second type parameter for application
state. The snapshot gains an optional, deeply readonly `state`, and `submit`
accepts `{ message, state }` with a partial state as well as plain text.

A session is told its state type by one declaration: `type<T>()` for the type
alone, or any Standard Schema value to also check each state as it arrives.
`readState` runs that check for session implementations. The fake session
holds, sets and validates state the same way.

No backend session supplies `state` yet; LangGraph and AG-UI follow.
createSession takes a stateType, either type<T>() or a Standard Schema.
createAgentSession publishes the state document as the typed state of the
core snapshot, checks it once per document when a schema is declared, and
reports a rejected document in stateIssues without failing the run. A
session created without a state reports none until one is supplied.
The session createSession returns now publishes the core snapshot itself:
messages, tool calls, error, usage and typed state beside the protocol
evidence. createAgentSession is removed. retry rejects when the failure
leaves the backend outcome open, as the core contract requires, and the
literal state document a request sends is no longer published.
…ntract

The snapshot gains optional interrupts and subagents, and the session an
optional resume(responses) that answers pending interrupts by id. The fake
session publishes both fields and records resume calls.
Every published interrupt has an id, and resume takes the core contract's
responses in place of a bare value. One pending interrupt receives its
response's value; several are answered as one map keyed by backend id.
Callers in the cockpit examples, the native conversation example and the
parity fixtures move to the new command.
…he client only

The raw session has loaded nothing at that point, so its resume rejects for
a missing pause, not for the unmatched id. The session's own specs cover
the rejection; the diagnostic keeps the provider routing evidence.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@blove
blove enabled auto-merge November 20, 2026 03:53
@blove
blove added this pull request to the merge queue Nov 20, 2026
Merged via the queue into main with commit eb51894 Nov 20, 2026
133 checks passed
@blove
blove deleted the blove/langgraph-core-subagents branch November 20, 2026 06:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant