fix(subagents): route spawn_agent through its streaming override#1080
Merged
Aaronontheweb merged 2 commits intoMay 19, 2026
Merged
Conversation
…ool dispatch spawn_agent's ExecuteStreamAsync was an orphan public method. INetclawTool.ExecuteStreamAsync is a default interface method, bound to the DIM default at the NetclawTool<T> base class — a derived tool adding a matching public method does not re-implement it, so the override was unreachable through INetclawTool-typed dispatch. spawn_agent fell through to the non-streaming path, emitted zero activity items, and the parent's per-call StreamingToolWatchdog killed healthy sub-agents at the flat tool-execution timeout. Add a virtual ExecuteStreamAsync hook on NetclawTool<T> so the override is the interface implementation for the whole tool hierarchy, and mark SpawnAgentTool's override as `override` so the wiring is compiler-enforced. Add a full-chain integration test that crosses the executor -> INetclawTool dispatch -> SpawnAgentTool -> SubAgentActor -> watchdog seam.
Reuse the production SingleClientProvider instead of a private duplicate, decouple the integration test's result assertion from FakeChatClient's exact output text, and condense the doc comments on the streaming test and the NetclawTool<T>.ExecuteStreamAsync hook. No behavior change.
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.
Summary
A sub-agent spawned via
spawn_agentwas killed at exactly the 90s tool-execution timeout despite actively streaming — the streaming-tool-call work (#1045) meant to prevent mid-run sub-agent timeouts never actually ran forspawn_agent.SpawnAgentTool.ExecuteStreamAsyncwas an orphan method.INetclawTool.ExecuteStreamAsyncis a C# default interface method, bound to the DIM default at theNetclawTool<T>base class — a derived tool adding a matchingpublicmethod does not re-implement it, so the override was unreachable throughINetclawTool-typed dispatch.DispatchingToolExecutoralways hit the DIM default, collapsingspawn_agentto the non-streaming path with no activity sink. ZeroToolActivityUpdateitems reached the parent's per-callStreamingToolWatchdog, which then fired at its flat budget and cancelled a healthy, progressing sub-agent.virtual ExecuteStreamAsynchook onNetclawTool<T>so the override is the interface implementation for the whole tool hierarchy.SpawnAgentTool.ExecuteStreamAsyncasoverride— the wiring is now compiler-enforced, so this class of bug can't recur silently.DispatchingToolExecutor→INetclawTooldispatch →SpawnAgentTool→SubAgentActor→StreamingToolWatchdog.Test plan
SpawnAgentStreamingTestsfails without the fix (verified by reverting the two source changes), passes with itStreamingToolCallTests,SubAgentSpawnIntegrationTests,SubAgentActorTests,SpawnAgentToolTestsstill pass (77 tests green)slopwatchreports 0 issues; copyright headers verified