Skip to content

fix(install): retry herdr's download on Windows and name a failed one - #403

Merged
devswha merged 1 commit into
mainfrom
fix/windows-install-slow-download
Oct 3, 2026
Merged

devswha merged 1 commit into
mainfrom
fix/windows-install-slow-download

Conversation

@devswha

@devswha devswha commented Oct 3, 2026

Copy link
Copy Markdown
Owner

Change

On Windows, install.ps1 installs herdr with herdr's own installer when the PC has none. That installer downloads with curl.exe --speed-limit 1024 --speed-time 30, so a connection that stays under 1 KB/s for 30 seconds ends it:

curl: (28) Operation too slow. Less than 1024 bytes/sec transferred the last 30 seconds
herdr's installer did not finish. If it showed no error, security software may have stopped it: ...

The install ended on the first such failure, and the message pointed at security software although curl had named the cause.

Now a run of herdr's installer that fails with a download error (curl: (N) or herdr's Failed to download) is tried once more, and a second failure says the download failed: run again, try another network, or install herdr from herdr.dev first. A stop without a download error keeps the security-software message and is not retried.

To tell the two apart the installer's stderr is read with its output (2>&1, each line still printed as it comes), under a function-local Continue so Windows PowerShell does not end the script at curl's first stderr line.

Validation

  • scripts/windows-install.test.ps1 (CI job "Native Windows install") gets the herdr-installer path, which no test went through: on a session without herdr and with a stand-in install.cmd, a download that fails twice runs twice and is named as a download, a silent stop runs once and keeps its message, and a download that succeeds on the second try carries on.
  • "Real Windows install" runs this commit's install.ps1 with herdr's and Bun's real installers.
  • Not run locally: there is no PowerShell on the Linux PC this was written on, so these two CI jobs are the validation.

herdr's installer gives up on a download under 1 KB/s for 30 seconds. install.ps1 ended there with a message about security software; it now runs herdr's installer once more and, when the download fails again, says that the download failed.
@coderabbitai

coderabbitai Bot commented Oct 3, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

🧰 Additional context used
📚 Code guidelines (1)
CONTRIBUTING.md — configured

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: devswha/herdr-web-ui/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 77dbd69e-64d2-43df-8422-22092b006add
📥 Commits

Reviewing files that changed from the base of the PR and between 334e617 and 4e64cab.

📒 Files selected for processing (3)
  • CHANGELOG.md
  • install.ps1
  • scripts/windows-install.test.ps1

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.


📝 Summary

Summary by CodeRabbit

  • Bug Fixes
    • The Windows installer now retries once when the herdr installer encounters a download error.
    • If the retry also fails, the installer reports a download-specific error, including when a slow connection causes the download to stop.
    • Other installer failures continue to report that installation did not finish.

Walkthrough

The Windows installer now captures herdr installer output and retries once after matching download errors. It reports a download-related error if the retry fails with matching output. Tests cover retry and non-retry cases.

Changes

Windows installer retry

Layer / File(s) Summary
Capture, retry, and validate installer failures
install.ps1, scripts/windows-install.test.ps1, CHANGELOG.md
The installer captures and prints output, retries once when a nonzero exit includes a curl error or Failed to download, and reports the final failure type. Tests cover download failure, silent failure, and success on retry. The changelog describes the retry and slow-download cutoff.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~12 minutes

Change: Bug fix

Suggested reviewers: jjliebig

Merge Risk: ⚪ Minimal · up to 4e64c

The claimed exit-code scope issue does not prevent the download retry. No actionable merge-blocking risk remains after normal checks.

Architecture Summary

Architecture risk: 🔵 Low · up to 4e64c

The change affects 3 systems.

Changed systems: CHANGELOG.md, install.ps1, scripts

Architecture concerns
No architecture-level concerns identified.

Review details

Systems and components

  • observed — CHANGELOG.md (service) was modified; 1 changed file maps to changed impact.
  • observed — install.ps1 (service) was modified; 1 changed file maps to changed impact.
  • observed — scripts (service) was modified; 1 changed file maps to changed impact.

Before / after behavior

  • observed — Modified behavior in CHANGELOG.md: Added an Unreleased fix describing the Windows installer’s single download retry and its failure message when the retry fails, including the installer’s 1 KB/s-for-30-seconds cutoff.
  • observed — Modified behavior in install.ps1: Added Run-HerdrInstaller, which temporarily uses Continue error handling and merges, prints, and returns installer output lines.
  • observed — Modified behavior in install.ps1: Replaced the single Run-Tool invocation and catch with captured installer output and one retry when the exit code is nonzero and output matches a curl error or Failed to download. A remaining failure with matching output reports a download/connection error; other failures report that the installer did not finish.
  • observed — Modified behavior in scripts/windows-install.test.ps1: The test saves the original LOCALAPPDATA and USERPROFILE values for restoration.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the Windows installer change: retrying herdr downloads and reporting a failed retry.
Description check ✅ Passed The description includes both required sections. It explains the problem and resulting behavior, and lists validation coverage and the local testing limitation.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

@devswha
devswha merged commit a5ccf28 into main Oct 3, 2026
5 checks passed
@devswha
devswha deleted the fix/windows-install-slow-download branch October 3, 2026 17:17
devswha added a commit that referenced this pull request Oct 3, 2026
Bumps package.json and herdr-plugin.toml to 0.3.48, moves the Unreleased
notes under [0.3.48] - 2026-10-04 (with the PR links #403, #405 and #406
lacked), and adds the compare link. Raises the remote PC bundle to 15
(the bridge starts herdr on a stale socket, #405; `/api/worktree/create`
takes `agent`, #401): push the `remote-v15` tag and let the bundle
workflow publish before running release.yml.

Carries #393, #376, #403, #405, #402, #400, #397, #406, #401, #407,
#408.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Fable 5.1 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant