Skip to content

fix(cli): say a download is starting, not queued, and what --list-files waits for - #624

Merged
linroid merged 1 commit into
mainfrom
fix/cli-starting-state
Oct 23, 2026
Merged

linroid merged 1 commit into
mainfrom
fix/cli-starting-state

Conversation

@linroid

@linroid linroid commented Oct 23, 2026

Copy link
Copy Markdown
Owner

Found while downloading magnets with the CLI.

1. "[Queued] Waiting for download slot..." during a magnet's metadata lookup

ketch 'magnet:?xt=urn:btih:…'
[Queued] Waiting for download slot...        # for minutes, with no other download running

While a task gets ready (a magnet looking for its metadata, or any download resolving), Ketch reports it as Queued without a queue position. The apps already show this as "Starting" / "Finding peers" (DownloadState.isStarting). The CLI printed the same "waiting for a slot" line for every queued state, which sends users looking for a concurrency problem that doesn't exist.

Now ProgressPrinter also follows task.queuePosition:

State Before After
Queued, no position, magnet [Queued] Waiting for download slot... [Starting] Finding peers that have the torrent's metadata...
Queued, no position, other [Queued] Waiting for download slot... [Starting] Getting ready...
Queued at #2 [Queued] Waiting for download slot... [Queued] Waiting for download slot (#2)...

2. --list-files was silent while resolving

ketch --list-files <magnet> printed nothing until peers sent the metadata, which may be never. After 3 s it now writes to stderr Finding peers that have the torrent's metadata (Ctrl+C to stop)..., or Still looking up the files (Ctrl+C to stop)... for other links. Fast resolves print nothing extra.

Verification

  • ketch from this branch on a magnet with no peers prints the [Starting] Finding peers… line, and --list-files the notice after 3 s. An HTTP download prints [Starting] Getting ready... and then its progress.
  • New DownloadCommandTest cases: progressPrinter_queuedWithoutPosition_saysItIsStarting and listFiles_slowResolve_saysWhatItWaitsFor (the notice delay is a listFiles parameter, so the test takes milliseconds).
  • ./gradlew :cli:test --tests '*DownloadCommandTest*' passes.

…es waits for

`ketch <magnet>` printed "[Queued] Waiting for download slot..." for the
whole metadata lookup, minutes for a rare torrent, though no slot was
taken: Ketch reports a task getting ready as queued, without a queue
position, which the apps already show as starting. The CLI now prints
"[Starting] Finding peers that have the torrent's metadata..." for a
magnet, "[Starting] Getting ready..." otherwise, and the position of a
download that does wait for a slot.

`ketch --list-files <magnet>` printed nothing at all while it waited;
after three seconds it now says what for.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 23, 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-23T16:15:34.732968Z 2ccffcb PR opened
ℹ️ 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.

@claude

claude Bot commented Oct 23, 2026

Copy link
Copy Markdown

Code review

No issues found. Checked for bugs and CLAUDE.md compliance.

@github-actions

Copy link
Copy Markdown
Contributor

Test Results

 2 199 files  ±0   2 227 suites  ±0   58m 25s ⏱️ + 1m 34s
15 321 tests +2  15 053 ✅ +2  268 💤 ±0  0 ❌ ±0 
18 678 runs  +2  18 410 ✅ +2  268 💤 ±0  0 ❌ ±0 

Results for commit 2ccffcb. ± Comparison against base commit c7c6457.

@linroid
linroid merged commit 884208d into main Oct 23, 2026
15 checks passed
@linroid
linroid deleted the fix/cli-starting-state branch October 23, 2026 17:04
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