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:
@@ -8,7 +8,7 @@ import {
|
||||
describe("sisyphus-task-retry", () => {
|
||||
describe("DELEGATE_TASK_ERROR_PATTERNS", () => {
|
||||
// given error patterns are defined
|
||||
// then should include all known delegate_task error types
|
||||
// then should include all known task error types
|
||||
it("should contain all known error patterns", () => {
|
||||
expect(DELEGATE_TASK_ERROR_PATTERNS.length).toBeGreaterThan(5)
|
||||
|
||||
|
||||
@@ -45,7 +45,7 @@ export const DELEGATE_TASK_ERROR_PATTERNS: DelegateTaskErrorPattern[] = [
|
||||
{
|
||||
pattern: "Cannot call primary agent",
|
||||
errorType: "primary_agent",
|
||||
fixHint: "Primary agents cannot be called via delegate_task. Use a subagent like 'explore', 'oracle', or 'librarian'",
|
||||
fixHint: "Primary agents cannot be called via task. Use a subagent like 'explore', 'oracle', or 'librarian'",
|
||||
},
|
||||
{
|
||||
pattern: "Skills not found",
|
||||
@@ -85,11 +85,11 @@ export function buildRetryGuidance(errorInfo: DetectedError): string {
|
||||
)
|
||||
|
||||
if (!pattern) {
|
||||
return `[delegate_task ERROR] Fix the error and retry with correct parameters.`
|
||||
return `[task ERROR] Fix the error and retry with correct parameters.`
|
||||
}
|
||||
|
||||
let guidance = `
|
||||
[delegate_task CALL FAILED - IMMEDIATE RETRY REQUIRED]
|
||||
[task CALL FAILED - IMMEDIATE RETRY REQUIRED]
|
||||
|
||||
**Error Type**: ${errorInfo.errorType}
|
||||
**Fix**: ${pattern.fixHint}
|
||||
@@ -101,11 +101,11 @@ export function buildRetryGuidance(errorInfo: DetectedError): string {
|
||||
}
|
||||
|
||||
guidance += `
|
||||
**Action**: Retry delegate_task NOW with corrected parameters.
|
||||
**Action**: Retry task NOW with corrected parameters.
|
||||
|
||||
Example of CORRECT call:
|
||||
\`\`\`
|
||||
delegate_task(
|
||||
task(
|
||||
description="Task description",
|
||||
prompt="Detailed prompt...",
|
||||
category="unspecified-low", // OR subagent_type="explore"
|
||||
@@ -124,7 +124,7 @@ export function createDelegateTaskRetryHook(_ctx: PluginInput) {
|
||||
input: { tool: string; sessionID: string; callID: string },
|
||||
output: { title: string; output: string; metadata: unknown }
|
||||
) => {
|
||||
if (input.tool.toLowerCase() !== "delegate_task") return
|
||||
if (input.tool.toLowerCase() !== "task") return
|
||||
|
||||
const errorInfo = detectDelegateTaskError(output.output)
|
||||
if (errorInfo) {
|
||||
|
||||
Reference in New Issue
Block a user