Skip to content

Recover paid results without paying for generation again #116

Closed

Description

@softmarshmallow

User problem

A user can pay twice for the same generation because FX couldn’t retrieve the first result. For example, Tripo reports that it finished a mesh and charged $0.50, but FX can’t download or validate the model. FX records the charge and retains the provider task ID. When the user resumes the run, FX can submit a second generation and charge another $0.50.

Resulting behavior

Keep the completed provider task available for recovery after settling its bill. When the provider still serves the result, let the user retrieve it from the original task with one total generation charge. Show the original charge, whether recovery is available, and what the user can do next. If the result is unavailable, report that clearly so the user can decide whether to authorize a new generation.

The CLI and SDK entry points and the stored representation are open design choices.

Affected scenarios

  • A successful paid task returns a download or validation failure, including an output rejected by the engine’s answer checks.
  • A saved run already has a settled record with a provider task ID. The caller needs an explicit path to try that task again.
  • The provider reports that generation itself failed, or no longer serves the completed result.
  • A CLI, Python, or JavaScript caller needs to recover the result and account for the original charge.

Before and after

Both examples use the same one-step mesh workflow and a provider that charges $0.50 per generation. The first download contains invalid model data. The provider later serves valid data for the original task. Amounts, task IDs, and terminal output are illustrative.

A. Before (faux output)

$ grida fx run make-mesh --run runs/mesh-demo --live --max-usd 2
Run failed. The generated model could not be validated.
Provider task T1 completed. Charged $0.50.
[Exit 1. No model was written.]
$ grida fx run make-mesh --run runs/mesh-demo --live --max-usd 2
Submitted provider task T2. Charged $0.50.
Saved runs/mesh-demo/outputs/model.glb
[Exit 0. Total generation charges: $1.00.]

B. After (proposed resume behavior, faux output)

$ grida fx run make-mesh --run runs/mesh-demo --live --max-usd 2
Run failed. The generated model could not be validated.
Provider task T1 completed. Charged $0.50. Resume to retry collection.
[Exit 1. No model was written.]
$ grida fx run make-mesh --run runs/mesh-demo --live --max-usd 2
Collected the result from provider task T1. Additional charge $0.00.
Saved runs/mesh-demo/outputs/model.glb
[Exit 0. Total generation charges: $0.50.]

Demo and evidence

Three offline fixtures on current main verify the relevant behavior separately. Tripo retains the reported cost for a successful task with an unusable output. The runtime saves a settled record with the task handle when its answer check rejects the collected result. On a later run, the job lookup allows a new submission from a settled record. Tripo fixture · Runtime fixture · Job lookup

How to test

  • Use an offline provider fixture to report success and a charge, fail collection, then return the valid artifact from the same task. Assert one generation submission, one settled charge, and delivery of the model.
  • Exercise download failures, engine answer validation failures, genuine provider terminal failures, and completed results that have become unavailable.
  • Verify an explicit recovery path for older settled records that retain a handle. Cover upgrade and pruning behavior and the recovery workflow from the CLI, Python, and JavaScript.

Caveats

A settled record alone doesn’t tell FX whether generation succeeded. Recovery needs evidence that the original task can provide the result. Store only safe recovery facts such as a provider task ID. Signed URLs and credentials stay out of records.

The CDN compatibility issue was addressed in #118. Synchronous fal calls with no retained task handle are tracked separately in #117.

Activity

  1. added
    area:providersProvider declarations, adapters, credentials and wire protocols.
    area:runtimeExecution, retry and job recovery, records, cache and lifecycle.
    status:deferredRetained for later; not an active implementation priority.
    on Nov 15, 2026
  2. changed the title [-]Preserve successful paid jobs when local collection fails[/-] [+]Recover paid results without paying for generation again[/+] on Nov 19, 2026
  3. added and removed
    status:deferredRetained for later; not an active implementation priority.
    on Nov 19, 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

    area:providersProvider declarations, adapters, credentials and wire protocols.area:runtimeExecution, retry and job recovery, records, cache and lifecycle.ready for developmentScoped and ready for implementation.

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions