fix(cli): correct SSE event format handling for real-time streaming

The SDK yields events directly as the payload without wrapping in { payload: ... }.
Changed processEvents to treat event as the payload directly instead of looking
for event.payload. This fixes the 'Waiting for completion...' hang in GitHub
Actions where all events were being silently skipped.

🤖 Generated with assistance of [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
This commit is contained in:
YeonGyu-Kim
2025-12-25 19:17:18 +09:00
parent 695f9e03fc
commit 419416deb8
2 changed files with 5 additions and 5 deletions

View File

@@ -39,7 +39,7 @@ describe("event handling", () => {
properties: { sessionID: "my-session" },
}
const events = toAsyncIterable([{ payload }])
const events = toAsyncIterable([payload])
const { processEvents } = await import("./events")
// #when
@@ -59,7 +59,7 @@ describe("event handling", () => {
properties: { sessionID: "other-session" },
}
const events = toAsyncIterable([{ payload }])
const events = toAsyncIterable([payload])
const { processEvents } = await import("./events")
// #when
@@ -84,7 +84,7 @@ describe("event handling", () => {
properties: { sessionID: "my-session", status: { type: "busy" } },
}
const events = toAsyncIterable([{ payload }])
const events = toAsyncIterable([payload])
const { processEvents } = await import("./events")
// #when

View File

@@ -35,8 +35,8 @@ export async function processEvents(
if (ctx.abortController.signal.aborted) break
try {
const payload = (event as { payload?: EventPayload }).payload
if (!payload) continue
const payload = event as EventPayload
if (!payload?.type) continue
handleSessionIdle(ctx, payload, state)
handleSessionStatus(ctx, payload, state)