fix(agentspan): map handoff toolType to INLINE instead of silent SIMPLE default - #1435
Open
kowser-orkes wants to merge 1 commit into
Open
fix(agentspan): map handoff toolType to INLINE instead of silent SIMPLE default#1435kowser-orkes wants to merge 1 commit into
kowser-orkes wants to merge 1 commit into
Conversation
ToolCompiler.TYPE_MAP had no entry for toolType="handoff", so compileToolSpecs fell through to the SIMPLE default -- contradicting the "deliberately not a worker" comment on the same tool definition and misleading every client SDK that reads the compiled tool spec to decide whether a name needs a worker.
kowser-orkes
force-pushed
the
fix/swarm-transfer-tooltype-inline
branch
from
July 30, 2026 16:36
5c2a06f to
5c9221b
Compare
NicholasDCole
previously approved these changes
Jul 30, 2026
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.
Pull Request type
NOTE: Please remember to run
./gradlew spotlessApplyto fix any format violations.Changes in this PR
Bug:
ToolCompiler.TYPE_MAPhas no entry fortoolType="handoff"(the SWARM/hybrid transfertool's type since PR #1356).
compileToolSpecssilently falls through to its"SIMPLE"default,so every
{source}_transfer_to_{peer}tool's LLM-facing spec says"type": "SIMPLE"— directlycontradicting the "deliberately not a worker" comment on the same
.toolType("handoff")call.Impact: cosmetic to the server's own dispatch (transfer calls are intercepted by the INLINE
checkTransferTask/toolRouterbefore dynamic-fork dispatch ever runs), but it's the fieldclient SDKs read to decide "does this tool need a local worker" — and it's wrong. One half of the
fix for #1363 (stateful SWARM handoffs hanging forever); paired python-sdk PR fixes the client
side that this bug misleads.
Fix:
TYPE_MAP: add"handoff" → "INLINE", matching howhandoff_check/check_transferarealready typed.
compileToolSpecs: WARN-log unrecognizedtoolTypes instead of silently defaulting to"SIMPLE"— a silent default to the one type that implies "needs a worker" is exactly what letthis regress unnoticed for 9+ days.
testCompileToolSpecs_Handoff(direct coverage) andtestCompileToolSpecs_compilerOwnedToolTypesHaveExplicitMappings(pins all 3 compiler-ownedtoolTypes so a future unmapped one is caught here). Fixed one pre-existing
SwarmHandoffCompilerContractTestassertion that had hardcoded this bug ("SIMPLE") as expectedbehavior.
Not fixed by this PR alone:
requiredWorkers(computed fromWorkflowDef#collectSimpleTaskNames(), which reads the compiled graph task's type, not the LLMtool spec) already excluded these names, confirmed live both before and after this change. This PR
only fixes the LLM-facing spec field.
Issue #1363
Alternatives considered
TaskDefregistration for the transfer tool — rejected: the transfer taskis never dynamically forked/scheduled in the first place (
checkTransferTask/toolRouterinterception), so a registered
TaskDefwould just be dead clutter."INLINE"— rejected:INLINEis alreadywhat
handoff_check/check_transferuse for "resolved server-side, no worker."