feat(hooks): add sisyphus-task-retry hook for auto-correction

Helps non-Opus models recover from sisyphus_task call failures:
- Detects common errors (missing params, mutual exclusion, unknown values)
- Injects retry guidance with correct parameter format
- Extracts available options from error messages
- Disableable via config: disabledHooks: ['sisyphus-task-retry']
This commit is contained in:
GeonWoo Jeon
2026-01-13 23:06:58 +09:00
parent c6fb5e58c8
commit 4a722df8be
5 changed files with 265 additions and 2 deletions
+8 -2
View File
@@ -26,6 +26,7 @@ import {
createRalphLoopHook,
createAutoSlashCommandHook,
createEditErrorRecoveryHook,
createSisyphusTaskRetryHook,
createTaskResumeInfoHook,
createStartWorkHook,
createSisyphusOrchestratorHook,
@@ -202,6 +203,10 @@ const OhMyOpenCodePlugin: Plugin = async (ctx) => {
? createEditErrorRecoveryHook(ctx)
: null;
const sisyphusTaskRetry = isHookEnabled("sisyphus-task-retry")
? createSisyphusTaskRetryHook(ctx)
: null;
const startWork = isHookEnabled("start-work")
? createStartWorkHook(ctx)
: null;
@@ -554,8 +559,9 @@ const OhMyOpenCodePlugin: Plugin = async (ctx) => {
await emptyTaskResponseDetector?.["tool.execute.after"](input, output);
await agentUsageReminder?.["tool.execute.after"](input, output);
await interactiveBashSession?.["tool.execute.after"](input, output);
await editErrorRecovery?.["tool.execute.after"](input, output);
await sisyphusOrchestrator?.["tool.execute.after"]?.(input, output);
await editErrorRecovery?.["tool.execute.after"](input, output);
await sisyphusTaskRetry?.["tool.execute.after"](input, output);
await sisyphusOrchestrator?.["tool.execute.after"]?.(input, output);
await taskResumeInfo["tool.execute.after"](input, output);
},
};