Skip to content

feat(update): show download progress and abort only stalled downloads - #15382

Open
ealeksandrov wants to merge 4 commits into
can1357:mainfrom
ealeksandrov:EA/update-download-progress
Open

ealeksandrov wants to merge 4 commits into
can1357:mainfrom
ealeksandrov:EA/update-download-progress

Conversation

@ealeksandrov

@ealeksandrov ealeksandrov commented Oct 11, 2026 •

Copy link
Copy Markdown

What

downloadVerifiedBinary (used for both full and patch downloads) now:

  • shows a single, in-place progress line on a TTY: 42.1MB / 180.3MB (23%), 1.2MB/s, 1m50s left. Non-TTY output is unchanged.
  • replaces the 15-minute deadline on the whole transfer with a stall timeout. The download aborts only when no bytes arrive for 60 seconds (Download stalled: no data received for 60 seconds). A slow but steady connection can now finish.

The stale-temp sweep used to rely on that 15-minute deadline: a .new/.patch temp older than it could not belong to a live download. Without a total limit that no longer holds, and on Windows a file's mtime may not change until its writer closes it. The sweep now also spares any temp whose updater pid (already in the file name) is still running, via procmgr.isPidRunning. The 15-minute age rule still applies to temps whose updater has exited, and to legacy names.

Why

On my network omp update printed Downloading omp-darwin-arm64… and nothing else for a long time, then in some cases failed with Timed out downloading release binary after 15 minutes. It's both annoying to never see any progress and wait for a very long timeout when target download is completely inaccessible.

Fixes #9499. Supersedes #9570, which no longer applies to main after the build-service/patch rewrite of the update path.

Testing

  • End to end: built the binary from this branch (bun run build), copied it to a scratch directory first on PATH, and ran omp update --force (the branch reports the current release, 18.9.1). In a terminal the progress line updated in place through 197.7MB, then the build verified, installed and passed the version check. With output piped, the run printed the same lines as before this change and no progress.
  • Smoke test against a local, throttled Bun server through real fetch: when the server stops sending halfway, the download aborts after about 62 seconds with the stall message and removes the partial file.
  • Ran the same throttled download in a 40-column PTY: every progress frame is cut to 39 columns, so the line never wraps and each redraw replaces the previous one.
  • bun test test/update-cli.test.ts: two fake-timer tests replace the old body-timeout test. A download receiving one byte every 20 seconds for minutes completes; a body that stops sending aborts after 60 seconds and leaves no file. Removing the stallTimer.refresh() call makes the first test fail. The sweep test now uses a pid that has exited for its orphaned temps (the old hard-coded 4242 could be a live process) and checks that an old temp owned by a running process survives. One unrelated test (overrides per-tool release age during actual mise upgrade resolution) fails on unmodified main in my environment too, because the local mise cannot resolve the github: tool.
  • bun check passes (TypeScript and Rust).

  • bun check passes
  • Tested locally
  • CHANGELOG updated with the required attribution (if user-facing; internal issue fixes use issue links, external contributions add the PR link and contributor credit after creation)

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 11, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-11T15:48:40.986409Z 12e8e03 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@roboomp roboomp added cli CLI commands and arguments feat review:p2 triaged ux User experience improvements labels Oct 11, 2026

@roboomp roboomp left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 — terminal progress addresses #9499, but replacing the 15-minute total deadline with an unbounded transfer and 60-second stall timeout needs maintainer sign-off for full and patch downloads.
Should-fix: add external contributor credit and the PR link to the new packages/coding-agent/CHANGELOG.md:9 entry.
Verification: targeted update tests could not start in this checkout because src/export/html/tool-views.generated.js is missing. Maintainer: is the stall-only timeout policy acceptable? Thanks @ealeksandrov.

Comment thread packages/coding-agent/CHANGELOG.md

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 7a37c12a20

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/coding-agent/src/cli/update-cli.ts Outdated
@ealeksandrov
ealeksandrov requested a review from roboomp October 11, 2026 15:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cli CLI commands and arguments feat review:p2 triaged ux User experience improvements

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(update): show progress while downloading release binaries

2 participants