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
@@ -52,7 +52,7 @@ export function handleBackgroundEvent(args: {
const props = event.properties
if (event.type === "message.part.updated") {
if (event.type === "message.part.updated" || event.type === "message.part.delta") {
if (!props || !isRecord(props)) return
const sessionID = getString(props, "sessionID")
if (!sessionID) return