From 67de6018074fee5cd4919d7b45ef3988bc09a5f3 Mon Sep 17 00:00:00 2001 From: ismeth Date: Tue, 3 Mar 2026 18:33:59 +0100 Subject: [PATCH] fix(athena): always show background_wait guidance for athena-junior, not just when forced The background_wait instruction was only shown when the caller passed run_in_background=false (forced case). But callers passing true also need the guidance since they were polling background_output instead. Now athena-junior always gets background_wait instructions regardless of how it was launched. --- src/tools/delegate-task/tools.test.ts | 6 +++--- src/tools/delegate-task/tools.ts | 3 +-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/tools/delegate-task/tools.test.ts b/src/tools/delegate-task/tools.test.ts index 458f90110..17bd337cd 100644 --- a/src/tools/delegate-task/tools.test.ts +++ b/src/tools/delegate-task/tools.test.ts @@ -861,11 +861,11 @@ describe("sisyphus-task", () => { toolContext ) - //#then — should still be background but with normal (non-forced) message + //#then — should also get background_wait guidance (athena-junior always gets it) const resultStr = String(result) expect(resultStr).toContain("Background task launched") - expect(resultStr).toContain("System notifies on completion") - expect(resultStr).not.toContain("automatically backgrounded") + expect(resultStr).toContain("background_wait") + expect(resultStr).toContain("automatically backgrounded") }, { timeout: 10000 }) }) diff --git a/src/tools/delegate-task/tools.ts b/src/tools/delegate-task/tools.ts index 878e6c997..14cce7506 100644 --- a/src/tools/delegate-task/tools.ts +++ b/src/tools/delegate-task/tools.ts @@ -263,8 +263,7 @@ export function createDelegateTask(options: DelegateTaskToolOptions): ToolDefini }) if (effectiveRunInBackground) { - const wasForced = isAthenaJunior && !runInBackground - return executeBackgroundTask(args, ctx, options, parentContext, agentToUse, categoryModel, systemContent, fallbackChain, wasForced) + return executeBackgroundTask(args, ctx, options, parentContext, agentToUse, categoryModel, systemContent, fallbackChain, isAthenaJunior) } return executeSyncTask(args, ctx, options, parentContext, agentToUse, categoryModel, systemContent, modelInfo, fallbackChain)