Skip to content

The agent that grows with you

test(docker): pin the non-mapping config.yaml boot path

kshitijk4poor03584e41b992
diff --git a/scripts/docker_config_migrate.py b/scripts/docker_config_migrate.py
index 9a2237f5fb3..bd111f0d0f7 100644
--- a/scripts/docker_config_migrate.py
+++ b/scripts/docker_config_migrate.py
@@ -49,9 +49,9 @@ def main() -> int:
print("[config-migrate] HERMES_SKIP_CONFIG_MIGRATION is set; skipping config migration")
return 0
- # Strict read: malformed YAML or a non-mapping root is left alone with a warning (the
- # tolerant check_config_version() already printed one) and the boot continues, instead of
- # running the backup/migrate dance that migrate_config() would refuse anyway.
+ # Strict read: malformed YAML or a non-mapping root is left alone with a warning and the
+ # boot continues, instead of running the backup/migrate dance that migrate_config() would
+ # refuse anyway.
try:
stamp, latest_ver = _read_config_version_stamp(raise_on_parse_error=True)
except InvalidUserConfigError as exc:
diff --git a/tests/tools/test_docker_config_migrate.py b/tests/tools/test_docker_config_migrate.py
index ee3cc4cb489..8bb1cad6d8b 100644
--- a/tests/tools/test_docker_config_migrate.py
+++ b/tests/tools/test_docker_config_migrate.py
@@ -117,16 +117,16 @@ def test_docker_config_migrate_stamps_unversioned_config(tmp_path: Path) -> None
assert raw["model"] == model
-def test_docker_config_migrate_does_not_rewrite_invalid_yaml(tmp_path: Path) -> None:
[email protected]("original", ["model: [unterminated\n", "- a\n- b\n"])
+def test_docker_config_migrate_does_not_rewrite_invalid_yaml(tmp_path: Path, original: str) -> None:
config_path = tmp_path / "config.yaml"
- original = "model: [unterminated\n"
config_path.write_text(original, encoding="utf-8")
proc = _run_migration(tmp_path)
assert proc.returncode == 0, proc.stderr
assert "Migrating config schema" not in proc.stdout
- assert "hermes config:" in proc.stderr
+ assert "leaving config.yaml untouched" in proc.stderr
assert config_path.read_text(encoding="utf-8") == original
assert not list(tmp_path.glob("*.bak-*"))