fix(task): corrected task progress display and async execution tracking

- Fixed task progress display to hide tool count and token metrics when zero, reducing visual clutter in status output.
- Refactored async task execution to use job progress reporting API instead of direct update callbacks, improving progress tracking accuracy.
- Implemented pre-allocation of unique IDs for batch tasks to prevent artifact collisions across concurrent executions.
- Extracted async details builder into reusable function to consolidate state construction logic.
This commit is contained in:
can1357
2026-02-22 13:06:28 +01:00
parent 4b7232c49c
commit 14634ab4e5
3 changed files with 73 additions and 22 deletions
+9 -3
View File
@@ -518,13 +518,19 @@ function renderAgentProgress(
const taskPreview = truncateToWidth(progress.task, 40);
statusLine += ` ${theme.fg("muted", taskPreview)}`;
}
statusLine += `${theme.sep.dot}${theme.fg("dim", `${progress.toolCount} tools`)}`;
if (progress.toolCount > 0) {
statusLine += `${theme.sep.dot}${theme.fg("dim", `${progress.toolCount} tools`)}`;
}
if (progress.tokens > 0) {
statusLine += `${theme.sep.dot}${theme.fg("dim", `${formatNumber(progress.tokens)} tokens`)}`;
}
} else if (progress.status === "completed") {
statusLine += `${theme.sep.dot}${theme.fg("dim", `${progress.toolCount} tools`)}`;
statusLine += `${theme.sep.dot}${theme.fg("dim", `${formatNumber(progress.tokens)} tokens`)}`;
if (progress.toolCount > 0) {
statusLine += `${theme.sep.dot}${theme.fg("dim", `${progress.toolCount} tools`)}`;
}
if (progress.tokens > 0) {
statusLine += `${theme.sep.dot}${theme.fg("dim", `${formatNumber(progress.tokens)} tokens`)}`;
}
}
lines.push(statusLine);