Skip to content

feat(core): add LoopbackChannel for headless agent communication #582

@bug-ops

Description

@bug-ops

Parent

Part of #581

Summary

Add LoopbackChannel implementing Channel trait for headless (non-interactive) agent communication. This channel bridges the A2A TaskProcessor with the agent loop via tokio mpsc channels.

Scope

Files: crates/zeph-core/src/channel.rs, crates/zeph-core/src/lib.rs

  • LoopbackEvent enum: Chunk(String), Flush, FullMessage(String), Status(String), ToolOutput{...}
  • LoopbackHandle (caller side): input_tx: Sender<ChannelMessage>, output_rx: Receiver<LoopbackEvent>
  • LoopbackChannel (agent side): input_rx: Receiver<ChannelMessage>, output_tx: Sender<LoopbackEvent>
  • Constructor: LoopbackChannel::pair(buffer: usize) -> (LoopbackChannel, LoopbackHandle)
  • impl Channel for LoopbackChannel:
    • recv() → blocks on input_rx
    • send(text)LoopbackEvent::FullMessage
    • send_chunk(chunk)LoopbackEvent::Chunk
    • flush_chunks()LoopbackEvent::Flush
    • send_status(text)LoopbackEvent::Status
    • confirm() → auto-approve (headless, no interactive prompts)

Acceptance Criteria

  • LoopbackChannel::pair() returns working channel + handle pair
  • All Channel trait methods implemented
  • Unit tests for send/recv round-trip and confirm auto-approve

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions