feat(background-task): improve status output UX
- Remove always-zero tool call count from status display - Show last tool only when available - Add status-specific notes: - running: remind no explicit wait needed (system notifies) - error: indicate task failed, check last message 🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
This commit is contained in:
@@ -72,8 +72,8 @@ function formatTaskStatus(task: BackgroundTask): string {
|
|||||||
const promptPreview = truncateText(task.prompt, 500)
|
const promptPreview = truncateText(task.prompt, 500)
|
||||||
|
|
||||||
let progressSection = ""
|
let progressSection = ""
|
||||||
if (task.progress) {
|
if (task.progress?.lastTool) {
|
||||||
progressSection = `\nTool calls: ${task.progress.toolCalls}\nLast tool: ${task.progress.lastTool ?? "N/A"}`
|
progressSection = `\n| Last tool | ${task.progress.lastTool} |`
|
||||||
}
|
}
|
||||||
|
|
||||||
let lastMessageSection = ""
|
let lastMessageSection = ""
|
||||||
@@ -91,6 +91,17 @@ ${truncated}
|
|||||||
\`\`\``
|
\`\`\``
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let statusNote = ""
|
||||||
|
if (task.status === "running") {
|
||||||
|
statusNote = `
|
||||||
|
|
||||||
|
> **Note**: No need to wait explicitly - the system will notify you when this task completes.`
|
||||||
|
} else if (task.status === "error") {
|
||||||
|
statusNote = `
|
||||||
|
|
||||||
|
> **Failed**: The task encountered an error. Check the last message for details.`
|
||||||
|
}
|
||||||
|
|
||||||
return `# Task Status
|
return `# Task Status
|
||||||
|
|
||||||
| Field | Value |
|
| Field | Value |
|
||||||
@@ -101,7 +112,7 @@ ${truncated}
|
|||||||
| Status | **${task.status}** |
|
| Status | **${task.status}** |
|
||||||
| Duration | ${duration} |
|
| Duration | ${duration} |
|
||||||
| Session ID | \`${task.sessionID}\` |${progressSection}
|
| Session ID | \`${task.sessionID}\` |${progressSection}
|
||||||
|
${statusNote}
|
||||||
## Original Prompt
|
## Original Prompt
|
||||||
|
|
||||||
\`\`\`
|
\`\`\`
|
||||||
|
|||||||
Reference in New Issue
Block a user