feat: add hooks.auto_save config toggle (silent mode)#711
Open
sha2fiddy wants to merge 5 commits intoMemPalace:developfrom
Open
feat: add hooks.auto_save config toggle (silent mode)#711sha2fiddy wants to merge 5 commits intoMemPalace:developfrom
sha2fiddy wants to merge 5 commits intoMemPalace:developfrom
Conversation
17 tasks
7b72200 to
2666a7b
Compare
5 tasks
2666a7b to
920f5e1
Compare
This was referenced Apr 15, 2026
f4cc33d to
496a955
Compare
c2a419c to
eace0ee
Compare
Contributor
Author
6 tasks
0de2a6e to
68d3df5
Compare
Add a clean opt-out for auto-save hook blocking (closes MemPalace#494). - New `hooks.auto_save` config option (default: true) in ~/.mempalace/config.json and MEMPALACE_HOOKS_AUTO_SAVE env var - When disabled, stop and precompact hooks pass through without blocking - Shorten block reason text from 6-line instructions to single-line prompts — reduces UI noise while keeping tool names explicit - Both Python (hooks_cli.py) and standalone shell scripts respect the toggle via config file or env var # Conflicts: # mempalace/hooks_cli.py # tests/test_hooks_cli.py
- Add parenthetical hints to block reasons so AI knows what each tool saves (session summary, quotes/decisions/code) - Remove dead config file creation from test_stop_hook_disabled_by_config - Add missing test for MEMPALACE_HOOKS_AUTO_SAVE=no env var - Replace bare except: with except Exception: in shell scripts
test_precompact_hook_enabled_by_default asserted
result["decision"] == "block", but hook_precompact has never emitted
decision — it mines synchronously and returns {}. Assertion was
copy-pasted from the stop-hook test. Fix to assert result == {} with
_mine_sync mocked so the test verifies the real contract (enabled →
mine + pass through) without actually mining.
Plus ruff format on 6 test files the CI pin flagged.
68d3df5 to
e4a8352
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #494
Summary
hooks.auto_saveconfig toggle (default:true) to cleanly disable auto-save hook blocking without uninstalling hooks~/.mempalace/config.json({"hooks": {"auto_save": false}}) orMEMPALACE_HOOKS_AUTO_SAVE=falseenv varChanges
mempalace/config.pyhooks_auto_saveproperty with env var overridemempalace/hooks_cli.pyhook_stopandhook_precompact; shortenedSTOP_BLOCK_REASONandPRECOMPACT_BLOCK_REASONhooks/mempal_save_hook.shhooks/mempal_precompact_hook.shhooks/README.mdtests/test_config.pyhooks_auto_saveproperty + env var overridestests/test_hooks_cli.pyTest plan
false,0,no,true), stop hook disabled, stop hook enabled, precompact hook disabled, precompact hook enabledMEMPALACE_HOOKS_AUTO_SAVE=false, verify stop hook passes throughhooks.auto_save: false, verify precompact hook passes through