From 5f21ddf473ce6408e8e5430c11e7b601c2b27dda Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pe=C3=AFo=20Thibault?= Date: Sat, 7 Feb 2026 13:42:20 +0100 Subject: [PATCH] fix(background-agent): switch session.prompt to promptAsync --- src/features/background-agent/manager.ts | 8 ++++---- src/features/background-agent/result-handler.ts | 2 +- src/features/background-agent/spawner.ts | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/features/background-agent/manager.ts b/src/features/background-agent/manager.ts index e58189a50..e631f30a0 100644 --- a/src/features/background-agent/manager.ts +++ b/src/features/background-agent/manager.ts @@ -310,7 +310,7 @@ export class BackgroundManager { promptLength: input.prompt.length, }) - // Use prompt() instead of promptAsync() to properly initialize agent loop (fire-and-forget) + // Fire-and-forget prompt via promptAsync (no response body needed) // Include model if caller provided one (e.g., from Sisyphus category configs) // IMPORTANT: variant must be a top-level field in the body, NOT nested inside model // OpenCode's PromptInput schema expects: { model: { providerID, modelID }, variant: "max" } @@ -571,7 +571,7 @@ export class BackgroundManager { promptLength: input.prompt.length, }) - // Use prompt() instead of promptAsync() to properly initialize agent loop + // Fire-and-forget prompt via promptAsync (no response body needed) // Include model if task has one (preserved from original launch with category config) // variant must be top-level in body, not nested inside model (OpenCode PromptInput schema) const resumeModel = existingTask.model @@ -579,7 +579,7 @@ export class BackgroundManager { : undefined const resumeVariant = existingTask.model?.variant - this.client.session.prompt({ + this.client.session.promptAsync({ path: { id: existingTask.sessionID }, body: { agent: existingTask.agent, @@ -1198,7 +1198,7 @@ Use \`background_output(task_id="${task.id}")\` to retrieve this result when rea }) try { - await this.client.session.prompt({ + await this.client.session.promptAsync({ path: { id: task.parentSessionID }, body: { noReply: !allComplete, diff --git a/src/features/background-agent/result-handler.ts b/src/features/background-agent/result-handler.ts index 3fca40916..84cb90843 100644 --- a/src/features/background-agent/result-handler.ts +++ b/src/features/background-agent/result-handler.ts @@ -240,7 +240,7 @@ Use \`background_output(task_id="${task.id}")\` to retrieve this result when rea }) try { - await client.session.prompt({ + await client.session.promptAsync({ path: { id: task.parentSessionID }, body: { noReply: !allComplete, diff --git a/src/features/background-agent/spawner.ts b/src/features/background-agent/spawner.ts index f9c9cae5e..477aafc18 100644 --- a/src/features/background-agent/spawner.ts +++ b/src/features/background-agent/spawner.ts @@ -221,7 +221,7 @@ export async function resumeTask( : undefined const resumeVariant = task.model?.variant - client.session.prompt({ + client.session.promptAsync({ path: { id: task.sessionID }, body: { agent: task.agent,