Skip to content

Add configurable models for memory and skill background reviews - #13647

Closed
gregoryschlepper wants to merge 1 commit into
NousResearch:mainfrom
gregoryschlepper:feat/review-model-routing
Closed

Add configurable models for memory and skill background reviews#13647
gregoryschlepper wants to merge 1 commit into
NousResearch:mainfrom
gregoryschlepper:feat/review-model-routing

Conversation

@gregoryschlepper

Copy link
Copy Markdown

Adds optional memory.review.* and skills.review.* overrides so background reviews can use a different model/provider than the main agent. Default behavior remains unchanged.

@gregoryschlepper

Copy link
Copy Markdown
Author

This PR addresses the first half of the review-cost problem.

What is already concretely improved:

  • background review can be routed to a cheaper review model instead of always inheriting the main model

What is not yet instrumented:

  • exact before/after token usage
  • exact latency deltas
  • exact 429 reduction

Those likely improve as a consequence, but I am intentionally not overstating that without dedicated review-level telemetry.

I split the optimization work so review-model selection and review-size reduction can be discussed independently.

@alt-glitch alt-glitch added type/feature New feature or request comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint comp/cli CLI entry point, hermes_cli/, setup wizard area/config Config system, migrations, profiles labels Apr 21, 2026
@gregoryschlepper

Copy link
Copy Markdown
Author

Follow-up note: I also did a static verification pass on the current live branch version of this change.

What is statically confirmed:

  • memory.review / skills.review are loaded inside _spawn_background_review
  • the effective review runtime values are derived into eff_model, eff_provider, eff_base, and eff_key
  • the review agent is instantiated with AIAgent(model=eff_model, provider=eff_provider, base_url=eff_base, api_key=eff_key, ...)
  • there is no separate dedicated override later in the review path that resets the review agent back to self.model

So code-wise, the override path is wired through as intended.

What is still not separately instrumented:

  • dedicated runtime telemetry for review-only model usage / token accounting

@teknium1

Copy link
Copy Markdown
Contributor

Thanks for the focused work on lowering background-review cost. This automated hermes-sweeper review found that current main already provides the requested behavior through the shared auxiliary-task configuration surface.

  • 87c4a5ebb8a9f8122197a908288cc0abc7cef6b0 (feat(background-review): aux-model selector for the self-improvement review, feat(background-review): aux-model routing + context digest + adaptive cadence to cut self-improvement cost #49252) added auxiliary.background_review as the canonical review-routing slot.
  • hermes_cli/config.py:1712 defines provider, model, base URL, API key, and timeout settings; unset/auto retains the main-model behavior.
  • agent/background_review.py:46 resolves the configured review runtime, and agent/background_review.py:663 constructs the review agent with the resolved model/provider/credentials.
  • tests/run_agent/test_background_review_cost_controls.py:1 covers the configured-routing and fallback behavior.

This supersedes the memory.review / skills.review implementation proposed here, so closing as implemented on main.

@teknium1 teknium1 closed this Jul 12, 2026
@teknium1 teknium1 added the sweeper:implemented-on-main Sweeper: behavior already present on current main label Jul 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/config Config system, migrations, profiles comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint comp/cli CLI entry point, hermes_cli/, setup wizard sweeper:implemented-on-main Sweeper: behavior already present on current main type/feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants