feat(hooks): configurable save_interval via config + env var - #1345
Open
rusel95 wants to merge 1 commit into
Open
feat(hooks): configurable save_interval via config + env var#1345rusel95 wants to merge 1 commit into
rusel95 wants to merge 1 commit into
Conversation
Replaces hardcoded SAVE_INTERVAL = 15 with hooks.save_interval in config.
Config (~/.mempalace/config.json):
{"hooks": {"save_interval": 30}}
Env var (takes precedence):
MEMPALACE_HOOKS_SAVE_INTERVAL=30
MEMPALACE_HOOKS_SAVE_INTERVAL=0 # disable stop hook
Priority: env var > config file > default (15). Negative values clamped to 0.
Closes MemPalace#494.
rusel95
force-pushed
the
feat/hooks-save-interval
branch
from
May 4, 2026 11:43
4844e70 to
5fca8dc
Compare
Author
✅ End-to-end testing completedVerified against the real Tests verified:
Full suite: 0 regressions. |
marcoaperez
added a commit
to Taiko-Solutions/mempalace
that referenced
this pull request
Aug 15, 2026
…lace#1441 Upstream replaced mapfile with sed -n 'Np' specifically so these hooks run on macOS /bin/bash 3.2 (see comments in both hook files) — the exact problem our custom #!/opt/homebrew/bin/bash shebang worked around. Verified: no mapfile usage remains, both hooks pass `bash -n` under plain /bin/bash. SAVE_INTERVAL=25 override kept — upstream still hardcodes 15 with no env var, PR MemPalace#1345 never landed. Part of Proyectos/Taiko/MemPalace/18-Estrategia-Upgrade-v3.7.0.md (Pista B4). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Member
|
Thanks for this contribution, and apologies for the slow turnaround.
If you'd rather not pick it back up, no problem at all — just say so and I'll close it out, and thanks either way for taking the time to send it. |
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.
😤 The problem
The stop hook fires every 15 messages. Always. No way to change it without editing source code or uninstalling the plugin.
For long coding sessions this is fine. For a quick 3-message task it is noise. For a CI/automation context it is a blocker.
✅ What this does
Makes the interval configurable — via config file or env var:
Priority: env var > config file > default (15)
Setting
save_interval: 0disables the stop hook without uninstalling it. Negative values are clamped to 0.🔑 Key design decision
save_intervalcontrols only the stop hook. The precompact hook is independent (see PR #1346). Disabling periodic saves does not disable the last-chance save before context compression.🧪 Tests
All 104 existing hook and config tests pass.
Closes #494.