fix(plugins): make stop hook summary model configurable#524
Open
lemon-li wants to merge 1 commit intozilliztech:mainfrom
Open
fix(plugins): make stop hook summary model configurable#524lemon-li wants to merge 1 commit intozilliztech:mainfrom
lemon-li wants to merge 1 commit intozilliztech:mainfrom
Conversation
The stop hook hardcoded `--model haiku` when calling `claude -p` for session summarization. This breaks for users who cannot directly access Claude API endpoints (e.g. users in China behind proxies using ANTHROPIC_BASE_URL to route to alternative models). The project already has a [llm] config section used by compact.py, but stop.sh ignored it. Now reads model from [llm].model config, falling back to haiku when unset — fully backwards compatible, no behavior change for existing users. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
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.
Summary
--model haikuwhen callingclaude -pfor session summarizationANTHROPIC_BASE_URLto route to alternative models)[llm]config section used bycompact.py, butstop.shignored it[llm].modelconfig, falling back tohaikuwhen unsetWhy
Users in regions with restricted Claude API access often configure
ANTHROPIC_BASE_URLto route through a proxy, and may need to use a different model instead of haiku. The hardcodedhaikumade this impossible — the only workaround was to edit the hook script locally, which is fragile across updates.The
[llm]config section already exists forcompact.pysummarization. Using it here is consistent and requires no new config surface.Usage
Set the model in
~/.memsearch/config.toml:Or via CLI:
memsearch config set llm.model glm-5.1Unset = haiku (no behavior change for existing users).
Test plan
llm.modelto a non-haiku value, verifystop.shuses it → outputs configured model namellm.modelunset, verify fallback tohaikuworks → outputshaiku🤖 Generated with Claude Code