diff --git a/src/orchestrator/agents/base.py b/src/orchestrator/agents/base.py index b8dd7f9..af7b08a 100644 --- a/src/orchestrator/agents/base.py +++ b/src/orchestrator/agents/base.py @@ -96,15 +96,18 @@ class BaseAgent: ): if chunk.delta: full_text += chunk.delta - await self.sse.emit( - EventType.AGENT_DELTA, - { - "agent": self.profile.role, - "delta": chunk.delta, - "step": step, - }, - session_id=session.session_id, - ) + # Only emit deltas for user-facing agents (coder, collector) + # Planner/reviewer output is internal + if self.profile.role not in ("planner", "reviewer"): + await self.sse.emit( + EventType.AGENT_DELTA, + { + "agent": self.profile.role, + "delta": chunk.delta, + "step": step, + }, + session_id=session.session_id, + ) if chunk.tool_name and chunk.tool_call_id: if chunk.tool_call_id not in active_tools: diff --git a/src/orchestrator/engine.py b/src/orchestrator/engine.py index 78cbb0f..31f8ed8 100644 --- a/src/orchestrator/engine.py +++ b/src/orchestrator/engine.py @@ -129,7 +129,7 @@ class OrchestratorEngine: # Emit as text streaming for the frontend await self.sse.emit( EventType.AGENT_DELTA, - {"agent": "planner", "delta": plan_result, "step": 0}, + {"agent": "coder", "delta": plan_result, "step": 0}, session_id=session.session_id, )