fix(background-task): clarify task id contracts
This commit is contained in:
@@ -126,6 +126,13 @@ describe("Atlas prompts use task_id (not session_id) for retries", () => {
|
||||
expect(prompt, `${name}: missing task_id retry reference`).toMatch(/task_id/)
|
||||
}
|
||||
})
|
||||
|
||||
test("all variants should separate background ids from continuation task ids", () => {
|
||||
for (const [name, prompt] of ALL_VARIANTS) {
|
||||
expect(prompt, `${name}: missing bg result collection contract`).toContain('background_output(task_id="bg_...")')
|
||||
expect(prompt, `${name}: missing ses continuation contract`).toContain('task(task_id="ses_..."')
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
describe("Atlas prompts no-excuses retry policy", () => {
|
||||
|
||||
@@ -243,6 +243,6 @@ export const DEFAULT_ATLAS_CRITICAL_RULES = `<critical_overrides>
|
||||
- Run lsp_diagnostics after every delegation
|
||||
- Pass inherited wisdom to every subagent
|
||||
- Verify with your own tools
|
||||
- **Store task_id from every delegation output**
|
||||
- **Use \`task_id="{task_id}"\` for retries, fixes, and follow-ups**
|
||||
- **Store continuation task_id (\`ses_...\`) from every delegation output**
|
||||
- **Use \`task(task_id="ses_...", prompt="...")\` for retries, fixes, and follow-ups**
|
||||
</critical_overrides>`
|
||||
|
||||
@@ -216,6 +216,6 @@ export const KIMI_ATLAS_CRITICAL_RULES = `<critical_overrides>
|
||||
- Run lsp_diagnostics after every delegation
|
||||
- Pass inherited wisdom to every subagent
|
||||
- Verify with your own tools
|
||||
- **Store task_id from every delegation output**
|
||||
- **Use \`task_id="{task_id}"\` for retries, fixes, and follow-ups**
|
||||
- **Store continuation task_id (\`ses_...\`) from every delegation output**
|
||||
- **Use \`task(task_id="ses_...", prompt="...")\` for retries, fixes, and follow-ups**
|
||||
</critical_overrides>`
|
||||
|
||||
@@ -232,6 +232,6 @@ export const OPUS_47_ATLAS_CRITICAL_RULES = `<critical_overrides>
|
||||
- Run lsp_diagnostics after every delegation
|
||||
- Pass inherited wisdom to every subagent
|
||||
- Verify with your own tools
|
||||
- **Store task_id from every delegation output**
|
||||
- **Use \`task_id="{task_id}"\` for retries, fixes, and follow-ups**
|
||||
- **Store continuation task_id (\`ses_...\`) from every delegation output**
|
||||
- **Use \`task(task_id="ses_...", prompt="...")\` for retries, fixes, and follow-ups**
|
||||
</critical_overrides>`
|
||||
|
||||
@@ -120,7 +120,8 @@ task(category="quick", load_skills=[], run_in_background=false, prompt="...task
|
||||
- **Task execution** (\`category="..."\`): \`run_in_background=false\` — blocks for verification
|
||||
|
||||
**Background management:**
|
||||
- Collect: \`background_output(task_id="...")\`
|
||||
- Collect with background task IDs (\`bg_...\`): \`background_output(task_id="bg_...")\`
|
||||
- Continue follow-ups with continuation task IDs (\`ses_...\`): \`task(task_id="ses_...")\`
|
||||
- Cancel DISPOSABLE background tasks individually before final answer: \`background_cancel(taskId="bg_explore_xxx")\`
|
||||
- **NEVER \`background_cancel(all=true)\`** — it kills tasks whose output you have not collected.
|
||||
</parallel_by_default>`
|
||||
|
||||
Reference in New Issue
Block a user