Skip to content

Commit 057208e

Browse files
author
Ryan Vogel
committed
fix: prevent spurious session-complete notifications from APN relay
Remove message.updated -> complete classification in the mobile foreground SSE monitor. The processor cleanup stamps time.completed on every assistant message after each LLM step, not just at session end, causing premature complete events. The sole reliable signal is session.status with type idle. Remove the redundant status.set(idle) from the processor halt() path. The Runner onIdle callback already transitions to idle when the loop exits, so the explicit set in halt was firing a duplicate complete notification alongside the error notification.
1 parent 6db0f98 commit 057208e

2 files changed

Lines changed: 0 additions & 17 deletions

File tree

packages/mobile-voice/src/lib/opencode-events.ts

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -48,22 +48,6 @@ export function classifyMonitorEvent(event: OpenCodeEvent): MonitorEventType | n
4848
}
4949
}
5050

51-
if (type === "message.updated") {
52-
const info = event.properties?.info
53-
if (info && typeof info === "object") {
54-
const role = (info as Record<string, unknown>).role
55-
const time = (info as Record<string, unknown>).time
56-
if (
57-
role === "assistant" &&
58-
time &&
59-
typeof time === "object" &&
60-
"completed" in (time as Record<string, unknown>)
61-
) {
62-
return "complete"
63-
}
64-
}
65-
}
66-
6751
return null
6852
}
6953

packages/opencode/src/session/processor.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,6 @@ export namespace SessionProcessor {
426426
sessionID: ctx.assistantMessage.sessionID,
427427
error: ctx.assistantMessage.error,
428428
})
429-
yield* status.set(ctx.sessionID, { type: "idle" })
430429
})
431430

432431
const abort = Effect.fn("SessionProcessor.abort")(() =>

0 commit comments

Comments
 (0)