fix(memory): use primary model for background memory/skill review - #8351
Closed
BukeLy wants to merge 2 commits into
Closed
fix(memory): use primary model for background memory/skill review#8351BukeLy wants to merge 2 commits into
BukeLy wants to merge 2 commits into
Conversation
_spawn_background_review creates a review AIAgent with self.model and self.provider, inheriting the current turn's model. When smart model routing sends the turn to a cheap/weak model, the background review also runs on that weak model — which typically lacks the tool-calling ability needed to actually save memories or create skills. Now read the primary model config (model.default) from config.yaml for the review agent, falling back to the current model if config is unavailable. This ensures memory and skill reviews always run on the strong model that can reliably call the memory/skill_manage tools.
Verify that _spawn_background_review reads the primary model from config.yaml instead of inheriting the current turn's model, and falls back to self.model when config loading fails.
Author
|
Hi @jbarket @chalkers @leon @intertwine, |
Contributor
|
Thanks for the thoughtful PR, @BukeLy! This is a real concern, but the problem it solves no longer exists on Automated hermes-sweeper review.
Closing as already addressed on |
This was referenced Apr 28, 2026
Closed
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.
What does this PR do?
_spawn_background_reviewcreates a review AIAgent withself.modelandself.provider, inheriting the current turn's model. When smart model routing sends the turn to a cheap/weak model (e.g. a local 9B), the background review also runs on that weak model — which typically lacks the tool-calling ability needed to actually save memories or create skills.Fix: read the primary model config (
model.default,model.provider,model.base_url,model.api_key) fromconfig.yamlfor the review agent, with fallback to the current model if config is unavailable.See also: #7491 (complementary — passes
base_url/api_keyfrom parent agent; this PR goes further by reading from config since the parent may itself be a cheap routing model)Related Issue
Fixes #8517
Type of Change
Changes Made
run_agent.py: Modified_spawn_background_review→_run_reviewto read primary model fromhermes_cli.config.load_config()instead of inheritingself.modeltests/run_agent/test_background_review_model.py: New test file with 2 tests covering config-based model selection and fallback on config errorHow to Test
~/.hermes/memories/USER.md)Checklist
Code
pytest tests/ -qand all tests passDocumentation & Housekeeping