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:
@@ -69,13 +69,14 @@ export function handleBackgroundEvent(args: {
|
||||
const type = getString(props, "type")
|
||||
const tool = getString(props, "tool")
|
||||
|
||||
if (!task.progress) {
|
||||
task.progress = { toolCalls: 0, lastUpdate: new Date() }
|
||||
}
|
||||
task.progress.lastUpdate = new Date()
|
||||
|
||||
if (type === "tool" || tool) {
|
||||
if (!task.progress) {
|
||||
task.progress = { toolCalls: 0, lastUpdate: new Date() }
|
||||
}
|
||||
task.progress.toolCalls += 1
|
||||
task.progress.lastTool = tool
|
||||
task.progress.lastUpdate = new Date()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user