Skip to content

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

Draft
DragunovX16 wants to merge 3 commits into
NousResearch:mainfrom
DragunovX16:fix/17182-config-migration-preserve-values
Draft

fix(config): preserve user values during migration#17224
DragunovX16 wants to merge 3 commits into
NousResearch:mainfrom
DragunovX16:fix/17182-config-migration-preserve-values

Conversation

@DragunovX16

@DragunovX16 DragunovX16 commented Apr 29, 2026

Copy link
Copy Markdown

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

@DragunovX16

Copy link
Copy Markdown
Author

@teknium1 Please review my PR

@alt-glitch alt-glitch added type/bug Something isn't working P1 High — major feature broken, no workaround area/config Config system, migrations, profiles comp/cli CLI entry point, hermes_cli/, setup wizard labels Apr 29, 2026
@DragunovX16 DragunovX16 marked this pull request as draft April 29, 2026 18:43
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/cli CLI entry point, hermes_cli/, setup wizard P1 High — major feature broken, no workaround type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Config migration resets terminal.cwd and clears all auxiliary.*.model fields on upgrade

2 participants