fix: refresh lastUpdate on all message.part.updated events, not just tool events

Reasoning/thinking models (Oracle, Claude Opus) were being killed by the
stale timeout because lastUpdate was only refreshed on tool-type events.
During extended thinking, no tool events fire, so after 3 minutes the
task was incorrectly marked as stale and aborted.

Move progress initialization and lastUpdate refresh before the tool-type
conditional so any message.part.updated event (text, thinking, tool)
keeps the task alive.
This commit is contained in:
YeonGyu-Kim
2026-02-14 13:32:17 +09:00
parent 8e60e7e1bb
commit cf4ebce385
3 changed files with 171 additions and 11 deletions
+8 -7
View File
@@ -662,16 +662,17 @@ export class BackgroundManager {
this.idleDeferralTimers.delete(task.id)
}
if (partInfo?.type === "tool" || partInfo?.tool) {
if (!task.progress) {
task.progress = {
toolCalls: 0,
lastUpdate: new Date(),
}
if (!task.progress) {
task.progress = {
toolCalls: 0,
lastUpdate: new Date(),
}
}
task.progress.lastUpdate = new Date()
if (partInfo?.type === "tool" || partInfo?.tool) {
task.progress.toolCalls += 1
task.progress.lastTool = partInfo.tool
task.progress.lastUpdate = new Date()
}
}