Problem
Non-streaming sub-agent paths (like the spawn_agent tool) still emit only start/complete logs with no progress events. PR #1428 made the activity sink mandatory by creating a discard channel, but nobody actually reads from it — events go into the void.
Current Behavior
Sub-agents spawned via spawn_agent (non-streaming) emit:
- 1 log at start
- 1 log per LLM turn
- 1 log at completion
Missing: tool execution progress, streaming delta events, any intermediate activity.
Root Cause
SubAgentSpawner.SpawnAsync creates a discard channel when activitySink is null:
var discardChannel = Channel.CreateUnbounded<ToolActivityUpdate>();
var activitySinkToUse = activitySink ?? discardChannel.Writer;
This is passed to SubAgentActor.RunSubAgent.ActivitySink, which uses it for progress events. But the discard channel's reader is never consumed — events pile up silently.
Proposed Fix
Either:
- Consume the discard channel and log events — spawn a task that reads from the channel and logs each
ToolActivityUpdate via _logger
- Write progress events directly to the logger — skip the discard channel for non-streaming paths and emit
ILogger events directly in SubAgentActor
Option 2 is simpler and doesn't require managing a dead channel reader.
References
Problem
Non-streaming sub-agent paths (like the
spawn_agenttool) still emit only start/complete logs with no progress events. PR #1428 made the activity sink mandatory by creating a discard channel, but nobody actually reads from it — events go into the void.Current Behavior
Sub-agents spawned via
spawn_agent(non-streaming) emit:Missing: tool execution progress, streaming delta events, any intermediate activity.
Root Cause
SubAgentSpawner.SpawnAsynccreates a discard channel whenactivitySinkis null:This is passed to
SubAgentActor.RunSubAgent.ActivitySink, which uses it for progress events. But the discard channel's reader is never consumed — events pile up silently.Proposed Fix
Either:
ToolActivityUpdatevia_loggerILoggerevents directly inSubAgentActorOption 2 is simpler and doesn't require managing a dead channel reader.
References
SubAgentActor.cs—EmitActivity()method,SubAgentStreamPinghandlerSubAgentSpawner.cs—SpawnAsyncdiscard channel creation