refactor(task): align continuation ids with task_id
This commit is contained in:
@@ -150,16 +150,16 @@ task(
|
||||
|
||||
### 3.5 Handle Failures (USE RESUME)
|
||||
|
||||
**CRITICAL: When re-delegating, ALWAYS use \`session_id\` parameter.**
|
||||
**CRITICAL: When re-delegating, ALWAYS use \`task_id\` parameter.**
|
||||
|
||||
Every \`task()\` output includes a session_id. STORE IT.
|
||||
Every \`task()\` output includes a task_id. STORE IT.
|
||||
|
||||
If task fails:
|
||||
1. Identify what went wrong
|
||||
2. **Resume the SAME session** - subagent has full context already:
|
||||
\`\`\`typescript
|
||||
task(
|
||||
session_id="ses_xyz789", // Session from failed task
|
||||
task_id="ses_xyz789", // Task ID from failed task
|
||||
load_skills=[...],
|
||||
prompt="FAILED: {error}. Fix by: {specific instruction}"
|
||||
)
|
||||
@@ -167,7 +167,7 @@ If task fails:
|
||||
3. Maximum 3 retry attempts with the SAME session
|
||||
4. If blocked after 3 attempts: Document and continue to independent tasks
|
||||
|
||||
**Why session_id is MANDATORY for failures:**
|
||||
**Why task_id is MANDATORY for failures:**
|
||||
- Subagent already read all files, knows the context
|
||||
- No repeated exploration = 70%+ token savings
|
||||
- Subagent knows what approaches already failed
|
||||
@@ -292,6 +292,6 @@ export const DEFAULT_ATLAS_CRITICAL_RULES = `<critical_overrides>
|
||||
- Pass inherited wisdom to every subagent
|
||||
- Parallelize independent tasks
|
||||
- Verify with your own tools
|
||||
- **Store session_id from every delegation output**
|
||||
- **Use \`session_id="{session_id}"\` for retries, fixes, and follow-ups**
|
||||
- **Store task_id from every delegation output**
|
||||
- **Use \`task_id="{task_id}"\` for retries, fixes, and follow-ups**
|
||||
</critical_overrides>`
|
||||
|
||||
@@ -164,10 +164,10 @@ Count remaining **top-level task** checkboxes. Ignore nested verification/eviden
|
||||
|
||||
### 3.5 Handle Failures
|
||||
|
||||
**CRITICAL: Use \`session_id\` for retries.**
|
||||
**CRITICAL: Use \`task_id\` for retries.**
|
||||
|
||||
\`\`\`typescript
|
||||
task(session_id="ses_xyz789", load_skills=[...], prompt="FAILED: {error}. Fix by: {instruction}")
|
||||
task(task_id="ses_xyz789", load_skills=[...], prompt="FAILED: {error}. Fix by: {instruction}")
|
||||
\`\`\`
|
||||
|
||||
- Maximum 3 retries per task
|
||||
|
||||
@@ -169,10 +169,10 @@ Count remaining **top-level task** checkboxes. Ignore nested verification/eviden
|
||||
|
||||
### 3.5 Handle Failures
|
||||
|
||||
**CRITICAL: Use \`session_id\` for retries.**
|
||||
**CRITICAL: Use \`task_id\` for retries.**
|
||||
|
||||
\`\`\`typescript
|
||||
task(session_id="ses_xyz789", load_skills=[...], prompt="FAILED: {error}. Fix by: {instruction}")
|
||||
task(task_id="ses_xyz789", load_skills=[...], prompt="FAILED: {error}. Fix by: {instruction}")
|
||||
\`\`\`
|
||||
|
||||
- Maximum 3 retries per task
|
||||
|
||||
@@ -182,7 +182,7 @@ Multi-step task? **ALWAYS consult Plan Agent first.** Do NOT start implementatio
|
||||
|
||||
- Single-file fix or trivial change → proceed directly
|
||||
- Anything else (2+ steps, unclear scope, architecture) → \`task(subagent_type="plan", ...)\` FIRST
|
||||
- Use \`session_id\` to resume the same Plan Agent - ask follow-up questions aggressively
|
||||
- Use \`task_id\` to resume the same Plan Agent - ask follow-up questions aggressively
|
||||
- If ANY part of the task is ambiguous, ask Plan Agent before guessing
|
||||
|
||||
Plan Agent returns a structured work breakdown with parallel execution opportunities. Follow it.`
|
||||
|
||||
@@ -409,9 +409,9 @@ After delegation, ALWAYS verify: works as expected? follows codebase pattern? MU
|
||||
|
||||
Every \`task()\` output includes a session_id. **USE IT for follow-ups.**
|
||||
|
||||
- **Task failed/incomplete** - \`session_id="{id}", prompt="Fix: {error}"\`
|
||||
- **Follow-up on result** - \`session_id="{id}", prompt="Also: {question}"\`
|
||||
- **Verification failed** - \`session_id="{id}", prompt="Failed: {error}. Fix."\`
|
||||
- **Task failed/incomplete** - \`task_id="{id}", prompt="Fix: {error}"\`
|
||||
- **Follow-up on result** - \`task_id="{id}", prompt="Also: {question}"\`
|
||||
- **Verification failed** - \`task_id="{id}", prompt="Failed: {error}. Fix."\`
|
||||
|
||||
${
|
||||
oracleSection
|
||||
|
||||
@@ -312,10 +312,10 @@ Every delegation prompt needs these 6 sections:
|
||||
After delegation, verify by reading every file the subagent touched. Check: works as expected? follows codebase pattern? Do not trust self-reports.
|
||||
|
||||
<session_continuity>
|
||||
Every \`task()\` returns a session_id. Use it for all follow-ups:
|
||||
- Task failed/incomplete: \`session_id="{id}", prompt="Fix: {error}"\`
|
||||
- Follow-up on result: \`session_id="{id}", prompt="Also: {question}"\`
|
||||
- Verification failed: \`session_id="{id}", prompt="Failed: {error}. Fix."\`
|
||||
Every \`task()\` returns a task_id. Use it for all follow-ups:
|
||||
- Task failed/incomplete: \`task_id="{id}", prompt="Fix: {error}"\`
|
||||
- Follow-up on result: \`task_id="{id}", prompt="Also: {question}"\`
|
||||
- Verification failed: \`task_id="{id}", prompt="Failed: {error}. Fix."\`
|
||||
|
||||
This preserves full context, avoids repeated exploration, saves 70%+ tokens.
|
||||
</session_continuity>
|
||||
|
||||
@@ -277,11 +277,11 @@ After delegation, ALWAYS verify: works as expected? follows codebase pattern? MU
|
||||
|
||||
### Session Continuity
|
||||
|
||||
Every \`task()\` output includes a session_id. **USE IT for follow-ups.**
|
||||
Every \`task()\` output includes a task_id. **USE IT for follow-ups.**
|
||||
|
||||
- **Task failed/incomplete** - \`session_id="{id}", prompt="Fix: {error}"\`
|
||||
- **Follow-up on result** - \`session_id="{id}", prompt="Also: {question}"\`
|
||||
- **Verification failed** - \`session_id="{id}", prompt="Failed: {error}. Fix."\`
|
||||
- **Task failed/incomplete** - \`task_id="{id}", prompt="Fix: {error}"\`
|
||||
- **Follow-up on result** - \`task_id="{id}", prompt="Also: {question}"\`
|
||||
- **Verification failed** - \`task_id="{id}", prompt="Failed: {error}. Fix."\`
|
||||
|
||||
${
|
||||
oracleSection
|
||||
|
||||
@@ -317,15 +317,15 @@ AFTER THE WORK YOU DELEGATED SEEMS DONE, ALWAYS VERIFY THE RESULTS AS FOLLOWING:
|
||||
|
||||
### Session Continuity (MANDATORY)
|
||||
|
||||
Every \`task()\` output includes a session_id. **USE IT.**
|
||||
Every \`task()\` output includes a task_id. **USE IT.**
|
||||
|
||||
**ALWAYS continue when:**
|
||||
- Task failed/incomplete → \`session_id=\"{session_id}\", prompt=\"Fix: {specific error}\"\`
|
||||
- Follow-up question on result → \`session_id=\"{session_id}\", prompt=\"Also: {question}\"\`
|
||||
- Multi-turn with same agent → \`session_id=\"{session_id}\"\` - NEVER start fresh
|
||||
- Verification failed → \`session_id=\"{session_id}\", prompt=\"Failed verification: {error}. Fix.\"\`
|
||||
- Task failed/incomplete → \`task_id=\"{task_id}\", prompt=\"Fix: {specific error}\"\`
|
||||
- Follow-up question on result → \`task_id=\"{task_id}\", prompt=\"Also: {question}\"\`
|
||||
- Multi-turn with same agent → \`task_id=\"{task_id}\"\` - NEVER start fresh
|
||||
- Verification failed → \`task_id=\"{task_id}\", prompt=\"Failed verification: {error}. Fix.\"\`
|
||||
|
||||
**Why session_id is CRITICAL:**
|
||||
**Why task_id is CRITICAL:**
|
||||
- Subagent has FULL conversation context preserved
|
||||
- No repeated file reads, exploration, or setup
|
||||
- Saves 70%+ tokens on follow-ups
|
||||
@@ -336,10 +336,10 @@ Every \`task()\` output includes a session_id. **USE IT.**
|
||||
task(category="quick", load_skills=[], run_in_background=false, description="Fix type error", prompt="Fix the type error in auth.ts...")
|
||||
|
||||
// CORRECT: Resume preserves everything
|
||||
task(session_id="ses_abc123", load_skills=[], run_in_background=false, description="Fix type error", prompt="Fix: Type error on line 42")
|
||||
task(task_id="ses_abc123", load_skills=[], run_in_background=false, description="Fix type error", prompt="Fix: Type error on line 42")
|
||||
\`\`\`
|
||||
|
||||
**After EVERY delegation, STORE the session_id for potential continuation.**
|
||||
**After EVERY delegation, STORE the task_id for potential continuation.**
|
||||
|
||||
### Code Changes:
|
||||
- Match existing patterns (if codebase is disciplined)
|
||||
|
||||
@@ -389,15 +389,15 @@ AFTER THE WORK YOU DELEGATED SEEMS DONE, ALWAYS VERIFY THE RESULTS AS FOLLOWING:
|
||||
|
||||
### Session Continuity (MANDATORY)
|
||||
|
||||
Every \`task()\` output includes a session_id. **USE IT.**
|
||||
Every \`task()\` output includes a task_id. **USE IT.**
|
||||
|
||||
**ALWAYS continue when:**
|
||||
- Task failed/incomplete → \`session_id="{session_id}", prompt="Fix: {specific error}"\`
|
||||
- Follow-up question on result → \`session_id="{session_id}", prompt="Also: {question}"\`
|
||||
- Multi-turn with same agent → \`session_id="{session_id}"\` - NEVER start fresh
|
||||
- Verification failed → \`session_id="{session_id}", prompt="Failed verification: {error}. Fix."\`
|
||||
- Task failed/incomplete → \`task_id="{task_id}", prompt="Fix: {specific error}"\`
|
||||
- Follow-up question on result → \`task_id="{task_id}", prompt="Also: {question}"\`
|
||||
- Multi-turn with same agent → \`task_id="{task_id}"\` - NEVER start fresh
|
||||
- Verification failed → \`task_id="{task_id}", prompt="Failed verification: {error}. Fix."\`
|
||||
|
||||
**Why session_id is CRITICAL:**
|
||||
**Why task_id is CRITICAL:**
|
||||
- Subagent has FULL conversation context preserved
|
||||
- No repeated file reads, exploration, or setup
|
||||
- Saves 70%+ tokens on follow-ups
|
||||
@@ -408,10 +408,10 @@ Every \`task()\` output includes a session_id. **USE IT.**
|
||||
task(category="quick", load_skills=[], run_in_background=false, description="Fix type error", prompt="Fix the type error in auth.ts...")
|
||||
|
||||
// CORRECT: Resume preserves everything
|
||||
task(session_id="ses_abc123", load_skills=[], run_in_background=false, description="Fix type error", prompt="Fix: Type error on line 42")
|
||||
task(task_id="ses_abc123", load_skills=[], run_in_background=false, description="Fix type error", prompt="Fix: Type error on line 42")
|
||||
\`\`\`
|
||||
|
||||
**After EVERY delegation, STORE the session_id for potential continuation.**
|
||||
**After EVERY delegation, STORE the task_id for potential continuation.**
|
||||
|
||||
### Code Changes:
|
||||
- Match existing patterns (if codebase is disciplined)
|
||||
|
||||
@@ -387,10 +387,10 @@ Post-delegation: delegation never substitutes for verification. Always run \`<ve
|
||||
|
||||
### Session continuity
|
||||
|
||||
Every \`task()\` returns a session_id. Use it for all follow-ups:
|
||||
- Failed/incomplete → \`session_id="{id}", prompt="Fix: {specific error}"\`
|
||||
- Follow-up → \`session_id="{id}", prompt="Also: {question}"\`
|
||||
- Multi-turn → always \`session_id\`, never start fresh
|
||||
Every \`task()\` returns a task_id. Use it for all follow-ups:
|
||||
- Failed/incomplete → \`task_id="{id}", prompt="Fix: {specific error}"\`
|
||||
- Follow-up → \`task_id="{id}", prompt="Also: {question}"\`
|
||||
- Multi-turn → always \`task_id\`, never start fresh
|
||||
|
||||
This preserves full context, avoids repeated exploration, saves 70%+ tokens.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user