fix(background-agent): handle message.part.delta for heartbeat (OpenCode >=1.2.0)

OpenCode 1.2.0+ changed reasoning-delta and text-delta to emit
'message.part.delta' instead of 'message.part.updated'. Without
handling this event, lastUpdate was only refreshed at reasoning-start
and reasoning-end, leaving a gap where extended thinking (>3min)
could trigger stale timeout.

Accept both event types as heartbeat sources for forward compatibility.
This commit is contained in:
YeonGyu-Kim
2026-02-15 14:26:25 +09:00
parent 3f557e593c
commit 8a5f61724d
3 changed files with 42 additions and 2 deletions
+1 -1
View File
@@ -660,7 +660,7 @@ export class BackgroundManager {
handleEvent(event: Event): void {
const props = event.properties
if (event.type === "message.part.updated") {
if (event.type === "message.part.updated" || event.type === "message.part.delta") {
if (!props || typeof props !== "object" || !("sessionID" in props)) return
const partInfo = props as unknown as MessagePartInfo
const sessionID = partInfo?.sessionID