fix(ui, cli): humanize provider retry delay (3401) - #3611
Conversation
Humanizes the retry banner from raw seconds (`13565s`) to
`3h 46m 5s` / `3小时 46分 5秒` with 1s granularity.
- ui/conversation-copy: new `formatRetryDelay(seconds, locale)`
shared by zh/en catalogs; replaces raw `${seconds}s` copy
- cli/pi-transcript: new `formatRetryDuration(delayMs)`
for TUI activity strip
Fixes apache#3401.
Related to apache#3393 (countdown ticking) — this complements that fix
by formatting the number that now ticks.
Astro-Han
left a comment
There was a problem hiding this comment.
Reviewed exact head 742bbc9. Coverage: UI zh/en duration formatting over seconds/minutes/hours/days and fractional-second rounding; CLI millisecond formatting and narrow-line fitting; provider-retry event bounds/countdown flow; confirmation that Runtime retry-after/backoff calculation, sleep, attempts, and protocol transport are unchanged. Exclusions: real provider Retry-After traffic and interactive terminal/renderer visual inspection. Local UI→CLI builds passed and 228 focused UI/CLI tests are green; hosted exact-head test is green. No P0–P3 findings. The branch is 24 commits behind main and currently conflicts only in packages/ui/src/conversation-copy.ts; rebase should preserve current main’s newer copy entries plus this PR’s formatter/wiring.
Fixes #3401.
When a provider returns a long
Retry-After(~13565s for a 5h quota reset), the retry banner rendersRetrying in 13565s/13565 秒后重试— illegible. Related to #3393 (countdown ticking).What changed
packages/ui/src/conversation-copy.ts— newformatRetryDelay(seconds, locale):13565→3h 46m 5s(en) /3小时 46分 5秒(zh), 1s granularity. Wired into both zh/enproviderRetryScheduledcatalog entries.packages/cli/src/pi-transcript.ts— newformatRetryDuration(delayMs)for the TUI activity strip; same humanized output (en).Granularity stays at one second so the banner visibly ticks (minute-granularity would reintroduce the frozen look from #3393).
Verification
formatRetryDelayspot-checked locally (13565→3h 46m 5s,90061→1d 1h 1m 1s, edge:0.2→1s).@xterm/xtermcustom registry (ms-feed-2.pkgs.visualstudio.com); CI is the verification layer.Closes #3401.
Related: #3393.