feat(engine): live progress status updates via event broadcast

Engine v2 now shows live progress in the CLI (and any channel):
- "Thinking..." when a step starts
- Tool name + success/error when actions execute
- "Processing results..." when a step completes

Implementation:
- ThreadManager holds a broadcast::Sender<ThreadEvent> (capacity 256)
- ExecutionLoop.emit_event() writes to thread.events AND broadcasts
- ThreadManager.subscribe_events() returns a receiver
- Router uses tokio::select! to listen for events while waiting for
  thread completion, forwarding them as StatusUpdate to the channel

This replaces the polling approach with zero-latency event streaming.
Agent.channels visibility widened to pub(crate) for bridge access.

102 tests passing, zero clippy warnings.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
This commit is contained in:
2026-03-22 18:18:20 -07:00
co-authored by Claude Opus 4.6
parent b621cd503d
commit 7087964c22
4 changed files with 156 additions and 23 deletions
+1 -1
View File
@@ -175,7 +175,7 @@ pub struct AgentDeps {
pub struct Agent {
pub(super) config: AgentConfig,
pub(super) deps: AgentDeps,
pub(super) channels: Arc<ChannelManager>,
pub(crate) channels: Arc<ChannelManager>,
pub(super) context_manager: Arc<ContextManager>,
pub(super) scheduler: Arc<Scheduler>,
pub(super) router: Router,