Skip to content

fix(spx-gui): stabilize AI asset generation ETA display#2921

Open
xgopilot[bot] wants to merge 1 commit intodevfrom
xgopilot/issue-2919-1772792402
Open

fix(spx-gui): stabilize AI asset generation ETA display#2921
xgopilot[bot] wants to merge 1 commit intodevfrom
xgopilot/issue-2919-1772792402

Conversation

@xgopilot
Copy link
Contributor

@xgopilot xgopilot bot commented Mar 6, 2026

Requested by @nighca

Fixes #2919

Summary

  • Root cause: startAutoReport used a quadratic curve to derive ETA as timeLeft = timeCost * (1 - percentage). Since the quadratic function advances quickly in early intervals, the ETA could drop from ~3 minutes to ~1.5 minutes within ~18 seconds, making the display feel unreliable.

  • Fix in progress.ts: Decouple ETA from the progress curve. Use wall-clock elapsed time for ETA: timeLeft = max(0, timeCost - elapsed). The quadratic progress curve is kept for the visual progress bar animation, but ETA now decreases at a stable ~1 second per second.

  • Fix in common.ts: Update GenerateAnimationVideo default estimated duration from 150s (2.5 min) to 180s (3 min) as specified in the issue.

  • Update in progress.test.ts: Adjust test expectations — ETA is now non-increasing (wall-clock based, clamped to [0, timeCost]) rather than strictly decreasing from a percentage-derived value.

Result

With this fix, for a 3-minute task, the displayed ETA will now change approximately as:

  • Start: "3 minutes"
  • After ~45-60s: "2 minutes"
  • After ~90-100s: "a minute"
  • After ~135s: "a few seconds"

Instead of the previous behavior where it could jump through all four stages in just ~15 seconds.

Fixes #2919

The previous implementation derived `timeLeft` from the estimated progress
percentage using the quadratic curve: `timeLeft = timeCost * (1 - percentage)`.
Because the quadratic function advances very fast in early intervals, the ETA
could drop from ~3 minutes to ~1.5 minutes within just 18 seconds, making
the display feel unreliable and fake.

Changes:
- `progress.ts`: Switch `startAutoReport` to use wall-clock elapsed time for
  ETA calculation (`timeLeft = max(0, timeCost - elapsed)`) instead of
  percentage-based estimation. The progress curve (quadratic) is kept for the
  visual progress bar, but ETA now decreases at a stable ~1 second per second,
  independent of the progress model.
- `common.ts`: Update video generation default estimated duration from 150s
  (2.5 min) to 180s (3 min) as specified in the issue.
- `progress.test.ts`: Update test expectations to reflect that timeLeft is now
  wall-clock based (non-increasing, clamped to [0, timeCost]).

Generated with [codeagent](https://github.com/qbox/codeagent)
Co-authored-by: nighca <1492263+nighca@users.noreply.github.com>
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.

AI asset generation: ETA display is misleading and should be stabilized

1 participant