Skip to content

MediaDownloadError: decide its retry flag and whether an HTTP-error signed URL should raise it (from #898) #941

Closed

Description

@ffroliva

Two decisions split out of #898, raised by the PR #912 council. Each one changes a public contract, so neither was folded into the #898 fix.

1. MediaDownloadError is retryable (inherited from NetworkError)

get_signed_media raises it for two callers whose needs are opposite:

  • The generation download (gflow video / image). The clip exists and is billed. If a scheduler follows docs/MCP.md / USAGE.md and re-runs anything marked retryable: true, it bills again. The right action is gflow data download / gflow_download_media.
  • The gflow_download_media recovery tool. Here a retry is correct and spends nothing (MCP.md documents "pause and call again").

A single class-level flag can't be right for both. Options:

  • Set retryable per raise site, by caller.
  • Raise a distinct subclass from the generation path.
  • Keep the flag as it is and change the remediation text.

2. An HTTP error answer on the signed URL still leaves the asset pending

After Flow reports the clip done, an error status from the signed URL (an expired link, for example) raises WireFormatError (exit 7):

  • migrated_composer.py: status ≥300
  • ui_automation_video.py: status ≥400

Both messages already say the clip exists (expired_link_hint). Raising MediaDownloadError(media_id=…) there would mark the asset generated, but it would change exit 7 to 6.

Evidence needed before deciding

Which callers branch on exit 6 or 7 or on retryable: CLI scripts, the MCP worker, and the docs.

Activity

  1. added a commit that references this issue on Oct 2, 2026
  2. added 2 commits that reference this issue on Oct 23, 2026
  3. ffroliva commented on Oct 23, 2026

    @ffroliva
    OwnerAuthor

    Part 1 is done in PR #1064 (merged). Per raise site:

    • retryable: false for the generation downloads (flow.google.com fetch_mp4, which extend also uses; the labs video download), the clip writer, and client.download_image after its retries.
    • retryable: true (unchanged) for the free recovery (gflow data download / gflow_download_media).

    Evidence: nothing in gflow auto-retries, so the flag is a promise to external schedulers. MCP.md defines true as "re-run without operator intervention", and #1010 already made billed post-submit failures false. Exit code 6 is unchanged.

    Part 2 is still open and needs a maintainer decision. An HTTP error status on the signed URL (migrated_composer ≥300, ui_automation_video ≥400) still raises WireFormatError, exit 7, and leaves the asset pending. Raising MediaDownloadError(media_id=…) would mark it generated, but it changes exit 7 to 6 for scripts.

  4. added a commit that references this issue on Oct 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions