[PR #1176] [MERGED] fix(supervisor): use withAgentName from core #1281

Closed
opened 2026-02-15 20:15:05 -05:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/langchain-ai/langgraphjs/pull/1176
Author: @benjamincburns
Created: 5/12/2025
Status: Merged
Merged: 5/12/2025
Merged by: @benjamincburns

Base: ben/cra-inline-nameHead: ben/fix-supervisor-inlining


📝 Commits (1)

  • 03ff772 fix(supervisor): use withAgentName from core

📊 Changes

5 files changed (+6 additions, -319 deletions)

View changed files

libs/langgraph-supervisor/src/agentName.ts (+0 -166)
📝 libs/langgraph-supervisor/src/index.ts (+0 -1)
📝 libs/langgraph-supervisor/src/supervisor.ts (+5 -1)
libs/langgraph-supervisor/src/tests/agentName.test.ts (+0 -150)
📝 libs/langgraph-supervisor/src/tests/supervisor.test.ts (+1 -1)

📄 Description

Fixes # 1051 specifically for @langchain/langgraph-supervisor by porting over the agent name inlining facility from Python. Requires work in #1174 to be merged (hence this PR being changed off of that branch).

Note that these fixes only address this issue for cases where the provider allows mutation of previous AIMessages in the conversation. This is not the case when e.g. using thinking support with Anthropic (unless it's acceptable to drop thinking blocks). There are likely other model providers where this poses an issue (e.g. OpenAI responses API). Further work will likely be necessary to handle those cases, likely by enforcing that the model output conform to a message format that includes the agent name (e.g. by using a system prompt w/ structured outputs).


🔄 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/langgraphjs/pull/1176 **Author:** [@benjamincburns](https://github.com/benjamincburns) **Created:** 5/12/2025 **Status:** ✅ Merged **Merged:** 5/12/2025 **Merged by:** [@benjamincburns](https://github.com/benjamincburns) **Base:** `ben/cra-inline-name` ← **Head:** `ben/fix-supervisor-inlining` --- ### 📝 Commits (1) - [`03ff772`](https://github.com/langchain-ai/langgraphjs/commit/03ff772e3dac63377209d1a05c9582893f9efbc5) fix(supervisor): use withAgentName from core ### 📊 Changes **5 files changed** (+6 additions, -319 deletions) <details> <summary>View changed files</summary> ➖ `libs/langgraph-supervisor/src/agentName.ts` (+0 -166) 📝 `libs/langgraph-supervisor/src/index.ts` (+0 -1) 📝 `libs/langgraph-supervisor/src/supervisor.ts` (+5 -1) ➖ `libs/langgraph-supervisor/src/tests/agentName.test.ts` (+0 -150) 📝 `libs/langgraph-supervisor/src/tests/supervisor.test.ts` (+1 -1) </details> ### 📄 Description Fixes # 1051 specifically for `@langchain/langgraph-supervisor` by porting over the agent name inlining facility from Python. Requires work in #1174 to be merged (hence this PR being changed off of that branch). Note that these fixes only address this issue for cases where the provider allows mutation of previous AIMessages in the conversation. This is not the case when e.g. using thinking support with Anthropic (unless it's acceptable to drop thinking blocks). There are likely other model providers where this poses an issue (e.g. OpenAI responses API). Further work will likely be necessary to handle those cases, likely by enforcing that the model output conform to a message format that includes the agent name (e.g. by using a system prompt w/ structured outputs). --- <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-02-15 20:15:05 -05:00
yindo closed this issue 2026-02-15 20:15:05 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langchain-ai/langgraphjs#1281