Skip to content

Non-streaming sub-agents lack progress events in Seq #1429

Description

@petabridge-netclaw

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:

  1. Consume the discard channel and log events — spawn a task that reads from the channel and logs each ToolActivityUpdate via _logger
  2. 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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions