fix(prompts): prefer task_id in continuation guidance
This commit is contained in:
@@ -139,10 +139,10 @@ Count remaining **top-level task** checkboxes. Ignore nested verification/eviden
|
||||
[ ] Boulder: Read plan file, confirmed current progress
|
||||
\`\`\`
|
||||
|
||||
**If verification fails**: Resume the SAME session with the ACTUAL error output:
|
||||
**If verification fails**: Resume the SAME task with the ACTUAL error output:
|
||||
\`\`\`typescript
|
||||
task(
|
||||
session_id="ses_xyz789",
|
||||
task_id="ses_xyz789",
|
||||
load_skills=[...],
|
||||
prompt="Verification failed: {actual error}. Fix."
|
||||
)
|
||||
@@ -156,7 +156,7 @@ 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:
|
||||
2. **Resume the SAME task** - subagent has full context already:
|
||||
\`\`\`typescript
|
||||
task(
|
||||
task_id="ses_xyz789", // Task ID from failed task
|
||||
@@ -187,7 +187,7 @@ Final-wave reviewers can finish in parallel before you update the plan file, so
|
||||
|
||||
1. Execute all Final Wave tasks in parallel
|
||||
2. If ANY verdict is REJECT:
|
||||
- Fix the issues (delegate via \`task()\` with \`session_id\`)
|
||||
- Fix the issues (delegate via \`task()\` with \`task_id\`)
|
||||
- Re-run the rejecting reviewer
|
||||
- Repeat until ALL verdicts are APPROVE
|
||||
3. Mark \`pass-final-wave\` todo as \`completed\`
|
||||
|
||||
@@ -154,7 +154,7 @@ Answer THREE questions:
|
||||
ALL three must be YES. "Probably" = NO. "I think so" = NO.
|
||||
|
||||
- **All 3 YES** → Proceed.
|
||||
- **Any NO** → Reject: resume session with \`session_id\`, fix the specific issue.
|
||||
- **Any NO** → Reject: resume with \`task_id\`, fix the specific issue.
|
||||
|
||||
**After gate passes:** Check boulder state:
|
||||
\`\`\`
|
||||
@@ -185,7 +185,7 @@ Final-wave reviewers can finish in parallel before you update the plan file, so
|
||||
|
||||
1. Execute all Final Wave tasks in parallel
|
||||
2. If ANY verdict is REJECT:
|
||||
- Fix the issues (delegate via \`task()\` with \`session_id\`)
|
||||
- Fix the issues (delegate via \`task()\` with \`task_id\`)
|
||||
- Re-run the rejecting reviewer
|
||||
- Repeat until ALL verdicts are APPROVE
|
||||
3. Mark \`pass-final-wave\` todo as \`completed\`
|
||||
@@ -242,7 +242,7 @@ Subagents CLAIM "done" when:
|
||||
|
||||
**Phase 3 is NOT optional for user-facing changes.**
|
||||
**Phase 4 gate: ALL three questions must be YES. "Unsure" = NO.**
|
||||
**On failure: Resume with \`session_id\` and the SPECIFIC failure.**
|
||||
**On failure: Resume with \`task_id\` and the SPECIFIC failure.**
|
||||
</verification_rules>`
|
||||
|
||||
export const GEMINI_ATLAS_BOUNDARIES = `<boundaries>
|
||||
@@ -272,7 +272,7 @@ export const GEMINI_ATLAS_CRITICAL_RULES = `<critical_rules>
|
||||
- Send prompts under 30 lines
|
||||
- Skip scanned-file lsp_diagnostics (use 'filePath=".", extension=".ts"' for TypeScript projects; directory scans are capped at 50 files)
|
||||
- Batch multiple tasks in one delegation
|
||||
- Start fresh session for failures (use session_id)
|
||||
- Start fresh session for failures (do NOT do this; use task_id)
|
||||
|
||||
**ALWAYS**:
|
||||
- Include ALL 6 sections in delegation prompts
|
||||
@@ -280,6 +280,6 @@ export const GEMINI_ATLAS_CRITICAL_RULES = `<critical_rules>
|
||||
- Run scanned-file QA after every delegation
|
||||
- Pass inherited wisdom to every subagent
|
||||
- Parallelize independent tasks
|
||||
- Store and reuse session_id for retries
|
||||
- Store and reuse task_id for retries
|
||||
- **USE TOOL CALLS for verification - not internal reasoning**
|
||||
</critical_rules>`
|
||||
|
||||
@@ -158,7 +158,7 @@ Before moving to the next task, answer these THREE questions honestly:
|
||||
3. **Am I confident this doesn't break existing functionality?** (If no → run broader tests)
|
||||
|
||||
- **All 3 YES** → Proceed: mark task complete, move to next.
|
||||
- **Any NO** → Reject: resume session with \`session_id\`, fix the specific issue.
|
||||
- **Any NO** → Reject: resume with \`task_id\`, fix the specific issue.
|
||||
- **Unsure on any** → Reject: "unsure" = "no". Investigate until you have a definitive answer.
|
||||
|
||||
**After gate passes:** Check boulder state:
|
||||
@@ -190,7 +190,7 @@ Final-wave reviewers can finish in parallel before you update the plan file, so
|
||||
|
||||
1. Execute all Final Wave tasks in parallel
|
||||
2. If ANY verdict is REJECT:
|
||||
- Fix the issues (delegate via \`task()\` with \`session_id\`)
|
||||
- Fix the issues (delegate via \`task()\` with \`task_id\`)
|
||||
- Re-run the rejecting reviewer
|
||||
- Repeat until ALL verdicts are APPROVE
|
||||
3. Mark \`pass-final-wave\` todo as \`completed\`
|
||||
@@ -248,7 +248,7 @@ Your job is to CATCH THEM. Assume every claim is false until YOU personally veri
|
||||
|
||||
**Phase 4 gate:** ALL three questions must be YES to proceed. "Unsure" = NO. Investigate until certain.
|
||||
|
||||
**On failure at any phase:** Resume with \`session_id\` and the SPECIFIC failure. Do not start fresh.
|
||||
**On failure at any phase:** Resume with \`task_id\` and the SPECIFIC failure. Do not start fresh.
|
||||
</verification_rules>`
|
||||
|
||||
export const GPT_ATLAS_BOUNDARIES = `<boundaries>
|
||||
@@ -276,7 +276,7 @@ export const GPT_ATLAS_CRITICAL_RULES = `<critical_rules>
|
||||
- Send prompts under 30 lines
|
||||
- Skip scanned-file lsp_diagnostics (use 'filePath=".", extension=".ts"' for TypeScript projects; directory scans are capped at 50 files)
|
||||
- Batch multiple tasks in one delegation
|
||||
- Start fresh session for failures (use session_id)
|
||||
- Start fresh session for failures (do NOT do this; use task_id)
|
||||
|
||||
**ALWAYS**:
|
||||
- Include ALL 6 sections in delegation prompts
|
||||
@@ -284,5 +284,5 @@ export const GPT_ATLAS_CRITICAL_RULES = `<critical_rules>
|
||||
- Run scanned-file QA after every delegation
|
||||
- Pass inherited wisdom to every subagent
|
||||
- Parallelize independent tasks
|
||||
- Store and reuse session_id for retries
|
||||
- Store and reuse task_id for retries
|
||||
</critical_rules>`
|
||||
|
||||
@@ -407,7 +407,7 @@ 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** - \`task_id="{id}", prompt="Fix: {error}"\`
|
||||
- **Follow-up on result** - \`task_id="{id}", prompt="Also: {question}"\`
|
||||
|
||||
@@ -520,7 +520,7 @@ session_id: ses_standalone_def
|
||||
cleanupMessageStorage(sessionID)
|
||||
})
|
||||
|
||||
test("should include session_id and checkbox instructions in reminder", async () => {
|
||||
test("should include task_id and checkbox instructions in reminder", async () => {
|
||||
// given - boulder state, Atlas caller
|
||||
const sessionID = "session-resume-test"
|
||||
setupMessageStorage(sessionID, "atlas")
|
||||
|
||||
@@ -98,7 +98,7 @@ Answer honestly:
|
||||
ALL three must be YES. "Probably" = NO. "I think so" = NO. Investigate until CERTAIN.
|
||||
|
||||
- **All 3 YES** - Proceed: mark task complete, move to next.
|
||||
- **Any NO** - Reject: resume session with \`session_id\`, fix the specific issue.
|
||||
- **Any NO** - Reject: resume with \`task_id\`, fix the specific issue.
|
||||
- **Unsure** - Reject: "unsure" = "no". Investigate until you have a definitive answer.
|
||||
|
||||
**DO NOT proceed to the next task until all 4 phases are complete and the gate passes.**`
|
||||
|
||||
@@ -49,8 +49,8 @@ This section is CRITICAL for reviewer agents (momus, oracle) to maintain continu
|
||||
|
||||
## 8. Delegated Agent Sessions
|
||||
- List ALL background agent tasks spawned during this session
|
||||
- For each: agent name, category, status, description, and **session_id**
|
||||
- **RESUME, DON'T RESTART.** Each listed session retains full context. After compaction, use \`session_id\` to continue existing agent sessions instead of spawning new ones. This saves tokens, preserves learned context, and prevents duplicate work.
|
||||
- For each: agent name, category, status, description, and **task_id**
|
||||
- **RESUME, DON'T RESTART.** Each listed delegated task retains full context. After compaction, use \`task_id\` to continue existing delegated work instead of spawning new tasks. This saves tokens, preserves learned context, and prevents duplicate work.
|
||||
|
||||
This context is critical for maintaining continuity after compaction.
|
||||
`
|
||||
|
||||
@@ -107,7 +107,7 @@ describe("createCompactionContextInjector", () => {
|
||||
//#then
|
||||
expect(prompt).toContain("Delegated Agent Sessions")
|
||||
expect(prompt).toContain("RESUME, DON'T RESTART")
|
||||
expect(prompt).toContain("session_id")
|
||||
expect(prompt).toContain("task_id")
|
||||
})
|
||||
|
||||
it("injects actual task history when backgroundManager and sessionID provided", async () => {
|
||||
|
||||
Reference in New Issue
Block a user