diff --git a/src/agents/atlas/default.ts b/src/agents/atlas/default.ts index 9ba077975..405529a40 100644 --- a/src/agents/atlas/default.ts +++ b/src/agents/atlas/default.ts @@ -311,7 +311,8 @@ task(category="quick", load_skills=[], run_in_background=false, prompt="Task 4.. **Background management**: - Collect results: \`background_output(task_id="...")\` -- Before final answer: \`background_cancel(all=true)\` +- Before final answer, cancel DISPOSABLE tasks individually: \`background_cancel(taskId="bg_explore_xxx")\`, \`background_cancel(taskId="bg_librarian_xxx")\` +- **NEVER use \`background_cancel(all=true)\`** — it kills tasks whose results you haven't collected yet diff --git a/src/agents/atlas/gpt.ts b/src/agents/atlas/gpt.ts index 99bddeaa8..90d922d25 100644 --- a/src/agents/atlas/gpt.ts +++ b/src/agents/atlas/gpt.ts @@ -298,7 +298,8 @@ task(category="quick", load_skills=[], run_in_background=false, prompt="Task 3.. **Background management**: - Collect: \`background_output(task_id="...")\` -- Cleanup: \`background_cancel(all=true)\` +- Before final answer, cancel DISPOSABLE tasks individually: \`background_cancel(taskId="bg_explore_xxx")\`, \`background_cancel(taskId="bg_librarian_xxx")\` +- **NEVER use \`background_cancel(all=true)\`** — it kills tasks whose results you haven't collected yet diff --git a/src/agents/hephaestus.ts b/src/agents/hephaestus.ts index 9602378fd..feac23219 100644 --- a/src/agents/hephaestus.ts +++ b/src/agents/hephaestus.ts @@ -292,7 +292,8 @@ Prompt structure for each agent: - NEVER use \`run_in_background=false\` for explore/librarian - Continue your work immediately after launching background agents - Collect results with \`background_output(task_id="...")\` when needed -- BEFORE final answer: \`background_cancel(all=true)\` to clean up +- BEFORE final answer, cancel DISPOSABLE tasks individually: \`background_cancel(taskId="bg_explore_xxx")\`, \`background_cancel(taskId="bg_librarian_xxx")\` +- **NEVER use \`background_cancel(all=true)\`** — it kills tasks whose results you haven't collected yet ### Search Stop Conditions diff --git a/src/agents/sisyphus.ts b/src/agents/sisyphus.ts index 9ac7be1bc..1079099be 100644 --- a/src/agents/sisyphus.ts +++ b/src/agents/sisyphus.ts @@ -306,9 +306,9 @@ result = task(..., run_in_background=false) // Never wait synchronously for exp ### Background Result Collection: 1. Launch parallel agents → receive task_ids 2. Continue immediate work -3. When results needed: \`background_output(task_id=\"...\")\` -4. Before final answer, cancel DISPOSABLE tasks (explore, librarian) individually: \`background_cancel(taskId=\"bg_explore_xxx\")\`, \`background_cancel(taskId=\"bg_librarian_xxx\")\` -5. **NEVER cancel Oracle.** ALWAYS collect Oracle result via \`background_output(task_id=\"bg_oracle_xxx\")\` before answering — even if you already have enough context. +3. When results needed: \`background_output(task_id="...")\` +4. Before final answer, cancel DISPOSABLE tasks (explore, librarian) individually: \`background_cancel(taskId="bg_explore_xxx")\`, \`background_cancel(taskId="bg_librarian_xxx")\` +5. **NEVER cancel Oracle.** ALWAYS collect Oracle result via \`background_output(task_id="bg_oracle_xxx")\` before answering — even if you already have enough context. 6. **NEVER use \`background_cancel(all=true)\`** — it kills Oracle. Cancel each disposable task by its specific taskId. ### Search Stop Conditions @@ -444,7 +444,7 @@ If verification fails: 3. Report: "Done. Note: found N pre-existing lint errors unrelated to my changes." ### Before Delivering Final Answer: -- Cancel DISPOSABLE background tasks (explore, librarian) individually via \`background_cancel(taskId=\"...\")\` +- Cancel DISPOSABLE background tasks (explore, librarian) individually via \`background_cancel(taskId="...")\` - **NEVER use \`background_cancel(all=true)\`.** Always cancel individually by taskId. - **Always wait for Oracle**: When Oracle is running and you have gathered enough context from your own exploration, your next action is \`background_output\` on Oracle — NOT delivering a final answer. Oracle's value is highest when you think you don't need it.