Skip to content

M28-B: SubAgentManager core with in-process A2A channels #711

@bug-ops

Description

@bug-ops

Parent: #709

Summary

Implement SubAgentManager in zeph-core that manages sub-agent lifecycle using in-process mpsc channels with A2A message semantics.

Scope

  • SubAgentManager struct with spawn/cancel/collect/statuses methods
  • SubAgentHandle with task state, JoinHandle, CancellationToken, status watch channel
  • SubAgentChannel using tokio::sync::mpsc for A2A message passing
  • A2aMessage enum wrapping zeph-a2a types (SendMessage, StatusUpdate, ArtifactUpdate, Cancel)
  • Sub-agent execution loop: receive task, run LLM turns, send progress, return result
  • Integration point in Agent (new subagent_manager field)
  • Foreground-only execution (blocking spawn)

Acceptance Criteria

  • SubAgentManager spawns a sub-agent that completes a simple task
  • Cancel terminates a running sub-agent
  • Status updates flow from sub-agent to manager via watch channel
  • max_turns limit enforced (sub-agent stops after N turns)
  • timeout_secs enforced via tokio::time::timeout
  • Completed sub-agent result collected via collect()
  • zeph-a2a types reused for all protocol messages

Metadata

Metadata

Assignees

No one assigned

    Labels

    a2aA2A protocol integrationcoreenhancementNew feature or requestsub-agentsSub-agent orchestration

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions