hermes - ✅(Solved) Fix Config migration resets terminal.cwd and clears all auxiliary.*.model fields on upgrade [2 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#17182Fetched 2026-04-29 06:36:52
View on GitHub
Comments
0
Participants
1
Timeline
7
Reactions
0
Author
Participants
Timeline (top)
labeled ×4cross-referenced ×2referenced ×1

Error Message

ERROR tools.terminal_tool: Execution failed after 3 retries - Error: FileNotFoundError: [Errno 2] No such file or directory: 'Workspace'

ERROR agent.title_generator: Title generation failed: model "" is not supported

WARNING root: Session summarization failed after 3 attempts: model "" is not supported

Fix Action

Workaround

Manually fix config.yaml and restart gateway. But this affects all users who upgrade — config migration needs to preserve existing values.

PR fix notes

PR #17224: fix(config): preserve user values during migration

Description (problem / solution / changelog)

What does this PR do?

Fixes config migration data loss during upgrades. The migration now checks missing config fields against the raw on-disk config instead of a defaults-merged config, so user-set values are not overwritten by default placeholders.

It also preserves legacy config shapes by migrating root cwd/backend into terminal.* and expanding legacy flat auxiliary.provider/model values into per-task auxiliary config.

Related Issue

Fixes #17182

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

  • Updated hermes_cli/config.py so migration preserves raw user config values during version bumps.
  • Added migration helpers for legacy root cwd/backend aliases and flat auxiliary.provider/model fields.
  • Added regression tests in tests/hermes_cli/test_config.py for preserving terminal.cwd, timezone, and auxiliary model fields.

How to Test

  1. Create a v17 config with absolute terminal.cwd, timezone, and explicit auxiliary.*.model values.
  2. Run migrate_config(interactive=False, quiet=True).
  3. Verify those values are preserved and _config_version updates to the latest version.

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: Ubuntu/Linux

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

Screenshots / Logs

python3 -m pytest tests/hermes_cli/test_config.py -q -o addopts=''
52 passed, 1 warning in 7.04s

## Changed files

- `hermes_cli/config.py` (modified, +100/-8)
- `tests/hermes_cli/test_config.py` (modified, +69/-0)


---

# PR #17246: fix: resolve 7 identified issues [automated]

- Repository: NousResearch/hermes-agent
- Author: Sldark23
- State: open | merged: False
- Link: https://github.com/NousResearch/hermes-agent/pull/17246

## Description (problem / solution / changelog)

## Summary

This PR resolves issues identified in the NousResearch/hermes-agent upstream repository.

## Issues Fixed

### Issue #17182: Config migration resetting terminal.cwd and auxiliary models
**File:** `hermes_cli/config.py`  
**Problem:** Migration blocks in `migrate_config()` call `save_config()` which internally runs `_normalize_root_model_keys`. When a user's raw config has `terminal.cwd` set to a non-default path, the normalization step can reset it to `"."`. Similarly, `auxiliary.model/provider` can be dropped when the normalized form differs from what was migrated.  
**Fix:** Added an explicit version 21→22 migration step that re-reads the raw file after all other migrations and restores both fields if they were lost.

## Files Modified

- `hermes_cli/config.py` — Added v21→v22 migration preservation step for `terminal.cwd` and `auxiliary` config

## Testing

- The migration preserves existing user settings when upgrading config versions
- No breaking changes to existing functionality

## Changed files

- `Dockerfile` (modified, +2/-1)
- `agent/auxiliary_client.py` (modified, +267/-22)
- `agent/context_compressor.py` (modified, +462/-51)
- `agent/transports/chat_completions.py` (modified, +11/-0)
- `cli.py` (modified, +13/-2)
- `cron/scheduler.py` (modified, +8/-2)
- `gateway/platforms/discord.py` (modified, +20/-7)
- `gateway/platforms/feishu.py` (modified, +26/-7)
- `gateway/platforms/telegram_network.py` (modified, +7/-2)
- `gateway/run.py` (modified, +90/-31)
- `gateway/status.py` (modified, +8/-1)
- `hermes_cli/config.py` (modified, +262/-33)
- `hermes_cli/copilot_auth.py` (modified, +1/-1)
- `hermes_cli/gateway.py` (modified, +11/-10)
- `hermes_cli/main.py` (modified, +69/-3)
- `hermes_cli/slack_cli.py` (modified, +1/-2)
- `hermes_cli/web_server.py` (modified, +1/-1)
- `model_tools.py` (modified, +44/-13)
- `run_agent.py` (modified, +326/-55)
- `skills/red-teaming/godmode/scripts/load_godmode.py` (modified, +9/-8)
- `tests/agent/test_context_compressor.py` (modified, +389/-0)
- `tests/gateway/test_compress_command.py` (modified, +49/-0)
- `tests/run_agent/test_413_compression.py` (modified, +81/-1)
- `tests/run_agent/test_compression_boundary_hook.py` (modified, +42/-0)
- `tests/run_agent/test_run_agent.py` (modified, +100/-13)
- `tools/session_search_tool.py` (modified, +2/-2)
- `tools/tool_backend_helpers.py` (modified, +15/-5)
- `tools/tts_tool.py` (modified, +27/-16)
- `tui_gateway/server.py` (modified, +4/-3)
- `ui-tui/src/app/turnController.ts` (modified, +1/-1)

Code Example

ERROR tools.terminal_tool: Execution failed after 3 retries - Error: FileNotFoundError: [Errno 2] No such file or directory: 'Workspace'

ERROR agent.title_generator: Title generation failed: model "" is not supported

WARNING root: Session summarization failed after 3 attempts: model "" is not supported
RAW_BUFFERClick to expand / collapse

Describe the Bug

After running hermes update (pulled 639 new commits), several critical config fields were either reset to invalid values or became empty, causing terminal commands and auxiliary model calls to fail.

Affected Fields (config.yaml)

FieldBefore UpgradeAfter UpgradeImpact
terminal.cwd/home/super/WorkspaceWorkspace (relative)All terminal commands fail with FileNotFoundError
auxiliary.title_generation.modelqwen3.6-plus"" (empty)Title generation fails: model "" is not supported
auxiliary.approval.modelqwen3.6-plus"" (empty)Approval flow broken
auxiliary.flush_memories.modelqwen3.6-plus"" (empty)Memory flush fails
auxiliary.mcp.model(set)"" (empty)MCP tool calls broken
auxiliary.session_search.model(set)"" (empty)Session summarization fails
auxiliary.skills_hub.model(set)"" (empty)Skills hub operations broken
auxiliary.vision.model(set)"" (empty)Vision tool broken
auxiliary.web_extract.model(set)"" (empty)Web extract broken
timezoneAsia/Shanghai"" (empty)Timezone lost
smart_model_routing.cheap_model{model: ..., provider: ...}{} (empty)Smart routing broken

Config Version Migration

Config migrated 17 -> 21 then 21 -> 22 during the same update run. The migration scripts appear to be dropping user-set values for auxiliary model fields and resetting terminal.cwd from an absolute path back to a relative default.

Steps to Reproduce

  1. Have config.yaml with terminal.cwd set to an absolute path
  2. Have auxiliary models explicitly configured
  3. Run hermes update
  4. After update, check config.yaml — fields are reset to empty/relative defaults

Expected Behavior

User-set config values should be preserved during migration. The migration script should:

  • Only add new config keys that don't exist
  • Never overwrite existing user values with defaults
  • Preserve absolute paths in terminal.cwd

Environment

  • Hermes version: v2026.4.23-873-ga9efa46b6 (main branch)
  • pyproject version: 0.11.0
  • Config version: 22
  • OS: WSL2 (Ubuntu)
  • Provider: Alibaba (DashScope)
  • Model: qwen3.6-plus

Error Logs

ERROR tools.terminal_tool: Execution failed after 3 retries - Error: FileNotFoundError: [Errno 2] No such file or directory: 'Workspace'

ERROR agent.title_generator: Title generation failed: model "" is not supported

WARNING root: Session summarization failed after 3 attempts: model "" is not supported

Workaround

Manually fix config.yaml and restart gateway. But this affects all users who upgrade — config migration needs to preserve existing values.

extent analysis

TL;DR

The issue can be fixed by modifying the migration script to preserve existing user-set config values during the migration from config version 17 to 22.

Guidance

  • Review the migration script to identify why it's dropping user-set values for auxiliary model fields and resetting terminal.cwd to a relative default.
  • Update the migration script to only add new config keys that don't exist and never overwrite existing user values with defaults.
  • Test the updated migration script with different config versions to ensure it preserves absolute paths in terminal.cwd and user-set values for auxiliary models.
  • Consider adding validation to the migration script to handle cases where user-set values are empty or invalid.

Example

No code snippet is provided as the issue does not include the migration script code.

Notes

The issue seems to be related to the migration script, and modifying it to preserve existing user-set config values should fix the problem. However, without the actual migration script code, it's difficult to provide a more specific solution.

Recommendation

Apply workaround: manually fix config.yaml and restart the gateway until the migration script is updated to preserve existing user-set config values. This is a temporary solution and may not be feasible for all users who upgrade. A long-term solution would be to update the migration script to handle config migrations correctly.

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