Skip to content

bug: filter subagent messages out of parent session output #33

Description

@tuchg

This was generated by AI during triage.

Problem

Subagent-generated messages can interfere with the parent session view or notifications. The parent conversation should not be polluted by delegated child-session chatter; subagents should be surfaced only through the intended subagent affordance/link/status path.

Assumptions

  • “subagents” refers to delegated child agent sessions/messages already represented in the codebase by subagent roles, actors, operation kinds, or provider-specific subagent discovery.
  • The bug is not that subagents exist, but that their raw messages can leak into the primary session timeline, watch updates, Telegram live output, or notification flow.

Expected behavior

  • Primary session history and live notifications show the parent agent turn without raw child-session message noise.
  • Subagent status/open actions remain available through the existing subagent link/status UI.
  • Provider-specific subagent detection stays at the provider boundary; common/history layers consume typed provider contracts instead of hard-coding provider names or path formats.

Suggested investigation

  • Check whether subagent messages are entering through transcript parsing, watch updates, runtime event projection, or Telegram turn rendering.
  • Existing coverage already includes ignoring some Claude/Pi subagent watch paths; verify whether message-level events with Actor::Subagent, OperationKind::Subagent, or task tool results still leak into parent output.
  • Add a regression test that reproduces the leak before fixing it.

Acceptance criteria

  • A reproduced subagent-message leak no longer appears in the parent session timeline/notification output.
  • Intended subagent link/status rendering still works.
  • Fix is root-cause based, not a presentation-only fallback.
  • Any implementation decision that changes filtering boundaries is recorded under docs/decisions/.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions