Skip to content

Commit f639a8e

Browse files
committed
Fix bug with duplicate subagent output
1 parent b64fe3c commit f639a8e

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

cli/src/utils/sdk-event-handlers.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -501,7 +501,6 @@ export const createStreamChunkHandler =
501501
export const createEventHandler =
502502
(state: EventHandlerState) => (event: SDKEvent) => {
503503
return match(event)
504-
.with({ type: 'text' }, (e) => handleTextEvent(state, e))
505504
.with({ type: 'subagent_start' }, (e) => handleSubagentStart(state, e))
506505
.with({ type: 'subagent_finish' }, (e) => handleSubagentFinish(state, e))
507506
.with({ type: 'tool_call' }, (e) => handleToolCall(state, e))

packages/agent-runtime/src/tools/handlers/tool/spawn-agents.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -139,12 +139,10 @@ export const handleSpawnAgents = (async (
139139

140140
if (chunk.type === 'text') {
141141
if (chunk.text) {
142-
sendSubagentChunk({
143-
userInputId,
142+
writeToClient({
143+
type: 'text' as const,
144144
agentId: subAgentState.agentId,
145-
agentType,
146-
chunk: chunk.text,
147-
prompt,
145+
text: chunk.text,
148146
})
149147
}
150148
return

0 commit comments

Comments
 (0)