[PR #100] [MERGED] fix(fal): a failed output download names the request to fetch again #124

Closed
opened 2026-10-15 20:53:36 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/rehan-remade/universal-modder/pull/100
Author: @AltDoug
Created: 10/5/2026
Status: ✅ Merged
Merged: 10/6/2026
Merged by: @rehan-remade

Base: main ← Head: fix/fal-download-keeps-request-id


📝 Commits (2)

  • b20e03c fix(fal): a failed output download names the request to fetch again
  • 0048d8c Merge main into fix/fal-download-keeps-request-id

📊 Changes

2 files changed (+38 additions, -4 deletions)

View changed files

📝 tests/test_um.py (+26 -0)
📝 um/fal.py (+12 -4)

📄 Description

If an output URL fails to download after a fal job completes, download_outputs raises a bare HTTPError traceback. The manifest line is never written and the request id is never printed, so the finished (and paid) job is effectively lost. You can't call um fal result without the id.

I hit this with a BiRefNet video matte whose result was ~113 MB (ProRes 4444): the job completed, but its v3b.fal.media URL returned 404 for good (retried for 5 minutes), while results up to ~99 MB from the same model downloaded fine. I haven't re-run that paid job for this PR, so treat the size link as an observation, not a confirmed rule. This PR only makes sure the job isn't lost when a download fails, whatever the cause:

  • download_outputs saves every output it can, then stops with the failed URL(s), the error, and request <id>: try again later with um fal result <endpoint> <id>.
  • run() stores _endpoint next to the _request_id it already stores, so that line is copy-pasteable.

Tests: new test_failed_download_keeps_the_request_id (fails before, passes after); full suite 59 passed on Windows 11, Python 3.12. By hand: a real 404 from v3b.fal.media through download_outputs now prints

um: the job finished but these outputs did not download:
  https://v3b.fal.media/files/b/.../does-not-exist.mov (HTTP Error 404: Not Found)
request req-demo: try again later with `um fal result fal-ai/birefnet/v2/video req-demo`

Found and fixed with AI assistance (Claude Code); the repro and the fix were run by hand on Windows 11.

🤖 Generated with Claude Code


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/rehan-remade/universal-modder/pull/100 **Author:** [@AltDoug](https://github.com/AltDoug) **Created:** 10/5/2026 **Status:** ✅ Merged **Merged:** 10/6/2026 **Merged by:** [@rehan-remade](https://github.com/rehan-remade) **Base:** `main` ← **Head:** `fix/fal-download-keeps-request-id` --- ### 📝 Commits (2) - [`b20e03c`](https://github.com/rehan-remade/universal-modder/commit/b20e03cff126e42f2124adf9cef110c4a923ad3a) fix(fal): a failed output download names the request to fetch again - [`0048d8c`](https://github.com/rehan-remade/universal-modder/commit/0048d8c0cbe5d9283671c0ab7adf92f77c67343c) Merge main into fix/fal-download-keeps-request-id ### 📊 Changes **2 files changed** (+38 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `tests/test_um.py` (+26 -0) 📝 `um/fal.py` (+12 -4) </details> ### 📄 Description If an output URL fails to download after a fal job completes, `download_outputs` raises a bare `HTTPError` traceback. The manifest line is never written and the request id is never printed, so the finished (and paid) job is effectively lost. You can't call `um fal result` without the id. I hit this with a BiRefNet video matte whose result was ~113 MB (ProRes 4444): the job completed, but its `v3b.fal.media` URL returned 404 for good (retried for 5 minutes), while results up to ~99 MB from the same model downloaded fine. I haven't re-run that paid job for this PR, so treat the size link as an observation, not a confirmed rule. This PR only makes sure the job isn't lost when a download fails, whatever the cause: - `download_outputs` saves every output it can, then stops with the failed URL(s), the error, and `request <id>: try again later with um fal result <endpoint> <id>`. - `run()` stores `_endpoint` next to the `_request_id` it already stores, so that line is copy-pasteable. Tests: new `test_failed_download_keeps_the_request_id` (fails before, passes after); full suite 59 passed on Windows 11, Python 3.12. By hand: a real 404 from `v3b.fal.media` through `download_outputs` now prints ``` um: the job finished but these outputs did not download: https://v3b.fal.media/files/b/.../does-not-exist.mov (HTTP Error 404: Not Found) request req-demo: try again later with `um fal result fal-ai/birefnet/v2/video req-demo` ``` Found and fixed with AI assistance (Claude Code); the repro and the fix were run by hand on Windows 11. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-15 20:53:36 +00:00
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
rehan-remade/universal-modder#124
No description provided.