@@ -328,7 +328,7 @@ export async function run({
328328 const trimmed = pendingText . trim ( )
329329 if ( trimmed ) {
330330 await handleEvent ?.( {
331- type : 'subagent-chunk ' ,
331+ type : 'subagent_chunk ' ,
332332 agentId,
333333 agentType,
334334 chunk : pendingText ,
@@ -354,12 +354,11 @@ export async function run({
354354 await emitStreamDelta ( ROOT_AGENT_KEY , nextFullText )
355355 }
356356 } else {
357- const chunkType = chunk . type as string
357+ const chunkType = chunk . type
358358
359359 if (
360360 chunkType !== 'finish' &&
361- chunkType !== 'subagent_finish' &&
362- chunkType !== 'subagent-finish'
361+ chunkType !== 'subagent_finish'
363362 ) {
364363 await emitPendingSection ( ROOT_AGENT_KEY )
365364 const pendingAgentId = 'agentId' in chunk ? chunk . agentId : undefined
@@ -401,8 +400,7 @@ export async function run({
401400 )
402401 }
403402 } else if (
404- chunkType === 'subagent_finish' ||
405- chunkType === 'subagent-finish'
403+ chunkType === 'subagent_finish'
406404 ) {
407405 const subagentId = 'agentId' in chunk ? chunk . agentId : undefined
408406 if ( subagentId ) {
@@ -432,7 +430,7 @@ export async function run({
432430
433431 if ( sanitized && handleEvent ) {
434432 await handleEvent ( {
435- type : 'subagent-chunk ' ,
433+ type : 'subagent_chunk ' ,
436434 agentId,
437435 agentType,
438436 chunk : sanitized ,
0 commit comments