From 219c1f8225d3f24ba13bab5caebad784ce63f11a Mon Sep 17 00:00:00 2001 From: YeonGyu-Kim Date: Tue, 17 Feb 2026 03:53:02 +0900 Subject: [PATCH] update: always wait for Oracle results instead of blanket background_cancel(all=true) --- src/agents/dynamic-agent-prompt-builder.ts | 4 ++++ src/agents/sisyphus.ts | 7 ++++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/agents/dynamic-agent-prompt-builder.ts b/src/agents/dynamic-agent-prompt-builder.ts index defaeecb8..de81236d9 100644 --- a/src/agents/dynamic-agent-prompt-builder.ts +++ b/src/agents/dynamic-agent-prompt-builder.ts @@ -336,6 +336,10 @@ ${avoidWhen.map((w) => `- ${w}`).join("\n")} Briefly announce "Consulting Oracle for [reason]" before invocation. **Exception**: This is the ONLY case where you announce before acting. For all other work, start immediately without status updates. + +### Oracle Background Task Policy: +- Oracle takes 20+ min by design. Always wait for Oracle results via \`background_output\` before final answer. +- Oracle provides independent analysis from a different angle that catches blind spots — even when you believe you already have sufficient context, Oracle's perspective is worth the wait. ` } diff --git a/src/agents/sisyphus.ts b/src/agents/sisyphus.ts index 11ecdc34b..39710b28c 100644 --- a/src/agents/sisyphus.ts +++ b/src/agents/sisyphus.ts @@ -310,7 +310,7 @@ result = task(..., run_in_background=false) // Never wait synchronously for exp 1. Launch parallel agents → receive task_ids 2. Continue immediate work 3. When results needed: \`background_output(task_id="...")\` -4. BEFORE final answer: \`background_cancel(all=true)\` +4. Before final answer: cancel disposable tasks (explore, librarian) individually via \`background_cancel(taskId="...")\`. Always wait for Oracle — collect its result via \`background_output\` before answering. ### Search Stop Conditions @@ -449,8 +449,9 @@ If verification fails: 3. Report: "Done. Note: found N pre-existing lint errors unrelated to my changes." ### Before Delivering Final Answer: -- Cancel ALL running background tasks: \`background_cancel(all=true)\` -- This conserves resources and ensures clean workflow completion +- Cancel disposable background tasks (explore, librarian) individually via \`background_cancel(taskId="...")\` +- **Always wait for Oracle**: Oracle takes 20+ min by design and always provides valuable independent analysis from a different angle — even when you already have enough context. Collect Oracle results via \`background_output\` before answering. +- When Oracle is running, cancel disposable tasks individually instead of using \`background_cancel(all=true)\`. ${oracleSection}