Repository navigation
feat(tui): add configurable reply timestamps - #62530
NachiketKandari wants to merge 2 commits into
Conversation
There was a problem hiding this comment.
The feature works as described. With session.timestamps on, I ran the TUI from source on base and on this branch with the simulated model. The footer changes from Build · Simulated Model · 66ms to Build · Simulated Model · 69ms · 7:54 AM · 07-Nov-2026. The related config, locale and footer tests pass, and the type check shows no new errors.
I couldn't get usable before/after screenshots from my run. Could you add before and after screenshots of the footer with the setting on?
Public API: adds two optional cli.json keys, session.timestamps (boolean, default false) and session.date_format (locale | friendly | dd-mon-yyyy | iso, default locale). Both also appear in Settings. This is backwards compatible: existing configs are unchanged and nothing is removed.
One concern, inline: the timestamp wraps in narrow terminals. Also worth knowing: #49742 asks for v1's per-message timestamps back, including on user messages and the /timestamps toggle, and has a design discussion with other contributors. This change only adds timestamps to assistant footers, so it covers part of that request.
| <Show when={config.data.session.tps && tokensPerSecond()}> | ||
| {(value) => <span style={{ fg: theme.text.muted }}> · {value().toFixed(1)} tok/s</span>} | ||
| </Show> | ||
| <Show when={config.data.session.timestamps && timestamp()}> |
There was a problem hiding this comment.
The model name and duration on this line hide themselves below set terminal widths, but the timestamp doesn't. At 50 columns the footer wraps:
Build · Simulated Model · 51ms · 7:54 AM ·
07-Nov-2026
Could it get a width check too, e.g. dropping the date first and then the time as the terminal gets narrower?
There was a problem hiding this comment.
Fixed in 1168403. The width check now measures the footer parts, accounts for the scrollbar gutter, and drops the whole date first, then the whole time. tok/s is also hidden when the line no longer fits, and a resize regression test covers the exact column where the date drops. Screenshots are in the PR comment above.
Add session.timestamps to show the completion time and date in assistant footers, with session.date_format choosing locale, friendly (Nov 6, 2026), dd-mon-yyyy (06-Nov-2026), or ISO. The feature is off by default.
Account for the scrollbar gutter and hide tokens/sec when the footer line no longer fits, so the date and time drop as whole units instead of their last words wrapping.
2f99161 to
1168403
Compare
ScreenshotsCaptured from the actual TUI renderer with Before — timestamps off After — timestamps on Narrow terminalsThe timestamp now drops the whole date first, then the whole time, instead of letting the terminal wrap it:
The width check also accounts for the scrollbar gutter, and hides Scope note: this remains intentionally limited to assistant reply footers; per-message timestamps and the |
There was a problem hiding this comment.
My earlier concern is resolved: the footer no longer wraps in narrow terminals. I ran the branch from source with the simulated model at 120, 60, 50, 48 and 40 columns. The full timestamp shows when it fits. Narrower, the date drops and then the time, and the line stays on one row. The footer tests, including the new resize test, and the config and locale tests pass.
Public API: same as before. Adds the optional cli.json keys session.timestamps (boolean, default false) and session.date_format (locale | friendly | dd-mon-yyyy | iso, default locale). This is backwards compatible.
One behaviour change to be aware of: with tps on, tok/s now hides when it wouldn't fit, even if timestamps are off; before, it wrapped onto a new line. That seems reasonable. No other concerns.
|
+1 — this is the one v2 feature I miss daily. Use case: long working sessions (often hours) in the TUI, where I need to correlate what the agent did with external events — server logs, CI runs, deploy times. The transcript currently tells me what happened and how long each turn took, but not when it happened. Post-hoc debugging today means exporting the session and scripting over The opt-in design looks right to me: Would really appreciate seeing this merged. Happy to help test it on a long-running session if a review build is published. |






Issue for this PR
Related to #53192
Type of change
What does this PR do?
Adds optional wall-clock timestamps to assistant footers in the TUI.
v2 already shows the response duration and tokens/sec, but it has no equivalent of v1's
/timestampsfor assistant replies. This adds two opt-incli.jsonsettings:session.timestamps(defaultfalse): show the reply's completion time and date.session.date_format(default"locale"):locale,friendly(Nov 6, 2026),dd-mon-yyyy(06-Nov-2026), oriso(2026-11-06).Both appear in Ctrl+P → Settings. The timestamp is based on
message.time.completed, so it only appears after a reply finishes; a streaming reply does not show its start time as the completion time.The formatter is in
Locale.date. The feature is off by default, so existing configs are unchanged.How did you verify your code works?
bun test test/config-v2.test.tsx test/util/locale.test.ts— 28 pass.bun test --timeout 30000 test/app-lifecycle.test.tsx -t "keeps assistant footer metrics"— pass, including the rendereddd-mon-yyyytimestamp.bun checkon the changed files — no errors from this change.bun run lint— no warnings or errors in the changed files.Visual
Screenshots / recordings
The terminal output is shown in the description above.
Notes
This is a feature I use daily. I have been running this patch locally on v2.2.5, and this PR contains only the feature, its tests, and the documentation change.
Checklist
Added by the opencode bot (AI-generated).
Related: #49742, #53192, #62344
Public API: adds optional cli.json keys session.timestamps and session.date_format (backwards compatible)