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