From 83cd453e02040febbaa8526ec13ae297b72d0d07 Mon Sep 17 00:00:00 2001 From: YeonGyu-Kim Date: Tue, 6 Jan 2026 15:14:10 +0900 Subject: [PATCH] refactor(features): update background agent manager MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Update background agent manager with latest configuration changes. 🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode) --- src/features/background-agent/manager.ts | 37 +++++++++++++++++++++++- 1 file changed, 36 insertions(+), 1 deletion(-) diff --git a/src/features/background-agent/manager.ts b/src/features/background-agent/manager.ts index 87083aad..a2ab9a00 100644 --- a/src/features/background-agent/manager.ts +++ b/src/features/background-agent/manager.ts @@ -128,7 +128,6 @@ export class BackgroundManager { agent: input.agent, tools: { task: false, - background_task: false, call_omo_agent: false, }, parts: [{ type: "text", text: input.prompt }], @@ -192,6 +191,42 @@ export class BackgroundManager { return undefined } + /** + * Register an external task (e.g., from sisyphus_task) for notification tracking. + * This allows tasks created by external tools to receive the same toast/prompt notifications. + */ + registerExternalTask(input: { + taskId: string + sessionID: string + parentSessionID: string + description: string + agent?: string + }): BackgroundTask { + const task: BackgroundTask = { + id: input.taskId, + sessionID: input.sessionID, + parentSessionID: input.parentSessionID, + parentMessageID: "", + description: input.description, + prompt: "", + agent: input.agent || "sisyphus_task", + status: "running", + startedAt: new Date(), + progress: { + toolCalls: 0, + lastUpdate: new Date(), + }, + } + + this.tasks.set(task.id, task) + subagentSessions.add(input.sessionID) + this.startPolling() + + log("[background-agent] Registered external task:", { taskId: task.id, sessionID: input.sessionID }) + + return task + } + private async checkSessionTodos(sessionID: string): Promise { try { const response = await this.client.session.todo({