Cache expiration countdown timer in status line
Open 💬 3 comments Opened Apr 21, 2026 by tom-huntington
💡 Likely answer: A maintainer (github-actions[bot], contributor)
responded on this thread — see the highlighted reply below.
What variant of Codex are you using?
CLI
What feature would you like to see?
I don't know what info the API returns, but it would be nice get some idea of how soon the cache is going to expire.
Perhaps you could estimate when it is going to expire, and display a countdown timer
Additional information
_No response_
3 Comments
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
That information isn't available to clients currently.
Adding implementation notes since PRs appear to be invitation-only and the exact server-side expiry is not exposed to clients.
A conservative client-side status-line item still seems useful and small in scope:
cache-expiry.cache-timer,prompt-cache,prompt-cache-expiry.Cache colduntil a turn is plausibly prompt-cache eligible.Cache 5:00and count down once per second.Cache coldafter the local estimate expires.A local prototype against the TUI code touched these areas:
codex-rs/tui/src/bottom_pane/status_line_setup.rs: addStatusLineItem::PromptCacheExpiry, descriptions, aliases, preview mapping, and parser tests.codex-rs/tui/src/bottom_pane/status_surface_preview.rs: add preview text likeCache 5:00.codex-rs/tui/src/chatwidget.rs: storeprompt_cache_warm_until: Option<Instant>and aprompt_cache_timer_tick_pendingflag; refresh this fromTokenUsageInfoafter each turn.codex-rs/tui/src/chatwidget/status_surfaces.rs: renderCache cold/Cache M:SS, schedule a one-second refresh tick while warm, and clear state when expired.codex-rs/tui/src/app_event.rs+app/event_dispatch.rs: add a lightweightPromptCacheTimerTickevent to refresh the status line.codex-rs/tui/src/chatwidget/tests/status_and_layout.rs: cover cold state, non-eligible small prompts, initialCache 5:00, countdown formatting, and expiry back to cold.The prototype used a deliberately conservative threshold/duration:
The main product decision is whether Codex wants an estimated indicator when exact cache metadata is unavailable. If yes, the UI can label the item as estimated and avoid implying billing or server cache guarantees. If no, this issue probably needs server/API support for exact cache expiry metadata before it can be made precise.
<img width="1016" height="323" alt="Image" src="https://github.com/user-attachments/assets/df2bfaaf-e4ed-42e2-b0b4-1168ce572e94" />
<img width="850" height="250" alt="Image" src="https://github.com/user-attachments/assets/890cae25-55db-4b64-bbc7-49535bf2f95a" />