Skip to content

fix: retry transient HTTP statuses and show friendly download errors#432

Draft
bigcat88 wants to merge 1 commit intomainfrom
fix/download-errors-and-progress
Draft

fix: retry transient HTTP statuses and show friendly download errors#432
bigcat88 wants to merge 1 commit intomainfrom
fix/download-errors-and-progress

Conversation

@bigcat88
Copy link
Copy Markdown
Contributor

@bigcat88 bigcat88 commented Apr 15, 2026

Summary

Fixes #430.

Three focused changes that together address the bug report (visual glitches + verbose tracebacks when pasting many comfy model download commands into a shell):

  • Retry transient HTTP statuses. _download_file_httpx now raises a private _TransientHTTPStatusError for statuses in {408, 429, 500, 502, 503, 504}, which the existing retry loop catches alongside network-level errors. CivitAI CDN blips and other transient server errors can now self-heal instead of aborting the download on the first attempt.
  • Friendly error rendering. comfy model download catches DownloadException and prints a one-line red error before exiting with code 1, replacing the previous ~100-line Rich-panel Python traceback. comfy node install catches it the same way, using the existing ui.display_error_message path.
  • Transient progress bars. ui.show_progress and _poll_aria2_download now use transient=True, so each progress bar is erased when its download completes. Running many comfy model download commands in sequence no longer leaves 30 persistent bars stacked in the terminal.

Notes / follow-ups

  • Retry-After header on 429 responses is not honored; fixed 2 s / 4 s backoff is used. Worth a follow-up if we see CivitAI or similar providers sending it.
  • HuggingFace downloads (huggingface_hub.hf_hub_download) are not touched — they have their own error semantics.
  • A pre-existing raise DownloadException("Filename cannot be empty") at comfy_cli/command/models/models.py:315 still produces a traceback because it sits above the new try/except; unrelated to [Potential bug] Visual glitches and error #430 and can be cleaned up separately.

- HTTP 408/429/500/502/503/504 are now retried (up to 3 attempts with
  backoff) rather than failing immediately. Transient server-side errors
  can now self-heal instead of aborting the download.
- DownloadException raised from comfy model download is rendered as a
  one-line red error with exit code 1, instead of a full Rich-panel
  Python traceback. comfy node install uses the existing
  display_error_message path.
- Download progress bars now use transient=True so they disappear when
  the download completes. Running many downloads in sequence no longer
  leaves a stack of persistent bars.

Signed-off-by: Alexander Piskun <bigcat88@icloud.com>
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 15, 2026

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 73bf61c6-f7e3-4ddb-a069-e8430bec74c2

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/download-errors-and-progress
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch fix/download-errors-and-progress

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 15, 2026

Codecov Report

❌ Patch coverage is 75.00000% with 6 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
comfy_cli/command/custom_nodes/command.py 0.00% 6 Missing ⚠️
@@            Coverage Diff             @@
##             main     #432      +/-   ##
==========================================
+ Coverage   76.63%   76.66%   +0.03%     
==========================================
  Files          35       35              
  Lines        4279     4299      +20     
==========================================
+ Hits         3279     3296      +17     
- Misses       1000     1003       +3     
Files with missing lines Coverage Δ
comfy_cli/command/models/models.py 72.68% <100.00%> (+0.46%) ⬆️
comfy_cli/file_utils.py 89.56% <100.00%> (+1.17%) ⬆️
comfy_cli/ui.py 66.66% <100.00%> (ø)
comfy_cli/command/custom_nodes/command.py 80.84% <0.00%> (-0.79%) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

[Potential bug] Visual glitches and error

1 participant