refactor: migrate delegate_task to task tool with metadata fixes

- Rename delegate_task tool to task across codebase (100 files)
- Update model references: claude-opus-4-6 → 4-5, gpt-5.3-codex → 5.2-codex
- Add tool-metadata-store to restore metadata overwritten by fromPlugin()
- Add session ID polling for BackgroundManager task sessions
- Await async ctx.metadata() calls in tool executors
- Add ses_ prefix guard to getMessageDir for performance
- Harden BackgroundManager with idle deferral and error handling
- Fix duplicate task key in sisyphus-junior test object literals
- Fix unawaited showOutputToUser in ast_grep_replace
- Fix background=true → run_in_background=true in ultrawork prompt
- Fix duplicate task/task references in docs and comments
This commit is contained in:
YeonGyu-Kim
2026-02-06 16:01:54 +09:00
parent 202e0d1613
commit b30a131690
78 changed files with 1182 additions and 403 deletions
+10 -10
View File
@@ -44,7 +44,7 @@ You just performed direct file modifications outside \`.sisyphus/\`.
**You are an ORCHESTRATOR, not an IMPLEMENTER.**
As an orchestrator, you should:
- **DELEGATE** implementation work to subagents via \`delegate_task\`
- **DELEGATE** implementation work to subagents via \`task\`
- **VERIFY** the work done by subagents
- **COORDINATE** multiple tasks and ensure completion
@@ -54,7 +54,7 @@ You should NOT:
- Implement features yourself
**If you need to make changes:**
1. Use \`delegate_task\` to delegate to an appropriate subagent
1. Use \`task\` to delegate to an appropriate subagent
2. Provide clear instructions in the prompt
3. Verify the subagent's work after completion
@@ -128,7 +128,7 @@ You (Atlas) are attempting to directly modify a file outside \`.sisyphus/\`.
**THIS IS FORBIDDEN** (except for VERIFICATION purposes)
As an ORCHESTRATOR, you MUST:
1. **DELEGATE** all implementation work via \`delegate_task\`
1. **DELEGATE** all implementation work via \`task\`
2. **VERIFY** the work done by subagents (reading files is OK)
3. **COORDINATE** - you orchestrate, you don't implement
@@ -146,11 +146,11 @@ As an ORCHESTRATOR, you MUST:
**IF THIS IS FOR VERIFICATION:**
Proceed if you are verifying subagent work by making a small fix.
But for any substantial changes, USE \`delegate_task\`.
But for any substantial changes, USE \`task\`.
**CORRECT APPROACH:**
\`\`\`
delegate_task(
task(
category="...",
prompt="[specific single task with clear acceptance criteria]"
)
@@ -193,7 +193,7 @@ function buildVerificationReminder(sessionId: string): string {
**If ANY verification fails, use this immediately:**
\`\`\`
delegate_task(session_id="${sessionId}", prompt="fix: [describe the specific failure]")
task(session_id="${sessionId}", prompt="fix: [describe the specific failure]")
\`\`\``
}
@@ -688,12 +688,12 @@ export function createAtlasHook(
return
}
// Check delegate_task - inject single-task directive
if (input.tool === "delegate_task") {
// Check task - inject single-task directive
if (input.tool === "task") {
const prompt = output.args.prompt as string | undefined
if (prompt && !prompt.includes(SYSTEM_DIRECTIVE_PREFIX)) {
output.args.prompt = `<system-reminder>${SINGLE_TASK_DIRECTIVE}</system-reminder>\n` + prompt
log(`[${HOOK_NAME}] Injected single-task directive to delegate_task`, {
log(`[${HOOK_NAME}] Injected single-task directive to task`, {
sessionID: input.sessionID,
})
}
@@ -732,7 +732,7 @@ export function createAtlasHook(
return
}
if (input.tool !== "delegate_task") {
if (input.tool !== "task") {
return
}