From 180fcc3e5d8a48830e3071b0704a8229fe83f218 Mon Sep 17 00:00:00 2001 From: YeonGyu-Kim Date: Sat, 7 Feb 2026 19:15:52 +0900 Subject: [PATCH] fix: register compaction todo preserver Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode) Co-authored-by: Sisyphus --- src/config/schema.ts | 1 + src/index.ts | 7 +++++++ 2 files changed, 8 insertions(+) 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; }