feat(hooks): integrate anthropic-auto-compact hook for automatic context summarization
Enables automatic session summarization when Anthropic token limits are exceeded. The hook detects token limit errors and triggers compact operation on session idle. 🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
This commit is contained in:
@@ -10,6 +10,7 @@ import {
|
|||||||
createEmptyTaskResponseDetectorHook,
|
createEmptyTaskResponseDetectorHook,
|
||||||
createThinkModeHook,
|
createThinkModeHook,
|
||||||
createClaudeCodeHooksHook,
|
createClaudeCodeHooksHook,
|
||||||
|
createAnthropicAutoCompactHook,
|
||||||
} from "./hooks";
|
} from "./hooks";
|
||||||
import {
|
import {
|
||||||
loadUserCommands,
|
loadUserCommands,
|
||||||
@@ -80,6 +81,7 @@ const OhMyOpenCodePlugin: Plugin = async (ctx) => {
|
|||||||
const emptyTaskResponseDetector = createEmptyTaskResponseDetectorHook(ctx);
|
const emptyTaskResponseDetector = createEmptyTaskResponseDetectorHook(ctx);
|
||||||
const thinkMode = createThinkModeHook();
|
const thinkMode = createThinkModeHook();
|
||||||
const claudeCodeHooks = createClaudeCodeHooksHook(ctx, {});
|
const claudeCodeHooks = createClaudeCodeHooksHook(ctx, {});
|
||||||
|
const anthropicAutoCompact = createAnthropicAutoCompactHook(ctx);
|
||||||
|
|
||||||
updateTerminalTitle({ sessionId: "main" });
|
updateTerminalTitle({ sessionId: "main" });
|
||||||
|
|
||||||
@@ -140,6 +142,7 @@ const OhMyOpenCodePlugin: Plugin = async (ctx) => {
|
|||||||
await contextWindowMonitor.event(input);
|
await contextWindowMonitor.event(input);
|
||||||
await directoryAgentsInjector.event(input);
|
await directoryAgentsInjector.event(input);
|
||||||
await thinkMode.event(input);
|
await thinkMode.event(input);
|
||||||
|
await anthropicAutoCompact.event(input);
|
||||||
|
|
||||||
const { event } = input;
|
const { event } = input;
|
||||||
const props = event.properties as Record<string, unknown> | undefined;
|
const props = event.properties as Record<string, unknown> | undefined;
|
||||||
|
|||||||
Reference in New Issue
Block a user