diff --git a/src/config/schema.ts b/src/config/schema.ts index 387e08c7..df7d1457 100644 --- a/src/config/schema.ts +++ b/src/config/schema.ts @@ -87,6 +87,7 @@ export const HookNameSchema = z.enum([ "category-skill-reminder", "compaction-context-injector", + "compaction-todo-preserver", "claude-code-hooks", "auto-slash-command", "edit-error-recovery", diff --git a/src/index.ts b/src/index.ts index aa0c6e73..b8ef9807 100644 --- a/src/index.ts +++ b/src/index.ts @@ -35,6 +35,7 @@ import { createSubagentQuestionBlockerHook, createStopContinuationGuardHook, createCompactionContextInjector, + createCompactionTodoPreserverHook, createUnstableAgentBabysitterHook, createPreemptiveCompactionHook, createTasksTodowriteDisablerHook, @@ -348,6 +349,10 @@ const OhMyOpenCodePlugin: Plugin = async (ctx) => { ? safeCreateHook("compaction-context-injector", () => createCompactionContextInjector(), { enabled: safeHookEnabled }) : null; + const compactionTodoPreserver = isHookEnabled("compaction-todo-preserver") + ? safeCreateHook("compaction-todo-preserver", () => createCompactionTodoPreserverHook(ctx), { enabled: safeHookEnabled }) + : null; + const todoContinuationEnforcer = isHookEnabled("todo-continuation-enforcer") ? safeCreateHook("todo-continuation-enforcer", () => createTodoContinuationEnforcer(ctx, { backgroundManager, @@ -718,6 +723,7 @@ const OhMyOpenCodePlugin: Plugin = async (ctx) => { await interactiveBashSession?.event(input); await ralphLoop?.event(input); await stopContinuationGuard?.event(input); + await compactionTodoPreserver?.event(input); await atlasHook?.handler(input); const { event } = input; @@ -933,6 +939,7 @@ const OhMyOpenCodePlugin: Plugin = async (ctx) => { _input: { sessionID: string }, output: { context: string[] }, ): Promise => { + await compactionTodoPreserver?.capture(_input.sessionID); if (!compactionContextInjector) { return; }