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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user