@@ -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
416416Commands:
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
421421Examples:
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
435435if ( 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