fix: integrate todo-codebase-compaction hook properly

- Import PreemptiveCompactionOptions type
- Export hook from hooks/index.ts
- Add todo-codebase-compaction to HookNameSchema
- Use todoCodebaseCompactionInjector when hook is enabled
This commit is contained in:
Oussama Douhou
2026-01-08 20:42:56 +01:00
parent 9bff359782
commit d5f75138dd
5 changed files with 9 additions and 3 deletions

View File

@@ -146,10 +146,13 @@ const OhMyOpenCodePlugin: Plugin = async (ctx) => {
const compactionContextInjector = isHookEnabled("compaction-context-injector")
? createCompactionContextInjector()
: undefined;
const todoCodebaseCompactionInjector = isHookEnabled("todo-codebase-compaction")
? createTodoCodebaseCompactionInjector()
: undefined;
const preemptiveCompaction = isHookEnabled("preemptive-compaction")
? createPreemptiveCompactionHook(ctx, {
experimental: pluginConfig.experimental,
onBeforeSummarize: compactionContextInjector,
onBeforeSummarize: todoCodebaseCompactionInjector ?? compactionContextInjector,
getModelLimit: (providerID, modelID) =>
getModelLimit(modelCacheState, providerID, modelID),
})