Agent Zero AI framework
Add display_version field to repo version info for non-release commits
frdel2a47410e17c1
diff --git a/helpers/self_update.py b/helpers/self_update.pyindex 4895738df..bfcf25a20 100644--- a/helpers/self_update.py+++ b/helpers/self_update.py@@ -198,6 +198,7 @@ def get_repo_version_info(repo_dir: str | Path | None = None) -> dict[str, str]:"branch": branch,"describe": describe,"short_tag": _normalize_describe_to_version(describe),+ "display_version": _format_branch_head_version(branch, describe),"commit": commit,"short_commit": commit[:7],}diff --git a/tests/test_self_update_tag_filter.py b/tests/test_self_update_tag_filter.pyindex 9d0faca63..d9671cd86 100644--- a/tests/test_self_update_tag_filter.py+++ b/tests/test_self_update_tag_filter.py@@ -296,6 +296,7 @@ def test_self_update_update_info_uses_current_branch_for_latest_version(monkeypa"branch": "main","describe": "v1.2","short_tag": "v1.2",+ "display_version": "v1.2","commit": "abc1234def","short_commit": "abc1234",},@@ -388,6 +389,7 @@ def test_self_update_frontend_uses_preloaded_select():assert "isLatestSelectorTag(value)" in contentassert "this.isSelectableTag(this.form.tag)" in contentassert "getLastStatusBadgeClass(status)" in content+ assert "this.info?.current?.display_version" in contentassert "status-pill-error" in contentassert "status-pill-success" in contentassert "this.info?.defaults?.branch ||" in content@@ -422,6 +424,7 @@ def test_self_update_modal_uses_standard_select_and_manual_backup():assert "$store.selfUpdateStore.versionSelectPlaceholder" in contentassert "$store.selfUpdateStore.higherMajorVersionMessage" in contentassert "$store.selfUpdateStore.availableTagOptions" in content+ assert "$store.selfUpdateStore.info?.current?.describe" in contentassert "current_branch_latest?.display_version" in contentassert "tagOption.label" in contentassert 'data-bs-target="#self-update-last-attempt-collapse"' in content@@ -436,6 +439,24 @@ def test_self_update_modal_uses_standard_select_and_manual_backup():assert "selectTag(tag)" not in content+def test_self_update_repo_version_info_includes_display_version_for_non_main(monkeypatch, tmp_path):+ monkeypatch.setattr(+ self_update,+ "_run_git",+ lambda repo_dir, *args: {+ ("describe", "--tags", "--always"): "v1.11-9-gf69147a",+ ("rev-parse", "HEAD"): "f69147a123456789",+ ("branch", "--show-current"): "development",+ }[args],+ )++ info = self_update.get_repo_version_info(tmp_path)++ assert info["short_tag"] == "v1.11"+ assert info["display_version"] == "v1.11+9"+ assert info["short_commit"] == "f69147a"++def test_self_update_recovery_script_and_docs_are_present():script_path = PROJECT_ROOT / "docker" / "run" / "fs" / "exe" / "trigger_self_update.sh"script_content = script_path.read_text(encoding="utf-8")diff --git a/webui/components/settings/external/self-update-modal.html b/webui/components/settings/external/self-update-modal.htmlindex 4424febb8..f158b2278 100644--- a/webui/components/settings/external/self-update-modal.html+++ b/webui/components/settings/external/self-update-modal.html@@ -23,6 +23,12 @@<code x-text="$store.selfUpdateStore.info?.current?.short_commit || 'unknown'"></code></div><div class="summary-meta" x-text="`Branch ${$store.selfUpdateStore.currentBranch || 'unknown'}`"></div>+ <template x-if="$store.selfUpdateStore.info?.current?.describe && $store.selfUpdateStore.info?.current?.describe !== $store.selfUpdateStore.info?.current?.short_tag">+ <div+ class="summary-meta"+ x-text="$store.selfUpdateStore.info?.current?.describe"+ ></div>+ </template></div><div class="self-update-summary-card">diff --git a/webui/components/settings/external/self-update-store.js b/webui/components/settings/external/self-update-store.jsindex a9b13b675..47f14bdf2 100644--- a/webui/components/settings/external/self-update-store.js+++ b/webui/components/settings/external/self-update-store.js@@ -42,7 +42,7 @@ const model = {},get currentVersion() {- return this.info?.current?.short_tag || "unknown";+ return this.info?.current?.display_version || this.info?.current?.short_tag || "unknown";},get currentBranch() {