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.
This commit is contained in:
Ryan Vogel
2026-04-04 19:43:50 +00:00
parent 6db0f9855c
commit 057208e022
2 changed files with 0 additions and 17 deletions

View File

@@ -48,22 +48,6 @@ export function classifyMonitorEvent(event: OpenCodeEvent): MonitorEventType | n
}
}
if (type === "message.updated") {
const info = event.properties?.info
if (info && typeof info === "object") {
const role = (info as Record<string, unknown>).role
const time = (info as Record<string, unknown>).time
if (
role === "assistant" &&
time &&
typeof time === "object" &&
"completed" in (time as Record<string, unknown>)
) {
return "complete"
}
}
}
return null
}