fix(agentspan): MCP/API agents lose every tool result — set _agent_tool_name in enrichToolsScriptDynamic - #1533
Closed
ling-senpeng13 wants to merge 2 commits into
Conversation
Join.compactAgentOutput identifies an agent tool call by reading _agent_tool_name from the forked task's input. enrichToolsScript sets it; enrichToolsScriptDynamic — selected whenever an agent has MCP or API tools — never did, so branch outputs were dropped from the JOIN, the state merge saw toolResults=[], and every LLM turn was dispatched with no record of the call. The model reissued the same call until the loop hit its iteration cap. The line goes after the type-specific branch chain because each branch replaces inputParameters wholesale, so it applies to MCP, HTTP, media, rag and plain worker tools alike. Fixes conductor-oss#1532
ling-senpeng13
force-pushed
the
fix/1532-mcp-tool-results-lost-in-join
branch
from
August 13, 2026 01:16
ffe3470 to
d0035e7
Compare
ling-senpeng13
marked this pull request as ready for review
August 13, 2026 16:19
ling-senpeng13
marked this pull request as draft
August 13, 2026 19:34
Contributor
Author
|
#1532 is not reproducible now |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1532.
Any agent whose toolset includes an MCP or API tool never receives its own tool results. Every LLM turn is dispatched with the identical bare
[system, user]message list, so the model reissues the same call until the ReAct loop hits its iteration cap.The fix
One line in
enrichToolsScriptDynamic, whichenrichToolsScriptalready had:Why it fixes it
Join.compactAgentOutputdecides whether a fork branch is an agent tool call by reading that marker from the branch's input:and the caller only records non-empty results:
Setting the marker makes
compactnon-empty and attaches_agent_tool_output, so the whole chain refills.Verification
Reproduced and fixed with the python-sdk examples
04_mcp_weather.pyand04_http_and_mcp_tools.py