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(installer): handle Windows install failures correctly

cyhb096decee566
diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml
index f5df1ca61..f18f851a1 100644
--- a/.github/workflows/lint.yml
+++ b/.github/workflows/lint.yml
@@ -57,3 +57,57 @@ jobs:
tests/e2e/test_install_command.py \
tests/e2e/test_upgrade_command.py \
-v
+
+ windows-install-smoke:
+ runs-on: windows-latest
+ steps:
+ - uses: actions/checkout@v4
+
+ - uses: actions/setup-node@v4
+ with:
+ node-version: "20"
+ cache: "npm"
+ cache-dependency-path: ui/package-lock.json
+
+ - name: Build UI assets
+ working-directory: ui
+ run: |
+ npm ci
+ npm run build
+
+ - uses: actions/setup-python@v5
+ with:
+ python-version: "3.12"
+
+ - name: Install build dependencies
+ run: pip install build
+
+ - name: Build package artifact
+ run: python -m build
+
+ - name: Run Windows installer smoke test
+ shell: pwsh
+ run: |
+ $wheel = (Get-ChildItem dist\*.whl | Select-Object -First 1).FullName
+ if (-not $wheel) {
+ throw "Missing wheel artifact"
+ }
+
+ $env:VIBE_INSTALL_PACKAGE_SPEC = $wheel
+ & .\install.ps1 *>&1 | Tee-Object -FilePath install-output.log
+
+ $vibeCommand = Get-Command vibe
+ $vibeCommand | Out-String | Tee-Object -FilePath vibe-command.log
+ vibe version | Tee-Object -FilePath vibe-version.log
+
+ if (-not (Select-String -Path install-output.log -Pattern 'vibe-remote installed successfully \(from custom package spec\)' -Quiet)) {
+ throw "Installer output missing custom package success message"
+ }
+
+ if (-not $vibeCommand.Source.ToLowerInvariant().EndsWith('vibe.exe')) {
+ throw "Get-Command vibe did not resolve to vibe.exe"
+ }
+
+ if (-not (Select-String -Path vibe-version.log -Pattern 'vibe-remote ' -Quiet)) {
+ throw "vibe version output missing expected marker"
+ }
diff --git a/install.ps1 b/install.ps1
index 5e281c808..cdf023805 100644
--- a/install.ps1
+++ b/install.ps1
@@ -8,6 +8,7 @@ $ErrorActionPreference = "Stop"
# Configuration
$REPO = "cyhhao/vibe-remote"
$PACKAGE_NAME = "vibe-remote"
+$TSINGHUA_INDEX_URL = "https://pypi.tuna.tsinghua.edu.cn/simple"
function Write-Banner {
Write-Host @"
@@ -83,17 +84,97 @@ function Install-Uv {
}
}
-function Install-Vibe {
- Write-Info "Installing vibe-remote (Python will be downloaded automatically if needed)..."
-
- # uv tool install will auto-download Python if not available
+function Invoke-UvToolInstallAttempt {
+ param([string[]]$Arguments)
+
+ $hasNativeCommandPreference = $null -ne (Get-Variable -Name PSNativeCommandUseErrorActionPreference -ErrorAction SilentlyContinue)
+ if ($hasNativeCommandPreference) {
+ $originalNativeCommandPreference = $PSNativeCommandUseErrorActionPreference
+ $PSNativeCommandUseErrorActionPreference = $false
+ }
+
try {
- & uv tool install $PACKAGE_NAME --force 2>$null
+ $installOutput = (& uv tool install @Arguments 2>&1) | Out-String
+ $exitCode = $LASTEXITCODE
+ return @{
+ Success = ($exitCode -eq 0)
+ ExitCode = $exitCode
+ Output = $installOutput.Trim()
+ }
} catch {
- & uv tool install "git+https://github.com/$REPO.git" --force
+ return @{
+ Success = $false
+ ExitCode = if ($LASTEXITCODE -ne $null) { $LASTEXITCODE } else { 1 }
+ Output = ($_ | Out-String).Trim()
+ }
+ } finally {
+ if ($hasNativeCommandPreference) {
+ $PSNativeCommandUseErrorActionPreference = $originalNativeCommandPreference
+ }
}
-
- Write-Success "vibe-remote installed successfully"
+}
+
+function Install-Vibe {
+ Write-Info "Installing vibe-remote (Python will be downloaded automatically if needed)..."
+
+ $customPackageSpec = $env:VIBE_INSTALL_PACKAGE_SPEC
+
+ if ($customPackageSpec) {
+ Write-Info "Trying custom package spec..."
+ $result = Invoke-UvToolInstallAttempt -Arguments @($customPackageSpec, "--force")
+ if ($result.Success) {
+ Write-Success "vibe-remote installed successfully (from custom package spec)"
+ return
+ }
+
+ $failureMessage = "Failed to install vibe-remote from custom package spec"
+ if ($result.ExitCode -ne $null) {
+ $failureMessage += " (exit code $($result.ExitCode))"
+ }
+ if ($result.Output) {
+ $failureMessage += ":`n$($result.Output)"
+ }
+
+ Write-Error $failureMessage
+ }
+
+ $attempts = @(
+ @{
+ Name = "PyPI"
+ Arguments = @($PACKAGE_NAME, "--force", "--refresh")
+ },
+ @{
+ Name = "Tsinghua mirror"
+ Arguments = @($PACKAGE_NAME, "--force", "--refresh", "--index-url", $TSINGHUA_INDEX_URL)
+ },
+ @{
+ Name = "GitHub"
+ Arguments = @("git+https://github.com/$REPO.git", "--force")
+ }
+ )
+ $failures = @()
+
+ foreach ($attempt in $attempts) {
+ Write-Info "Trying $($attempt.Name)..."
+ $result = Invoke-UvToolInstallAttempt -Arguments $attempt.Arguments
+ if ($result.Success) {
+ Write-Success "vibe-remote installed successfully (from $($attempt.Name))"
+ return
+ }
+
+ $failureMessage = "- $($attempt.Name) failed"
+ if ($result.ExitCode -ne $null) {
+ $failureMessage += " (exit code $($result.ExitCode))"
+ }
+
+ if ($result.Output) {
+ $failureMessage += ":`n$($result.Output)"
+ }
+
+ $failures += $failureMessage
+ }
+
+ Write-Error "Failed to install vibe-remote from all sources.`n$($failures -join "`n`n")"
}
function Test-Installation {