feat: add agent fallback and preemptive-compaction restoration

- Add agent visibility fallback for first-run scenarios
- Restore preemptive-compaction hook
- Update migration and schema for preemptive-compaction restoration
This commit is contained in:
YeonGyu-Kim
2026-02-02 22:40:59 +09:00
parent 1bba54c7f6
commit 39dc2ff303
10 changed files with 259 additions and 14 deletions
+7
View File
@@ -35,6 +35,7 @@ import {
createStopContinuationGuardHook,
createCompactionContextInjector,
createUnstableAgentBabysitterHook,
createPreemptiveCompactionHook,
} from "./hooks";
import {
contextCollector,
@@ -126,6 +127,11 @@ const OhMyOpenCodePlugin: Plugin = async (ctx) => {
const contextWindowMonitor = isHookEnabled("context-window-monitor")
? createContextWindowMonitorHook(ctx)
: null;
const preemptiveCompaction =
isHookEnabled("preemptive-compaction") &&
pluginConfig.experimental?.preemptive_compaction
? createPreemptiveCompactionHook(ctx)
: null;
const sessionRecovery = isHookEnabled("session-recovery")
? createSessionRecoveryHook(ctx, {
experimental: pluginConfig.experimental,
@@ -805,6 +811,7 @@ const OhMyOpenCodePlugin: Plugin = async (ctx) => {
}
await claudeCodeHooks["tool.execute.after"](input, output);
await toolOutputTruncator?.["tool.execute.after"](input, output);
await preemptiveCompaction?.["tool.execute.after"](input, output);
await contextWindowMonitor?.["tool.execute.after"](input, output);
await commentChecker?.["tool.execute.after"](input, output);
await directoryAgentsInjector?.["tool.execute.after"](input, output);