Studio: fix the hub download rate estimator and bound long ETAs - #7679
Conversation
Cap hub ETA labels below 24 hours so unstable throughput cannot render implausible multi-day estimates. Generated by Ora Studio Vibe coded by ousama Co-Authored-By: Codex <noreply@users.noreply.github.com>
|
Taking this over and pushed a follow-up commit. The display cap was the right thing to flag, but on its own it left two problems: the misleading rate stayed on screen next to the hidden ETA, and a genuinely slow download lost its estimate entirely. What changed1. Fixed the rate at the estimator ( The hub download manager now derives its rate from the shared rolling-window estimator in 2. Moved It is no longer chat specific, and the deep cross-feature import is blocked by the 3. Hiding the label meant a 6.8 GB download on a 60 KB/s line showed no estimate at all until it was roughly 7 hours in. 4. Tests
Effect15 download traces (521k polls) replayed through the estimator and the progress bar, with every rendered label scored against the true remaining time the simulation knows. "absurd" means a label claiming 24h or more while the transfer actually had under a day left.
The remaining 3,175 come almost entirely from a trace that decays exponentially to a 2 KB/s trickle, where a stable estimator genuinely does measure more than a day left. Those now render as Verified
|
|
Before and after in the real Studio UI. Both panels are the actual hub download card, rendered by the real frontend against a real Studio backend. The only thing injected is the download telemetry itself, replayed from issue #7667, since a 102 B/s transfer cannot be produced on demand any other way. Pre-PR is The reported case: 6.8 GB repo, byte counter creeping at ~102 B/s
The first seconds of a healthy 40 MB/s downloadThis is the case the estimator change is really for. The download is healthy and about to run at 40 MB/s, but the first poll pair lands during connection setup. The old EMA seeds itself from that single sample and immediately renders |


Summary
Addresses part of #7667.
This is intentionally a display safeguard only. It does not change the download manager's rate estimator or claim to resolve its startup/stall stability.
Verification
753d 5h left102 B/sremains visible while753d 5h leftis absentFiles changed
studio/frontend/src/features/hub/lib/format.tsstudio/frontend/tests/hub-format.test.tsAI-assisted with Codex; reviewed and tested by the contributor.
Maintainer update
Follow-up commit pushed on top of the above. The scope is now the root cause rather than the label alone:
studio/frontend/src/features/hub/download-manager/poll-loop.tsstudio/frontend/src/lib/transfer-stats.tsfeatures/chat/utils/; it is shared by the chat, training and hub surfacesstudio/frontend/src/features/hub/lib/format.ts> 24h leftinstead of disappearingstudio/frontend/tests/hub-format.test.tsstudio/frontend/tests/hub-download-rate.test.tsMeasured effect and the cross-platform, cross-engine verification are in the comment below.