From d3d21e3b4a4b06acbe4aaa5448449c133f2d19ea Mon Sep 17 00:00:00 2001 From: roboomp Date: Wed, 15 Jul 2026 00:52:36 +0000 Subject: [PATCH] fix(task): kept async job status while forwarding subagent progress forwardSyncProgress copied the subagent's initial pending snapshot over the job-owned running status via a wholesale Object.assign, reverting mixed-split job rows to pending. Forward only the live metric fields (resolved model, reasoning, counters, recent activity) and leave status/identity to the job body. Fixes #5060 --- packages/coding-agent/src/task/index.ts | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/packages/coding-agent/src/task/index.ts b/packages/coding-agent/src/task/index.ts index f248c4a44..d5f9990e9 100644 --- a/packages/coding-agent/src/task/index.ts +++ b/packages/coding-agent/src/task/index.ts @@ -983,9 +983,24 @@ export class TaskTool implements AgentTool = async update => { const nextProgress = update.details?.progress?.[0]; if (nextProgress) { - Object.assign(progress, nextProgress); + // The job body owns status and identity (id/index/agent); + // copy only the live metrics the subagent streams so the + // polling row reflects the resolved model, reasoning level, + // and running counters without reverting the "running" + // status back to the subagent's initial "pending" snapshot. + progress.resolvedModel = nextProgress.resolvedModel; + progress.tokens = nextProgress.tokens; + progress.requests = nextProgress.requests; + progress.contextTokens = nextProgress.contextTokens; + progress.contextWindow = nextProgress.contextWindow; + progress.cost = nextProgress.cost; + progress.toolCount = nextProgress.toolCount; + progress.currentTool = nextProgress.currentTool; + progress.lastIntent = nextProgress.lastIntent; progress.recentTools = nextProgress.recentTools.slice(); progress.recentOutput = nextProgress.recentOutput.slice(); + progress.retryState = nextProgress.retryState; + progress.retryFailure = nextProgress.retryFailure; } const updateText = update.content.find(part => part.type === "text")?.text ?? `Running background task ${agentId}...`;