mirror of
https://github.com/anomalyco/opencode.git
synced 2026-04-30 09:46:35 +00:00
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:
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user