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
+9 -2
View File
@@ -86,6 +86,13 @@ Prompts MUST be in English.`
async execute(args: DelegateTaskArgs, toolContext) {
const ctx = toolContext as ToolContextWithMetadata
if (args.category && !args.subagent_type) {
args.subagent_type = "sisyphus-junior"
}
await ctx.metadata?.({
title: args.description,
})
if (args.run_in_background === undefined) {
throw new Error(`Invalid arguments: 'run_in_background' parameter is REQUIRED. Use run_in_background=false for task delegation, run_in_background=true only for parallel exploration.`)
}
@@ -116,7 +123,7 @@ Prompts MUST be in English.`
return executeSyncContinuation(args, ctx, options)
}
if (args.category && args.subagent_type) {
if (args.category && args.subagent_type && args.subagent_type !== "sisyphus-junior") {
return `Invalid arguments: Provide EITHER category OR subagent_type, not both.`
}
@@ -157,7 +164,7 @@ Prompts MUST be in English.`
const isRunInBackgroundExplicitlyFalse = args.run_in_background === false || args.run_in_background === "false" as unknown as boolean
log("[delegate_task] unstable agent detection", {
log("[task] unstable agent detection", {
category: args.category,
actualModel,
isUnstableAgent,