refactor(features): update background agent manager

Update background agent manager with latest configuration changes.

🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
This commit is contained in:
YeonGyu-Kim
2026-01-06 15:14:10 +09:00
parent 2957e8b836
commit 83cd453e02

View File

@@ -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<boolean> {
try {
const response = await this.client.session.todo({