Skip to content

Dodaios is an open-source agent OS for your desktop: it runs your coding agents, browser and apps by voice or chat, on your own machine. Formerly Personal Jarvis.

fix(install): HTTP/1.1 retry mode + resumable archive fallback for stalling networks

Ruben Lütke4f6e78897ed4
diff --git a/.agents/skills/publish-new-version/SKILL.md b/.agents/skills/publish-new-version/SKILL.md
index 0ed1a8d566..52b0c93f74 100644
--- a/.agents/skills/publish-new-version/SKILL.md
+++ b/.agents/skills/publish-new-version/SKILL.md
@@ -58,6 +58,17 @@ human review) plus the SemVer bump + git tag + CHANGELOG entry, from a separate
clone. Never raw-push the working tree; never bypass the pre-push guard with
`--no-verify`. A single privacy finding STOPS the push.
+### 2b. Resumable install asset (EVERY release)
+Upload the source archive the installers' network-fallback depends on. On
+networks where a git clone stalls (curl 28 / early EOF), both install
+scripts fall back to
+`releases/latest/download/personal-jarvis-src.tar.gz` — HTTP-range
+resumable, so even a crawling connection finishes. Build + upload:
+`git archive --format=tar.gz --prefix=personal-jarvis/ -o personal-jarvis-src.tar.gz vX.Y.Z`
+then `gh release upload vX.Y.Z personal-jarvis-src.tar.gz`. A release
+missing this asset silently degrades the fallback to the non-resumable
+snapshot for every downloader until the next release.
+
### 3. Proof (never claim success without it)
After the push, prove it is live:
- `git ls-remote https://github.com/PersonalJarvis/PersonalJarvis refs/heads/main refs/tags/vX.Y.Z`
diff --git a/.claude/skills/publish-new-version/SKILL.md b/.claude/skills/publish-new-version/SKILL.md
index 0ed1a8d566..52b0c93f74 100644
--- a/.claude/skills/publish-new-version/SKILL.md
+++ b/.claude/skills/publish-new-version/SKILL.md
@@ -58,6 +58,17 @@ human review) plus the SemVer bump + git tag + CHANGELOG entry, from a separate
clone. Never raw-push the working tree; never bypass the pre-push guard with
`--no-verify`. A single privacy finding STOPS the push.
+### 2b. Resumable install asset (EVERY release)
+Upload the source archive the installers' network-fallback depends on. On
+networks where a git clone stalls (curl 28 / early EOF), both install
+scripts fall back to
+`releases/latest/download/personal-jarvis-src.tar.gz` — HTTP-range
+resumable, so even a crawling connection finishes. Build + upload:
+`git archive --format=tar.gz --prefix=personal-jarvis/ -o personal-jarvis-src.tar.gz vX.Y.Z`
+then `gh release upload vX.Y.Z personal-jarvis-src.tar.gz`. A release
+missing this asset silently degrades the fallback to the non-resumable
+snapshot for every downloader until the next release.
+
### 3. Proof (never claim success without it)
After the push, prove it is live:
- `git ls-remote https://github.com/PersonalJarvis/PersonalJarvis refs/heads/main refs/tags/vX.Y.Z`
diff --git a/install/install.ps1 b/install/install.ps1
index 8685e55618..d3ee73a75a 100644
--- a/install/install.ps1
+++ b/install/install.ps1
@@ -552,21 +552,86 @@ function Invoke-CloneWithRetry {
Write-Note 'downloading ~80 MB - a few minutes on slow connections'
$Attempt = 1
while ($true) {
- & git @GitNetOpts clone $GitVerbosity --depth 1 --branch $Branch $RepoUrl $InstallDir
+ # Attempt 1 uses git's default transport; later attempts force
+ # HTTP/1.1 - the known cure for a family of "RPC failed; curl 28 /
+ # early EOF" aborts that only bite the bulk pack stream while small
+ # requests sail through (observed on the test Mac, 2026-07-18).
+ $HttpMode = if ($Attempt -gt 1) { @('-c', 'http.version=HTTP/1.1') } else { @() }
+ & git @GitNetOpts @HttpMode clone $GitVerbosity --depth 1 --branch $Branch $RepoUrl $InstallDir
if ($LASTEXITCODE -eq 0) { return $true }
try { Remove-Item -LiteralPath $InstallDir -Recurse -Force -ErrorAction Stop } catch {}
if ($Attempt -ge 3) {
- Write-Err 'the download kept failing (connection dropped mid-transfer).'
- Write-Note 'Check your internet connection (Wi-Fi, VPN, proxy), then re-run the'
- Write-Note 'installer - it is safe to re-run and picks up where it makes sense.'
+ Write-Note 'git could not finish the download on this network (3 attempts).'
return $false
}
$Attempt++
- Write-Note "connection dropped mid-download - retrying ($Attempt/3) ..."
+ Write-Note "connection dropped mid-download - retrying ($Attempt/3, compatibility transfer mode) ..."
Start-Sleep -Seconds 3
}
}
+# Last-resort transport when git cannot get the pack through AT ALL: a plain
+# HTTPS archive download. The release asset (uploaded per release) supports
+# HTTP ranges, so curl -C - RESUMES after every disconnect - even a crawling
+# connection eventually finishes, which a restarted git clone never does.
+# Falls back to the branch snapshot (codeload, not resumable) when no release
+# asset is reachable. The tree lands WITHOUT .git metadata; the next installer
+# run detects that and repairs it in place (salvage path), so updates keep
+# working. Windows 10+ ships both curl.exe and tar.exe.
+function Invoke-TarballFallback {
+ if (-not (Get-Command curl.exe -ErrorAction SilentlyContinue)) { return $false }
+ if (-not (Get-Command tar.exe -ErrorAction SilentlyContinue)) { return $false }
+ if ($RepoUrl -notmatch 'github\.com/') { return $false }
+ $RepoPath = ($RepoUrl -split 'github\.com/', 2)[1] -replace '\.git$', ''
+ $AssetUrl = "https://github.com/$RepoPath/releases/latest/download/personal-jarvis-src.tar.gz"
+ $SnapshotUrl = "https://codeload.github.com/$RepoPath/tar.gz/refs/heads/$Branch"
+ if ($env:JARVIS_PAYLOAD_COMMIT) {
+ # A verified install is pinned to ONE signed commit; the "latest"
+ # release asset cannot honor that pin, so go straight to the
+ # commit-addressed snapshot - the URL itself names the exact tree.
+ $AssetUrl = ''
+ $SnapshotUrl = "https://codeload.github.com/$RepoPath/tar.gz/$($env:JARVIS_PAYLOAD_COMMIT)"
+ }
+ $Tmp = "$InstallDir.payload.tar.gz"
+ Write-Note 'git transfer keeps stalling on this network - switching to a resumable archive download'
+ $Got = $false
+ $Try = 1
+ while ($AssetUrl -and $Try -le 8) {
+ & curl.exe -fL --speed-limit 1024 --speed-time 60 -C - -o $Tmp $AssetUrl
+ if ($LASTEXITCODE -eq 0) { $Got = $true; break }
+ if ($LASTEXITCODE -eq 22) { break } # HTTP error (e.g. asset missing): not retryable
+ Write-Note "archive download interrupted - resuming where it stopped ($Try/8) ..."
+ $Try++
+ Start-Sleep -Seconds 3
+ }
+ if (-not $Got) {
+ try { Remove-Item -LiteralPath $Tmp -Force -ErrorAction Stop } catch {}
+ Write-Note 'no resumable release archive reachable - trying the direct snapshot (single stream)'
+ & curl.exe -fL --speed-limit 1024 --speed-time 60 -o $Tmp $SnapshotUrl
+ if ($LASTEXITCODE -ne 0) {
+ try { Remove-Item -LiteralPath $Tmp -Force -ErrorAction Stop } catch {}
+ return $false
+ }
+ }
+ try { Remove-Item -LiteralPath $InstallDir -Recurse -Force -ErrorAction Stop } catch {}
+ New-Item -ItemType Directory -Force -Path $InstallDir | Out-Null
+ & tar.exe -xzf $Tmp -C $InstallDir --strip-components=1
+ $TarOk = ($LASTEXITCODE -eq 0)
+ try { Remove-Item -LiteralPath $Tmp -Force -ErrorAction Stop } catch {}
+ if (-not $TarOk) { return $false }
+ Write-Note 'installed from the release archive (git metadata is repaired on a future update)'
+ return $true
+}
+
+function Invoke-FetchPayload {
+ if (Invoke-CloneWithRetry) { return $true }
+ if (Invoke-TarballFallback) { return $true }
+ Write-Err 'the download kept failing (connection dropped mid-transfer).'
+ Write-Note 'Check your internet connection (Wi-Fi, VPN, proxy), then re-run the'
+ Write-Note 'installer - it is safe to re-run and picks up where it makes sense.'
+ return $false
+}
+
# Self-heal a broken install dir (leftover non-git folder from an earlier or
# aborted install, or a checkout whose git state no longer updates): keep the
# old tree as a timestamped sibling backup - never delete - clone fresh, then
@@ -582,7 +647,7 @@ function Invoke-SalvageReclone {
exit 1
}
Write-Note "moved the old directory to $StaleBackup (nothing was deleted)"
- if (-not (Invoke-CloneWithRetry)) { exit 1 }
+ if (-not (Invoke-FetchPayload)) { exit 1 }
foreach ($Item in @('data', 'jarvis.toml', '.env')) {
$Old = Join-Path $StaleBackup $Item
$New = Join-Path $InstallDir $Item
@@ -624,7 +689,7 @@ if (Test-Path (Join-Path $InstallDir '.git')) {
Write-Note "$InstallDir exists but is not a git repo (leftover from an earlier install) - reinstalling in place."
Invoke-SalvageReclone
} else {
- if (-not (Invoke-CloneWithRetry)) { exit 1 }
+ if (-not (Invoke-FetchPayload)) { exit 1 }
Write-Ok 'downloaded'
}
}
@@ -642,6 +707,16 @@ if ($env:JARVIS_PAYLOAD_COMMIT) {
Write-Err "JARVIS_PAYLOAD_COMMIT is not a well-formed git SHA: '$PayloadCommit' - refusing."
exit 1
}
+ if (-not (Test-Path (Join-Path $InstallDir '.git'))) {
+ # Tarball-fallback install: the tree was fetched from the commit-
+ # addressed archive URL, so the pin is embedded in the download
+ # itself; there are no git objects to re-verify against.
+ Write-Ok "pinned via commit-addressed archive ($($PayloadCommit.Substring(0,12)))"
+ $PinnedViaArchive = $true
+ } else {
+ $PinnedViaArchive = $false
+ }
+ if (-not $PinnedViaArchive) {
Push-Location $InstallDir
try {
# Shallow clones don't carry full history; deepen to retrieve the
@@ -669,6 +744,7 @@ if ($env:JARVIS_PAYLOAD_COMMIT) {
} finally {
Pop-Location
}
+ }
}
# ----------------------------------------------------------------- venv + bootstrap deps
diff --git a/install/install.sh b/install/install.sh
index 178566aa6e..e03d88491e 100755
--- a/install/install.sh
+++ b/install/install.sh
@@ -877,23 +877,98 @@ clone_with_retry() {
note 'downloading ~80 MB - a few minutes on slow connections'
_attempt=1
while :; do
- # shellcheck disable=SC2086 # GIT_NET_OPTS must word-split into -c pairs
- if git $GIT_NET_OPTS clone "$GIT_VERBOSITY" --depth 1 --branch "$BRANCH" "$REPO_URL" "$INSTALL_DIR"; then
+ # Attempt 1 uses git's default transport; later attempts force
+ # HTTP/1.1 - the known cure for a family of "RPC failed; curl 28 /
+ # early EOF" aborts that only bite the bulk pack stream while small
+ # requests sail through (observed on the test Mac, 2026-07-18).
+ _http_mode=''
+ [ "$_attempt" -gt 1 ] && _http_mode='-c http.version=HTTP/1.1'
+ # shellcheck disable=SC2086 # GIT_NET_OPTS/_http_mode word-split into -c pairs
+ if git $GIT_NET_OPTS $_http_mode clone "$GIT_VERBOSITY" --depth 1 --branch "$BRANCH" "$REPO_URL" "$INSTALL_DIR"; then
return 0
fi
rm -rf "$INSTALL_DIR" 2>/dev/null || true
if [ "$_attempt" -ge 3 ]; then
- err 'the download kept failing (connection dropped mid-transfer).'
- note 'Check your internet connection (Wi-Fi, VPN, proxy), then re-run the'
- note 'installer - it is safe to re-run and picks up where it makes sense.'
+ note 'git could not finish the download on this network (3 attempts).'
return 1
fi
_attempt=$((_attempt + 1))
- note "connection dropped mid-download - retrying ($_attempt/3) ..."
+ note "connection dropped mid-download - retrying ($_attempt/3, compatibility transfer mode) ..."
sleep 3
done
}
+# Last-resort transport when git cannot get the pack through AT ALL: a plain
+# HTTPS archive download. The release asset (uploaded per release) supports
+# HTTP ranges, so `curl -C -` RESUMES after every disconnect - even a
+# crawling connection eventually finishes, which a restarted git clone never
+# does. Falls back to the branch snapshot (codeload, not resumable) when no
+# release asset is reachable. The tree lands WITHOUT .git metadata; the next
+# installer run detects that and repairs it in place (salvage path), so
+# updates keep working.
+tarball_fallback() {
+ command -v curl >/dev/null 2>&1 || return 1
+ command -v tar >/dev/null 2>&1 || return 1
+ case "$REPO_URL" in
+ *github.com/*) ;;
+ *) return 1 ;;
+ esac
+ _repo_path="${REPO_URL#*github.com/}"
+ _repo_path="${_repo_path%.git}"
+ _asset_url="https://github.com/$_repo_path/releases/latest/download/personal-jarvis-src.tar.gz"
+ _snapshot_url="https://codeload.github.com/$_repo_path/tar.gz/refs/heads/$BRANCH"
+ if [ -n "${JARVIS_PAYLOAD_COMMIT:-}" ]; then
+ # A verified install is pinned to ONE signed commit; the "latest"
+ # release asset cannot honor that pin, so go straight to the
+ # commit-addressed snapshot - the URL itself names the exact tree.
+ _asset_url=''
+ _snapshot_url="https://codeload.github.com/$_repo_path/tar.gz/$JARVIS_PAYLOAD_COMMIT"
+ fi
+ _tmp="${INSTALL_DIR%/}.payload.tar.gz"
+ note 'git transfer keeps stalling on this network - switching to a resumable archive download'
+ _got=''
+ _try=1
+ while [ -n "$_asset_url" ] && [ "$_try" -le 8 ]; do
+ if curl -fL --speed-limit 1024 --speed-time 60 -C - -o "$_tmp" "$_asset_url"; then
+ _got=1
+ break
+ fi
+ _rc=$?
+ # 22 = HTTP error (e.g. asset missing on old releases): not retryable.
+ [ "$_rc" -eq 22 ] && break
+ note "archive download interrupted - resuming where it stopped ($_try/8) ..."
+ _try=$((_try + 1))
+ sleep 3
+ done
+ if [ -z "$_got" ]; then
+ rm -f "$_tmp" 2>/dev/null || true
+ note 'no resumable release archive reachable - trying the direct snapshot (single stream)'
+ curl -fL --speed-limit 1024 --speed-time 60 -o "$_tmp" "$_snapshot_url" || {
+ rm -f "$_tmp" 2>/dev/null || true
+ return 1
+ }
+ fi
+ rm -rf "$INSTALL_DIR" 2>/dev/null || true
+ mkdir -p "$INSTALL_DIR"
+ if ! tar -xzf "$_tmp" -C "$INSTALL_DIR" --strip-components=1; then
+ rm -f "$_tmp" 2>/dev/null || true
+ return 1
+ fi
+ rm -f "$_tmp" 2>/dev/null || true
+ note 'installed from the release archive (git metadata is repaired on a future update)'
+ return 0
+}
+
+fetch_payload() {
+ if clone_with_retry || tarball_fallback; then
+ return 0
+ fi
+ err 'the download kept failing (connection dropped mid-transfer).'
+ note 'Check your internet connection (Wi-Fi, VPN, proxy), then re-run the'
+ note 'installer - it is safe to re-run and picks up where it makes sense.'
+ return 1
+}
+
# Self-heal a broken install dir (leftover non-git folder from an earlier or
# aborted install, or a checkout whose git state no longer updates): keep the
# old tree as a timestamped sibling backup — never delete — clone fresh, then
@@ -908,7 +983,7 @@ salvage_reclone() {
exit 1
fi
note "moved the old directory to $stale_backup (nothing was deleted)"
- clone_with_retry || exit 1
+ fetch_payload || exit 1
local item
for item in data jarvis.toml .env; do
if [ -e "$stale_backup/$item" ] && [ ! -e "$INSTALL_DIR/$item" ]; then
@@ -934,7 +1009,7 @@ elif [ -e "$INSTALL_DIR" ]; then
note "$INSTALL_DIR exists but is not a git repo (leftover from an earlier install) - reinstalling in place."
salvage_reclone
else
- clone_with_retry || exit 1
+ fetch_payload || exit 1
ok 'downloaded'
fi
@@ -950,6 +1025,12 @@ if [ -n "${JARVIS_PAYLOAD_COMMIT:-}" ]; then
err "JARVIS_PAYLOAD_COMMIT is not a well-formed git SHA: '$JARVIS_PAYLOAD_COMMIT' — refusing."
exit 1
fi
+ if [ ! -d "$INSTALL_DIR/.git" ]; then
+ # Tarball-fallback install: the tree was fetched from the commit-
+ # addressed archive URL, so the pin is embedded in the download
+ # itself; there are no git objects to re-verify against.
+ ok "pinned via commit-addressed archive (${JARVIS_PAYLOAD_COMMIT%"${JARVIS_PAYLOAD_COMMIT#????????????}"}…)"
+ else
# Shallow clones don't carry the full history; deepen to retrieve the
# target SHA explicitly. `fetch <sha>` succeeds on most modern
# github.com hosts (allowReachableSHA1InWant + uploadpack.allowAnySHA1InWant
@@ -968,7 +1049,8 @@ if [ -n "${JARVIS_PAYLOAD_COMMIT:-}" ]; then
err "HEAD drift detected: pinned=${JARVIS_PAYLOAD_COMMIT}, actual=${ACTUAL_HEAD} — refusing."
exit 1
fi
- ok "pinned to signed commit ${JARVIS_PAYLOAD_COMMIT:0:12}…"
+ ok "pinned to signed commit ${JARVIS_PAYLOAD_COMMIT:0:12}…"
+ fi
fi
# -------------------------------------------------------------- venv + bootstrap deps