Skip to content

Commit 64b53c0

Browse files
committed
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)
1 parent 0ae1f8c commit 64b53c0

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

src/tools/background-task/tools.ts

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,8 @@ function formatTaskStatus(task: BackgroundTask): string {
7272
const promptPreview = truncateText(task.prompt, 500)
7373

7474
let progressSection = ""
75-
if (task.progress) {
76-
progressSection = `\nTool calls: ${task.progress.toolCalls}\nLast tool: ${task.progress.lastTool ?? "N/A"}`
75+
if (task.progress?.lastTool) {
76+
progressSection = `\n| Last tool | ${task.progress.lastTool} |`
7777
}
7878

7979
let lastMessageSection = ""
@@ -91,6 +91,17 @@ ${truncated}
9191
\`\`\``
9292
}
9393

94+
let statusNote = ""
95+
if (task.status === "running") {
96+
statusNote = `
97+
98+
> **Note**: No need to wait explicitly - the system will notify you when this task completes.`
99+
} else if (task.status === "error") {
100+
statusNote = `
101+
102+
> **Failed**: The task encountered an error. Check the last message for details.`
103+
}
104+
94105
return `# Task Status
95106
96107
| Field | Value |
@@ -101,7 +112,7 @@ ${truncated}
101112
| Status | **${task.status}** |
102113
| Duration | ${duration} |
103114
| Session ID | \`${task.sessionID}\` |${progressSection}
104-
115+
${statusNote}
105116
## Original Prompt
106117
107118
\`\`\`

0 commit comments

Comments
 (0)