From 419416deb8eb8a149ca562838c14cb55198f6491 Mon Sep 17 00:00:00 2001 From: YeonGyu-Kim Date: Thu, 25 Dec 2025 19:17:18 +0900 Subject: [PATCH] fix(cli): correct SSE event format handling for real-time streaming MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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) --- src/cli/run/events.test.ts | 6 +++--- src/cli/run/events.ts | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/cli/run/events.test.ts b/src/cli/run/events.test.ts index f84d032..84b025c 100644 --- a/src/cli/run/events.test.ts +++ b/src/cli/run/events.test.ts @@ -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 diff --git a/src/cli/run/events.ts b/src/cli/run/events.ts index 9f2ed8f..fe0613d 100644 --- a/src/cli/run/events.ts +++ b/src/cli/run/events.ts @@ -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)