The agent that grows with you
Python aiai-agentai-agentsanthropicchatgptclaudeclaude-codecodexhermeshermes-agentllmnous-researchopenai
fix(version): retain tagless derived display identity
funky-xamarinb41792c41b66
diff --git a/hermes_cli/version_info.py b/hermes_cli/version_info.pyindex e7298fc0c2f..dd90971bb18 100644--- a/hermes_cli/version_info.py+++ b/hermes_cli/version_info.py@@ -36,8 +36,11 @@ class VersionInfo:@propertydef display_version(self) -> str:- """``<base>+<distance>``: the short form surfaces label a version by.- The commit is shown beside it where there is room, never inside it."""+ """``<base>+<distance>`` when a release is known, else the derived identity.+ Keep a tagless checkout's ``git.<sha>`` rather than reducing it to unknown.+ """+ if self.base_version == "unknown":+ return self.derived_versionreturn _derived_version(self.base_version, self.distance)diff --git a/tests/hermes_cli/test_version_info.py b/tests/hermes_cli/test_version_info.pyindex 611fe54a278..c0dddeda20f 100644--- a/tests/hermes_cli/test_version_info.py+++ b/tests/hermes_cli/test_version_info.py@@ -31,6 +31,31 @@ def test_display_version_names_the_distance_without_the_commit():assert VersionInfo("0.21.5", "0.21.5", 0, None, None, "git").display_version == "0.21.5"+def test_display_version_keeps_tagless_stamp_identity(tmp_path, monkeypatch):+ stamp = {+ "commit": "a" * 40,+ "baseVersion": "unknown",+ "displayVersion": "git.aaaaaaa",+ "source": "git",+ "payload": "bootstrap",+ "updateMechanism": "self",+ }+ stamp_file = tmp_path / "install-stamp.json"+ stamp_file.write_text(json.dumps(stamp), encoding="utf-8")+ monkeypatch.setattr("hermes_cli.version_info._resolve_stamp_file", lambda: stamp_file)++ info = get_version_info()++ assert info.base_version == "unknown"+ assert info.display_version == stamp["displayVersion"]+ assert info.commit == stamp["commit"]+++def test_display_version_keeps_unknown_when_no_identity():+ info = VersionInfo("unknown", "unknown", None, None, None, "unknown")+ assert info.display_version == "unknown"++def test_stamp_version_info_reads_nix_stamp(tmp_path, monkeypatch):stamp = {"schemaVersion": 2,