hermes - ✅(Solved) Fix Bug: /reset and /new do not reload default model from config.yaml [3 pull requests, 1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
NousResearch/hermes-agent#23131Fetched 2026-05-11 03:30:58
View on GitHub
Comments
0
Participants
1
Timeline
9
Reactions
0
Author
Participants
Timeline (top)
cross-referenced ×4labeled ×4referenced ×1

Root Cause

The new_session() method in cli.py (line ~5386) does not reinitialize self.model when creating a new session. The model is loaded once in __init__() and never reloaded.

Fix Action

Workaround

Until this is fixed, users can apply a local patch to cli.py in the new_session() method to reload the default model from config.yaml when _model_is_default is True.

PR fix notes

PR #23182: fix: reload default model from config.yaml on /reset and /new

Description (problem / solution / changelog)

Summary

Fixes #23131

  • new_session() in cli.py now re-reads the default model from config.yaml when _model_is_default is True
  • Explicit model choices via -m flag are preserved (won't be overridden)
  • Picks up mid-session config.yaml changes on /reset and /new

Root Cause

The model was loaded once in __init__ and never re-read on session reset. Users who changed models mid-session (e.g. /model gpt-5) or updated config.yaml between sessions would not see their config default restored.

Changes

  • cli.py: Added model reload from fresh load_cli_config() in new_session() when _model_is_default is True
  • tests/cli/test_cli_new_session.py: Added 2 regression tests:
    • test_reset_reloads_default_model_from_config — verifies config default is restored
    • test_reset_preserves_explicit_model — verifies explicit -m choices are kept

Test plan

  • All 8 tests in test_cli_new_session.py pass
  • Manual: set model.default: openrouter/auto in config.yaml, run hermes, change model with /model, run /reset → should revert to openrouter/auto
  • Manual: run hermes -m anthropic/claude-haiku-4-5-20251001, run /reset → model should stay claude-haiku-4-5-20251001

🤖 Generated with Claude Code

Changed files

  • cli.py (modified, +10/-0)
  • tests/cli/test_cli_new_session.py (modified, +62/-0)

PR #23262: fix(cli): reload configured default model on new session

Description (problem / solution / changelog)

What does this PR do?

This fixes #23131 with a narrow bugfix that keeps the affected path aligned with the current Hermes behavior without widening the change surface.

Related Issue

Fixes #23131

Type of Change

  • 🐛 Bug fix (non-breaking change that fixes an issue)
  • ✨ New feature (non-breaking change that adds functionality)
  • 🔒 Security fix
  • 📝 Documentation update
  • ✅ Tests (adding or improving test coverage)
  • ♻️ Refactor (no behavior change)
  • 🎯 New skill (bundled or hub)

Changes Made

  • reload model.default / model.model from config when /new or session resets rebuild the CLI session state
  • add a regression test that proves a configured default model overrides the transient startup model after new_session()
  • Files: cli.py, tests/cli/test_cli_new_session.py

How to Test

  1. Run uv run --frozen pytest -q -o addopts='' tests/cli/test_cli_new_session.py -k reloads_default_model_from_config
  2. Run uv run --frozen ruff check cli.py tests/cli/test_cli_new_session.py
  3. Confirm the affected workflow in #23131 now follows the expected behavior.

Checklist

Code

  • I've read the Contributing Guide
  • My commit messages follow Conventional Commits (fix(scope):, feat(scope):, etc.)
  • I searched for existing PRs to make sure this isn't a duplicate
  • My PR contains only changes related to this fix/feature (no unrelated commits)
  • I've run pytest tests/ -q and all tests pass
  • I've added tests for my changes (required for bug fixes, strongly encouraged for features)
  • I've tested on my platform: macOS

Documentation & Housekeeping

  • I've updated relevant documentation (README, docs/, docstrings) — or N/A
  • I've updated cli-config.yaml.example if I added/changed config keys — or N/A
  • I've updated CONTRIBUTING.md or AGENTS.md if I changed architecture or workflows — or N/A
  • I've considered cross-platform impact (Windows, macOS) per the compatibility guide — or N/A
  • I've updated tool descriptions/schemas if I changed tool behavior — or N/A

For New Skills

<!-- Not applicable. -->

Screenshots / Logs

New-session model reload regression test and Ruff checks passed locally on macOS.

Changed files

  • cli.py (modified, +18/-0)
  • tests/cli/test_cli_new_session.py (modified, +19/-0)

PR #23342: fix(cli): reload default model from config on /reset and /new

Description (problem / solution / changelog)

When a user switched models mid-session via /model, subsequent /reset or /new commands continued using the switched model instead of reverting to the config.yaml default. This reloads the default only when the original session was started without an explicit -m CLI override.

Closes #23131

Changed files

  • cli.py (modified, +15/-0)
  • scripts/release.py (modified, +1/-0)
RAW_BUFFERClick to expand / collapse

Problem

When using /reset or /new commands, Hermes does not reload the default model from config.yaml. Instead, it persists the model from the previous session.

Expected Behavior

  • Config default: openrouter/auto
  • Current model: claude-haiku-4-5-20251001
  • Execute: /reset
  • Result: Should switch to openrouter/auto

Actual Behavior

  • Config default: openrouter/auto
  • Current model: claude-haiku-4-5-20251001
  • Execute: /reset
  • Result: Still claude-haiku-4-5-20251001

Root Cause

The new_session() method in cli.py (line ~5386) does not reinitialize self.model when creating a new session. The model is loaded once in __init__() and never reloaded.

Code Location

File: cli.py Method: new_session() (line 5386) Problem: Missing model reload logic after line 5409

Affected Components

  • CLI: hermes /reset, hermes /new
  • Gateway: Telegram, Discord, Slack /reset and /new commands
  • All platforms that use the gateway

Reproduction Steps

  1. Set default model in config.yaml: model.default: openrouter/auto
  2. Start Hermes with different model: hermes -m anthropic/claude-haiku-4-5-20251001
  3. Execute /reset or /new
  4. Observe: Model is still claude-haiku-4-5-20251001
  5. Expected: Model should be openrouter/auto

Environment

  • Hermes version: v0.13.0 (2026.5.7) — confirmed
  • Branch: main (latest) — confirmed
  • Platform: Linux (amd64)
  • Python: 3.11.14

Workaround

Until this is fixed, users can apply a local patch to cli.py in the new_session() method to reload the default model from config.yaml when _model_is_default is True.

Additional Notes

  • The bug affects both CLI and all messaging gateways (Telegram, Discord, etc.)
  • The fix respects user-explicit model choices (won't override hermes -m)
  • Related to session state reset but does not affect session history preservation

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING