Skip to content

armgit / avibe

Public Imported from GitHub
0

Make your computer a home for your AI partner. Avibe is the local-first Agent OS: Vibey, its built-in AI partner, works out of the box, and Claude Code, Codex & OpenCode run unchanged beside it — reach them from your browser, phone, or any chat app.

fix(upgrade): preserve uv launcher symlinks

cyh7ee1cd8deba5
diff --git a/tests/e2e/test_upgrade_command.py b/tests/e2e/test_upgrade_command.py
index 91508ed33..ce7ff0201 100644
--- a/tests/e2e/test_upgrade_command.py
+++ b/tests/e2e/test_upgrade_command.py
@@ -73,12 +73,13 @@ def test_upgrade_command_uses_built_release_artifact():
f"VIBE_UPGRADE_PACKAGE_SPEC=/fixtures/{wheel_path.name} vibe check-update",
"VIBE_UPDATE_METADATA_URL=file:///fixtures/metadata.json "
f"VIBE_UPGRADE_PACKAGE_SPEC=/fixtures/{wheel_path.name} vibe upgrade",
- 'TOOL_PY="$(uv tool dir)/vibe-remote/bin/python"',
- '"$TOOL_PY" -c "from vibe.cli import main; main()" version',
- 'VIBE_UPDATE_METADATA_URL=file:///fixtures/metadata.json "$TOOL_PY" -c "from vibe.cli import main; main()" check-update',
- '"$TOOL_PY" -c "from vibe.cli import main; main()"',
+ "hash -r",
+ 'printf "launcher=%s\n" "$(command -v vibe)"',
+ "vibe version",
+ "VIBE_UPDATE_METADATA_URL=file:///fixtures/metadata.json vibe check-update",
+ "vibe",
"sleep 2",
- '"$TOOL_PY" -c "from vibe.cli import main; main()" status',
+ "vibe status",
]
)
@@ -112,6 +113,7 @@ def test_upgrade_command_uses_built_release_artifact():
assert f"vibe-remote {INITIAL_RELEASE_VERSION}" in result.stdout
assert "New version available: 9999.0.0" in result.stdout
assert "Upgrade successful!" in result.stdout
+ assert "launcher=/usr/local/bin/vibe" in result.stdout
assert f"vibe-remote {TEST_RELEASE_VERSION}" in result.stdout
assert "You are using the latest version." in result.stdout
assert '"running": true' in result.stdout
diff --git a/tests/test_upgrade_flow.py b/tests/test_upgrade_flow.py
index a03507866..46be6f303 100644
--- a/tests/test_upgrade_flow.py
+++ b/tests/test_upgrade_flow.py
@@ -84,6 +84,18 @@ def test_get_running_vibe_path_prefers_cached_launcher(monkeypatch):
assert resolved == "/custom/bin/vibe"
+def test_get_running_vibe_path_preserves_launcher_symlink(monkeypatch):
+ monkeypatch.delenv("VIBE_CURRENT_EXECUTABLE", raising=False)
+ monkeypatch.setattr(
+ "vibe.upgrade.shutil.which",
+ lambda *args, **kwargs: "/home/test/.local/bin/vibe",
+ )
+
+ resolved = get_running_vibe_path(argv0="vibe")
+
+ assert resolved == "/home/test/.local/bin/vibe"
+
+
def test_get_restart_command_falls_back_to_python_module(monkeypatch):
monkeypatch.delenv("VIBE_CURRENT_EXECUTABLE", raising=False)
monkeypatch.setattr("vibe.upgrade.shutil.which", lambda *args, **kwargs: None)
diff --git a/vibe/upgrade.py b/vibe/upgrade.py
index 049352677..8d3712493 100644
--- a/vibe/upgrade.py
+++ b/vibe/upgrade.py
@@ -28,15 +28,15 @@ def resolve_command_path(command: str | None, search_path: str | None = None) ->
expanded = Path(command).expanduser()
if expanded.is_absolute():
- return str(expanded.resolve())
+ return os.path.abspath(str(expanded))
if any(sep in command for sep in (os.sep, "/")):
- return str((Path.cwd() / expanded).resolve())
+ return os.path.abspath(str(Path.cwd() / expanded))
resolved = shutil.which(command, path=search_path)
if not resolved:
return None
- return str(Path(resolved).expanduser().resolve())
+ return os.path.abspath(os.path.expanduser(resolved))
def get_running_vibe_path(