Skip to content

fix(ui): humanize provider retry delay in the banner copy - #3402

Open
me2seeks wants to merge 1 commit into
apache:mainfrom
me2seeks:fix/desktop-retry-delay-format
Open

fix(ui): humanize provider retry delay in the banner copy#3402
me2seeks wants to merge 1 commit into
apache:mainfrom
me2seeks:fix/desktop-retry-delay-format

Conversation

@me2seeks

Copy link
Copy Markdown
Contributor

Fixes #3401.

Problem

With a long provider Retry-After (subscription quota window reset, e.g. kimi-k3 / OpenCode Go 5h quota), the desktop retry banner renders a raw five-digit second count — 13565 秒后重试(2/10) — illegible and visually indistinguishable from a hang. The TUI strip already humanizes the same wait as 4h 28m 3s (#3393).

Fix

Format providerRetryScheduled in d/h/m/s units per locale:

  • zh: 4小时 28分 3秒后重试(2/10)
  • en: Retrying in 4h 28m 3s (2/10)

One-second granularity is kept so the banner visibly ticks every second — the goal chip's minute-granularity ladder would reintroduce the frozen look between minute boundaries. Short delays keep the familiar seconds-only form (45秒后重试 / Retrying in 45s).

Tests

New conversation-copy.test.ts pins both locales across second/minute/hour/day scales. Full ui suite (184) passes; biome lint/format clean.

Note: independent of #3400 (countdown ticking); either merge order works.

A subscription quota window hands the runtime an hour-scale Retry-After,
and the desktop banner rendered it as a raw five-digit second count
('13565 秒后重试(2/10)') that reads as a frozen hang. Format the delay
in d/h/m/s units per locale ('4小时 28分 3秒后重试', 'Retrying in 4h 28m
3s') so the countdown stays legible and keeps ticking every second,
unlike the goal chip's minute-granularity ladder.

@jackwener jackwener left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated review of exact head ef7097b50a91c7dc5284f00180db0ffe15a95fa4.

I confirmed the current main copy still renders provider waits as raw seconds, and the patch fixes that at the presentation boundary without changing retry policy. The d/h/m/s formatter is bounded, locale-specific, and the focused UI build plus new locale test passed locally (1/1). I found no P0-P2 correctness issue.

Merge readiness: not ready yet. This head has no hosted check result and still requires an independent human review; both gates should be present on this exact head before merge.

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.

Desktop retry banner shows raw seconds for long waits: '13565 秒后重试'

2 participants