Skip to content

Commit b2a8c30

Browse files
committed
change chunk types to use underscores
1 parent f26fbe7 commit b2a8c30

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

cli/src/hooks/use-send-message.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -546,7 +546,7 @@ export const useSendMessage = ({
546546
`SDK ${JSON.stringify(event.type)} Event received (raw)`,
547547
)
548548

549-
if (event.type === 'subagent-chunk') {
549+
if (event.type === 'subagent_chunk') {
550550
const { agentId, chunk } = event
551551

552552
const previous =

sdk/src/run.ts

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)