From e74cc82bcf3e2a3e23d3b48a5c3437fa18319fea Mon Sep 17 00:00:00 2001 From: YeonGyu-Kim Date: Thu, 11 Dec 2025 17:55:12 +0900 Subject: [PATCH] fix(background-agent): use tui.showToast() for notification MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit promptAsync() doesn't show visible message to user. Use tui.showToast() instead for immediate visible notification. 🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode) --- src/features/background-agent/manager.ts | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/src/features/background-agent/manager.ts b/src/features/background-agent/manager.ts index 669882e..205a2f8 100644 --- a/src/features/background-agent/manager.ts +++ b/src/features/background-agent/manager.ts @@ -214,26 +214,19 @@ export class BackgroundManager { const duration = this.formatDuration(task.startedAt, task.completedAt) const toolCalls = task.progress?.toolCalls ?? 0 - const message = `✅ **Background task completed!** + const toastMessage = `Background task completed: ${task.description} (${duration}, ${toolCalls} tools). Use background_result with taskId="${task.id}"` -**Task ID:** ${task.id} -**Description:** ${task.description} -**Duration:** ${duration} -**Tool calls:** ${toolCalls} - -Use \`background_result\` tool with taskId="${task.id}" to retrieve the full result.` - - log("[background-agent] Notifying parent session:", task.parentSessionID) + log("[background-agent] Notifying via toast:", task.id) - this.client.session.promptAsync({ - path: { id: task.parentSessionID }, + this.client.tui.showToast({ body: { - parts: [{ type: "text", text: message }], + message: toastMessage, + variant: "success", }, }).then(() => { - log("[background-agent] Parent session notified successfully") + log("[background-agent] Toast notification sent successfully") }).catch((error) => { - log("[background-agent] Failed to notify parent session:", error) + log("[background-agent] Failed to send toast:", error) }) }