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 f1c794e63e
commit a691a3ac0a
78 changed files with 1182 additions and 403 deletions
-5
View File
@@ -8,7 +8,6 @@ const EXPLORATION_AGENT_DENYLIST: Record<string, boolean> = {
write: false,
edit: false,
task: false,
delegate_task: false,
call_omo_agent: false,
}
@@ -21,7 +20,6 @@ const AGENT_RESTRICTIONS: Record<string, Record<string, boolean>> = {
write: false,
edit: false,
task: false,
delegate_task: false,
call_omo_agent: false,
},
@@ -29,14 +27,12 @@ const AGENT_RESTRICTIONS: Record<string, Record<string, boolean>> = {
write: false,
edit: false,
task: false,
delegate_task: false,
},
momus: {
write: false,
edit: false,
task: false,
delegate_task: false,
},
"multimodal-looker": {
@@ -45,7 +41,6 @@ const AGENT_RESTRICTIONS: Record<string, Record<string, boolean>> = {
"sisyphus-junior": {
task: false,
delegate_task: false,
},
}
+44
View File
@@ -130,5 +130,49 @@ describe("permission-compat", () => {
// then returns unchanged
expect(result).toEqual(config)
})
test("migrates delegate_task permission to task", () => {
//#given config with delegate_task permission
const config = {
model: "test",
permission: { delegate_task: "allow" as const, write: "deny" as const },
}
//#when migrating
const result = migrateAgentConfig(config)
//#then delegate_task is renamed to task
const perm = result.permission as Record<string, string>
expect(perm["task"]).toBe("allow")
expect(perm["delegate_task"]).toBeUndefined()
expect(perm["write"]).toBe("deny")
})
test("does not overwrite existing task permission with delegate_task", () => {
//#given config with both task and delegate_task permissions
const config = {
permission: { delegate_task: "allow" as const, task: "deny" as const },
}
//#when migrating
const result = migrateAgentConfig(config)
//#then existing task permission is preserved
const perm = result.permission as Record<string, string>
expect(perm["task"]).toBe("deny")
expect(perm["delegate_task"]).toBe("allow")
})
test("does not mutate the original config permission object", () => {
//#given config with delegate_task permission
const originalPerm = { delegate_task: "allow" as const }
const config = { permission: originalPerm }
//#when migrating
migrateAgentConfig(config)
//#then original permission object is not mutated
expect(originalPerm).toEqual({ delegate_task: "allow" })
})
})
})
+9
View File
@@ -73,5 +73,14 @@ export function migrateAgentConfig(
delete result.tools
}
if (result.permission && typeof result.permission === "object") {
const perm = { ...(result.permission as Record<string, PermissionValue>) }
if ("delegate_task" in perm && !("task" in perm)) {
perm["task"] = perm["delegate_task"]
delete perm["delegate_task"]
result.permission = perm
}
}
return result
}