[PR #4289] [MERGED] docs: document sub-agent identity (lc_agent_name) in event streaming #4273

Closed
opened 2026-06-05 19:13:20 -04:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/langchain-ai/docs/pull/4289
Author: @nick-hollon-lc
Created: 6/3/2026
Status: Merged
Merged: 6/4/2026
Merged by: @nick-hollon-lc

Base: mainHead: nh/docs-subagent-streaming-name


📝 Commits (7)

  • acaa657 docs(langchain): stream sub-agents via the dedicated stream.subagents projection
  • 7b1cd8a docs(deepagents): explain sub-agent name provenance in event streaming
  • c3c4a3c docs(langgraph): clarify graph_name provenance and subagent cause in subgraph streaming
  • 6e6423d docs(langgraph): apply review suggestion on subgraph cause cross-link
  • 2747698 Merge remote-tracking branch 'origin/main' into nh/docs-subagent-streaming-name
  • 67cd4e4 fix(docs.json): correct dangling assistant-observability nav entry to chat-observability
  • fb50349 Merge remote-tracking branch 'origin/main' into nh/docs-subagent-streaming-name

📊 Changes

3 files changed (+21 additions, -9 deletions)

View changed files

📝 src/oss/deepagents/event-streaming.mdx (+3 -1)
📝 src/oss/langchain/event-streaming.mdx (+16 -8)
📝 src/oss/langgraph/event-streaming.mdx (+2 -0)

📄 Description

Why

Recent work landed first-class sub-agent identity in the event-streaming stack: a sub-agent's configured name is bound as lc_agent_name and surfaces in streamed events. This is shipped across LangGraph (Python), LangChain (Python), and Deep Agents — but the three event-streaming pages either didn't explain where the name comes from, or (LangChain Python) still used the older stream.subgraphs + manual filter workaround. This PR brings the docs in line with what ships.

Changes

  • LangChain (oss/langchain/event-streaming.mdx): switch the Python sub-agent example to the now-shipped dedicated stream.subagents projection (SubagentTransformer, wired into create_agent), instead of iterating stream.subgraphs and filtering on graph_name. The handle exposes .name and .cause. Corrected the stale "there's no separate sub-agent-only projection" line.
  • Deep Agents (oss/deepagents/event-streaming.mdx): explain that a handle's name is the sub-agent's configured name, selected via the task tool's subagent_type and bound to the delegated run.
  • LangGraph (oss/langgraph/event-streaming.mdx): clarify that subgraph.graph_name is the compiled graph/agent name, that tool-dispatched named agents surface on stream.subgraphs, and that the opening lifecycle event carries a cause linking back to the dispatching tool call.

Language parity (please review)

Verified against shipped source on local branches:

  • Python create_agent surfaces stream.subagents natively (langchain/agents/_subagent_transformer.py, registered in factory.py).
  • In-process TypeScript does not yet expose stream.subagents (only the deployment SDK has subagent discovery). So the JS example intentionally stays on stream.subgraphs, with a parity note. If the JS in-process projection has landed since, the JS example should be updated to match the Python one.

Verification

  • make lint_prose on the three files: 0 errors.
  • make broken-links: No broken links.
  • API surface (method names, version="v3", projection accessors, .name/.cause) checked against shipped SDK source and tests. Snippets were not executed against a live model (needs API keys), so they are not runtime-tested end to end.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/langchain-ai/docs/pull/4289 **Author:** [@nick-hollon-lc](https://github.com/nick-hollon-lc) **Created:** 6/3/2026 **Status:** ✅ Merged **Merged:** 6/4/2026 **Merged by:** [@nick-hollon-lc](https://github.com/nick-hollon-lc) **Base:** `main` ← **Head:** `nh/docs-subagent-streaming-name` --- ### 📝 Commits (7) - [`acaa657`](https://github.com/langchain-ai/docs/commit/acaa6575646619de6f20e64b97058f06fd1aed81) docs(langchain): stream sub-agents via the dedicated stream.subagents projection - [`7b1cd8a`](https://github.com/langchain-ai/docs/commit/7b1cd8af1906c29c05b73133e4402b345a0bd77c) docs(deepagents): explain sub-agent name provenance in event streaming - [`c3c4a3c`](https://github.com/langchain-ai/docs/commit/c3c4a3c0c29de523b9ea6c3fc9053facae8e8717) docs(langgraph): clarify graph_name provenance and subagent cause in subgraph streaming - [`6e6423d`](https://github.com/langchain-ai/docs/commit/6e6423d0518c8c628d10c04f9f619695d0e497ac) docs(langgraph): apply review suggestion on subgraph cause cross-link - [`2747698`](https://github.com/langchain-ai/docs/commit/274769864fdf283b3b91152efaf137a22e28aac5) Merge remote-tracking branch 'origin/main' into nh/docs-subagent-streaming-name - [`67cd4e4`](https://github.com/langchain-ai/docs/commit/67cd4e4cad6d1325597b14bcc8f462427573cbb0) fix(docs.json): correct dangling assistant-observability nav entry to chat-observability - [`fb50349`](https://github.com/langchain-ai/docs/commit/fb503498d21586738dfa7bdfb8e120f84e01356c) Merge remote-tracking branch 'origin/main' into nh/docs-subagent-streaming-name ### 📊 Changes **3 files changed** (+21 additions, -9 deletions) <details> <summary>View changed files</summary> 📝 `src/oss/deepagents/event-streaming.mdx` (+3 -1) 📝 `src/oss/langchain/event-streaming.mdx` (+16 -8) 📝 `src/oss/langgraph/event-streaming.mdx` (+2 -0) </details> ### 📄 Description ## Why Recent work landed first-class sub-agent identity in the event-streaming stack: a sub-agent's configured `name` is bound as `lc_agent_name` and surfaces in streamed events. This is shipped across LangGraph (Python), LangChain (Python), and Deep Agents — but the three event-streaming pages either didn't explain where the name comes from, or (LangChain Python) still used the older `stream.subgraphs` + manual filter workaround. This PR brings the docs in line with what ships. ## Changes - **LangChain** (`oss/langchain/event-streaming.mdx`): switch the Python sub-agent example to the now-shipped dedicated `stream.subagents` projection (`SubagentTransformer`, wired into `create_agent`), instead of iterating `stream.subgraphs` and filtering on `graph_name`. The handle exposes `.name` and `.cause`. Corrected the stale "there's no separate sub-agent-only projection" line. - **Deep Agents** (`oss/deepagents/event-streaming.mdx`): explain that a handle's `name` is the sub-agent's configured name, selected via the `task` tool's `subagent_type` and bound to the delegated run. - **LangGraph** (`oss/langgraph/event-streaming.mdx`): clarify that `subgraph.graph_name` is the compiled graph/agent name, that tool-dispatched named agents surface on `stream.subgraphs`, and that the opening `lifecycle` event carries a `cause` linking back to the dispatching tool call. ## Language parity (please review) Verified against shipped source on local branches: - Python `create_agent` surfaces `stream.subagents` natively (`langchain/agents/_subagent_transformer.py`, registered in `factory.py`). - **In-process TypeScript does not yet expose `stream.subagents`** (only the deployment SDK has subagent discovery). So the JS example intentionally stays on `stream.subgraphs`, with a parity note. If the JS in-process projection has landed since, the JS example should be updated to match the Python one. ## Verification - `make lint_prose` on the three files: 0 errors. - `make broken-links`: ✅ No broken links. - API surface (method names, `version="v3"`, projection accessors, `.name`/`.cause`) checked against shipped SDK source and tests. Snippets were **not** executed against a live model (needs API keys), so they are not runtime-tested end to end. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
yindo added the pull-request label 2026-06-05 19:13:20 -04:00
yindo closed this issue 2026-06-05 19:13:21 -04:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langchain-ai/docs#4273