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:
parent
2957e8b836
commit
83cd453e02
@ -128,7 +128,6 @@ export class BackgroundManager {
|
|||||||
agent: input.agent,
|
agent: input.agent,
|
||||||
tools: {
|
tools: {
|
||||||
task: false,
|
task: false,
|
||||||
background_task: false,
|
|
||||||
call_omo_agent: false,
|
call_omo_agent: false,
|
||||||
},
|
},
|
||||||
parts: [{ type: "text", text: input.prompt }],
|
parts: [{ type: "text", text: input.prompt }],
|
||||||
@ -192,6 +191,42 @@ export class BackgroundManager {
|
|||||||
return undefined
|
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> {
|
private async checkSessionTodos(sessionID: string): Promise<boolean> {
|
||||||
try {
|
try {
|
||||||
const response = await this.client.session.todo({
|
const response = await this.client.session.todo({
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user