hermes - 💡(How to fix) Fix [Bug]: Gateway /model without --global does not persist, leaves remote users stuck with stale defaults

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…

Root Cause

gateway/run.py line ~10149:

# Persist to config if --global
if persist_global:
    # ... writes to config.yaml

Without --global, the switch is stored only as _session_model_overrides[session_key] (ephemeral), and never written to config.yaml.

Code Example

# Persist to config if --global
if persist_global:
    # ... writes to config.yaml

---

Switched to deepseek-v4-pro (session only — use `/model --global` to make it permanent)
RAW_BUFFERClick to expand / collapse

Bug Description

When using Hermes through a messaging gateway (Feishu, Telegram, Discord, etc.), running /model deepseek-v4-pro successfully switches the model for the current session, but does not persist the change to ~/.hermes/config.yaml. After hermes gateway restart, the model reverts to the old model.default.

This is especially problematic for remote/gateway users who:

  • Don't have terminal access at that moment
  • Can't run hermes model or hermes config set
  • Expect /model to behave like a remote model management command

Root Cause

gateway/run.py line ~10149:

# Persist to config if --global
if persist_global:
    # ... writes to config.yaml

Without --global, the switch is stored only as _session_model_overrides[session_key] (ephemeral), and never written to config.yaml.

Steps to Reproduce

  1. Run Hermes gateway connected to Feishu
  2. In Feishu, execute /model deepseek-v4-pro
  3. Wait for confirmation ("Switched to deepseek-v4-pro")
  4. Run hermes gateway restart
  5. Check model.default in config.yaml — still shows the old model

Expected Behavior

Gateway /model without --global should either:

  • Option A: Default to persisting the change (since remote users cannot easily access config.yaml), matching the CLI behavior of hermes model
  • Option B: Clearly communicate that the switch is session-only and suggest /model --global for persistent changes

Actual Behavior

The switch silently applies only to the current session. After a gateway restart, the old model returns with no warning.

Environment

  • Hermes Agent version: latest (git-installed)
  • Platform: macOS 26.5 + Feishu
  • The user discovered this after a gateway restart reverted DeepSeek V4 Pro back to GLM-5.1, and GLM-5.1's API was out of balance (HTTP 429), causing the agent to become unresponsive for several minutes.

Related Issues

  • #25107 — Gateway /model switch leaves stale base_url and does not persist api_mode (even with --global, persistence is incomplete)
  • #28034 — /model --global does not persist when using the visual model picker (CLI-specific)

Suggested Fix

Either make /model always persist in gateway context (since the user is remote), or add a note in the confirmation message like:

Switched to deepseek-v4-pro (session only — use `/model --global` to make it permanent)

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

hermes - 💡(How to fix) Fix [Bug]: Gateway /model without --global does not persist, leaves remote users stuck with stale defaults