Skip to content

langgraph

etrack.providers.adapters.source.langgraph

providers/adapters/source/langgraph: LanggraphSourceAdapter — a LangGraph run's callbacks reported as span edges.

LangChain reports every runnable it starts with its run id and its parent's; this source reads them inline, on the caller's thread, and tells a fold what each one is: the root (RUN), a graph node (a chain named after its own langgraph_node), a model call (LLM), a retriever, a tool — SUBAGENT when it is the tool a deep agent delegates through (task), MCP when its name is one the host declares — and folds everything else (sequences, middleware plumbing) away. Streamed pieces are read from LangChain's v1 content blocks, so text, reasoning and tool-call chunks arrive typed whatever the provider. An interrupt bubbles up as GraphInterrupt: the span it crosses ends cleanly and one INTERRUPT frame carries what is asked, once, under the span that raised it. bind pins the run's id as the root run id, so LangChain, LangSmith and the frames name the run alike.

LanggraphHandler

LanggraphHandler(
    fold: FoldPort,
    mcp: frozenset[str],
    subagents: frozenset[str],
)

Bases: BaseCallbackHandler

One run's callbacks, inline: each runnable classified and reported to the fold the moment LangChain announces it.

on_custom_event

on_custom_event(
    name: str, data: Any, *, run_id: UUID, **kwargs: Any
) -> None

dispatch_custom_event from a node or a tool: one CUSTOM frame under the span that dispatched it.

LanggraphSourceAdapter

LanggraphSourceAdapter(
    mcp: frozenset[str] = frozenset(),
    subagents: frozenset[str] = SUBAGENTS,
)

The LangGraph source: bind a fold into a RunnableConfig; MCP tool names are the host's to declare.

bind

bind(
    fold: FoldPort, scope: RunScope, config: RunnableConfig
) -> RunnableConfig

The host's config with the run's handler appended (inherited ones kept) and the run's id as the root's.

health async

health() -> bool

Always ready: the source holds no resource.

locate

locate() -> str

The runnable running where the caller stands — the node, the tool — read from LangChain's own context.