[PR #8608] Prettify retry duration display in TUI #12809

Closed
opened 2026-02-16 18:17:42 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/anomalyco/opencode/pull/8608

State: closed
Merged: Yes


The change is complete. Here's a summary of the formatting logic I added:

Duration formatting rules:

  • < 60 seconds: Shows as Xs (e.g., 45s)
  • < 1 hour: Shows minutes + seconds like Xm Ys (e.g., 5m 30s, or 5m if no remaining seconds)
  • < 1 day: Shows hours + minutes like Xh Ym (e.g., 2h 15m, or 2h if no remaining minutes)
  • < 1 week: Shows approximate days like ~X days (e.g., ~3 days)
  • >= 1 week: Shows approximate weeks like ~X weeks (e.g., ~2 weeks)

This addresses the issue where 447+ hours was displayed as raw hours/seconds. Now it would show as ~2 weeks or ~18 days instead, making it much clearer when a quota resets.

Closes #8170

New%20session%20-%202026-01-15T06%3A18%3A05.219Z
opencode session  |  github run

**Original Pull Request:** https://github.com/anomalyco/opencode/pull/8608 **State:** closed **Merged:** Yes --- The change is complete. Here's a summary of the formatting logic I added: **Duration formatting rules:** - **< 60 seconds**: Shows as `Xs` (e.g., `45s`) - **< 1 hour**: Shows minutes + seconds like `Xm Ys` (e.g., `5m 30s`, or `5m` if no remaining seconds) - **< 1 day**: Shows hours + minutes like `Xh Ym` (e.g., `2h 15m`, or `2h` if no remaining minutes) - **< 1 week**: Shows approximate days like `~X days` (e.g., `~3 days`) - **>= 1 week**: Shows approximate weeks like `~X weeks` (e.g., `~2 weeks`) This addresses the issue where 447+ hours was displayed as raw hours/seconds. Now it would show as `~2 weeks` or `~18 days` instead, making it much clearer when a quota resets. Closes #8170 <a href="https://opencode.ai/s/XsqjChxL"><img width="200" alt="New%20session%20-%202026-01-15T06%3A18%3A05.219Z" src="https://social-cards.sst.dev/opencode-share/TmV3IHNlc3Npb24gLSAyMDI2LTAxLTE1VDA2OjE4OjA1LjIxOVo=.png?model=opencode/claude-opus-4-5&version=1.1.21&id=XsqjChxL" /></a> [opencode session](https://opencode.ai/s/XsqjChxL)&nbsp;&nbsp;|&nbsp;&nbsp;[github run](/anomalyco/opencode/actions/runs/21021779452)
yindo added the pull-request label 2026-02-16 18:17:42 -05:00
yindo closed this issue 2026-02-16 18:17:42 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#12809