feat(preemptive-compaction): add onBeforeSummarize callback and context injection
- Added BeforeSummarizeCallback type to allow injecting context before session summarization - Added onBeforeSummarize option to PreemptiveCompactionOptions - Created compaction-context-injector module that injects summarization instructions with sections: - User Requests (As-Is) - Final Goal - Work Completed - Remaining Tasks - MUST NOT Do (Critical Constraints) - Wired up callback invocation in preemptive-compaction before calling summarize API - Exported new hook from src/hooks/index.ts 🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
This commit is contained in:
@@ -14,6 +14,7 @@ import {
|
||||
createClaudeCodeHooksHook,
|
||||
createAnthropicAutoCompactHook,
|
||||
createPreemptiveCompactionHook,
|
||||
createCompactionContextInjector,
|
||||
createRulesInjectorHook,
|
||||
createBackgroundNotificationHook,
|
||||
createAutoUpdateCheckerHook,
|
||||
@@ -256,7 +257,11 @@ const OhMyOpenCodePlugin: Plugin = async (ctx) => {
|
||||
const anthropicAutoCompact = isHookEnabled("anthropic-auto-compact")
|
||||
? createAnthropicAutoCompactHook(ctx, { experimental: pluginConfig.experimental })
|
||||
: null;
|
||||
const preemptiveCompaction = createPreemptiveCompactionHook(ctx, { experimental: pluginConfig.experimental });
|
||||
const compactionContextInjector = createCompactionContextInjector();
|
||||
const preemptiveCompaction = createPreemptiveCompactionHook(ctx, {
|
||||
experimental: pluginConfig.experimental,
|
||||
onBeforeSummarize: compactionContextInjector,
|
||||
});
|
||||
const rulesInjector = isHookEnabled("rules-injector")
|
||||
? createRulesInjectorHook(ctx)
|
||||
: null;
|
||||
|
||||
Reference in New Issue
Block a user