Skip to content

Commit 9519f6d

Browse files
authored
docs: fix oh-my-opencode hook name (#8)
* docs: fix oh-my-opencode hook name The correct hook name is 'anthropic-context-window-limit-recovery', not 'anthropic-auto-compact'. 🤖 Generated with assistance of [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode) * fix(cli): update hook name to anthropic-context-window-limit-recovery Also update CLI flag from --disable-auto-compact to --disable-context-recovery to match the new hook naming convention. 🤖 Generated with assistance of [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
1 parent bdcd869 commit 9519f6d

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ Add to `~/.config/opencode/oh-my-opencode.json`:
228228

229229
```json
230230
{
231-
"disabled_hooks": ["anthropic-auto-compact"]
231+
"disabled_hooks": ["anthropic-context-window-limit-recovery"]
232232
}
233233
```
234234

src/cli.ts

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ function isAutoCompactAlreadyDisabled(): boolean {
289289
const content = readFileSync(OH_MY_OPENCODE_CONFIG, "utf-8");
290290
const config = JSON.parse(content);
291291
const disabledHooks = config.disabled_hooks as string[] | undefined;
292-
return disabledHooks?.includes("anthropic-auto-compact") ?? false;
292+
return disabledHooks?.includes("anthropic-context-window-limit-recovery") ?? false;
293293
} catch {
294294
return false;
295295
}
@@ -305,13 +305,13 @@ function disableAutoCompactHook(): boolean {
305305
}
306306

307307
const disabledHooks = (config.disabled_hooks as string[]) || [];
308-
if (!disabledHooks.includes("anthropic-auto-compact")) {
309-
disabledHooks.push("anthropic-auto-compact");
308+
if (!disabledHooks.includes("anthropic-context-window-limit-recovery")) {
309+
disabledHooks.push("anthropic-context-window-limit-recovery");
310310
}
311311
config.disabled_hooks = disabledHooks;
312312

313313
writeFileSync(OH_MY_OPENCODE_CONFIG, JSON.stringify(config, null, 2));
314-
console.log(`✓ Disabled anthropic-auto-compact hook in oh-my-opencode.json`);
314+
console.log(`✓ Disabled anthropic-context-window-limit-recovery hook in oh-my-opencode.json`);
315315
return true;
316316
} catch (err) {
317317
console.error("✗ Failed to update oh-my-opencode.json:", err);
@@ -374,13 +374,13 @@ async function install(options: InstallOptions): Promise<number> {
374374
if (isOhMyOpencodeInstalled()) {
375375
console.log("\nStep 3: Configure Oh My OpenCode");
376376
console.log("Detected Oh My OpenCode plugin.");
377-
console.log("Supermemory handles context compaction, so the built-in auto-compact hook should be disabled.");
377+
console.log("Supermemory handles context compaction, so the built-in context-window-limit-recovery hook should be disabled.");
378378

379379
if (isAutoCompactAlreadyDisabled()) {
380-
console.log("✓ anthropic-auto-compact hook already disabled");
380+
console.log("✓ anthropic-context-window-limit-recovery hook already disabled");
381381
} else {
382382
if (options.tui) {
383-
const shouldDisable = await confirm(rl!, "Disable anthropic-auto-compact hook to let Supermemory handle context?");
383+
const shouldDisable = await confirm(rl!, "Disable anthropic-context-window-limit-recovery hook to let Supermemory handle context?");
384384
if (!shouldDisable) {
385385
console.log("Skipped.");
386386
} else {
@@ -389,7 +389,7 @@ async function install(options: InstallOptions): Promise<number> {
389389
} else if (options.disableAutoCompact) {
390390
disableAutoCompactHook();
391391
} else {
392-
console.log("Skipped. Use --disable-auto-compact to disable the hook in non-interactive mode.");
392+
console.log("Skipped. Use --disable-context-recovery to disable the hook in non-interactive mode.");
393393
}
394394
}
395395
}
@@ -416,12 +416,12 @@ opencode-supermemory - Persistent memory for OpenCode agents
416416
Commands:
417417
install Install and configure the plugin
418418
--no-tui Run in non-interactive mode (for LLM agents)
419-
--disable-auto-compact Disable Oh My OpenCode's auto-compact hook (use with --no-tui)
419+
--disable-context-recovery Disable Oh My OpenCode's context-window-limit-recovery hook (use with --no-tui)
420420
421421
Examples:
422422
bunx opencode-supermemory@latest install
423423
bunx opencode-supermemory@latest install --no-tui
424-
bunx opencode-supermemory@latest install --no-tui --disable-auto-compact
424+
bunx opencode-supermemory@latest install --no-tui --disable-context-recovery
425425
`);
426426
}
427427

@@ -434,13 +434,13 @@ if (args.length === 0 || args[0] === "help" || args[0] === "--help" || args[0] =
434434

435435
if (args[0] === "install") {
436436
const noTui = args.includes("--no-tui");
437-
const disableAutoCompact = args.includes("--disable-auto-compact");
437+
const disableAutoCompact = args.includes("--disable-context-recovery");
438438
install({ tui: !noTui, disableAutoCompact }).then((code) => process.exit(code));
439439
} else if (args[0] === "setup") {
440440
// Backwards compatibility
441441
console.log("Note: 'setup' is deprecated. Use 'install' instead.\n");
442442
const noTui = args.includes("--no-tui");
443-
const disableAutoCompact = args.includes("--disable-auto-compact");
443+
const disableAutoCompact = args.includes("--disable-context-recovery");
444444
install({ tui: !noTui, disableAutoCompact }).then((code) => process.exit(code));
445445
} else {
446446
console.error(`Unknown command: ${args[0]}`);

0 commit comments

Comments
 (0)