|
| 1 | +# Choose which transcript entries show timestamps |
| 2 | + |
| 3 | +## Identity |
| 4 | + |
| 5 | +- Status: active |
| 6 | +- Integration branch: `dev-nowaker` |
| 7 | +- Development branch(es): `tui-part-timestamps` (on `tui-turn-timing` `b14b75e5d8`, itself on upstream `dev` `907b3bc518`; also the upstream PR head) |
| 8 | +- First local commit: `9163ac0f36` |
| 9 | +- Current local commit(s): `9163ac0f36` |
| 10 | +- Upstream base when introduced: `907b3bc518` (upstream `dev`) |
| 11 | +- Last checked against upstream: `907b3bc518` (upstream `dev`) |
| 12 | +- Upstream: issue [#42498](https://github.com/anomalyco/opencode/issues/42498) (design [comment](https://github.com/anomalyco/opencode/issues/42498#issuecomment-6028995049)), PR [#53654](https://github.com/anomalyco/opencode/pull/53654), stacked on PR [#53195](https://github.com/anomalyco/opencode/pull/53195) |
| 13 | + |
| 14 | +## Original request |
| 15 | + |
| 16 | +Relayed by coordinator `ses_ef8235798ffejGr4sa22eXmVNv` (effort item 18), |
| 17 | +quoting the user: |
| 18 | + |
| 19 | +> i noticed tool calls are missing datetimes; since that is different from ai |
| 20 | +> responses, it should have a separate switch to whether include them or not. |
| 21 | +> default: no, here: yes. include all time stamps etc. on tool calls, and if |
| 22 | +> other message types aren't getting their dates, they should get them also, |
| 23 | +> for consistency. maybe a single knob with a list of message types that get |
| 24 | +> them or not, with a sane default that matches today's opencode, also 'all', |
| 25 | +> or a comma delimited list of message types that get them. config docs to |
| 26 | +> explain all available values. (does tui.conf come with comments in jsonc? if |
| 27 | +> so, include options there) |
| 28 | +
|
| 29 | +## Goals |
| 30 | + |
| 31 | +- One `tui.json` key, `timestamps`, naming the transcript entries that show |
| 32 | + a timestamp: `"all"`, `"none"`, a comma-separated list, or an array of |
| 33 | + `user`, `assistant`, `text`, `reasoning`, `tool`, `error`, `compaction`. |
| 34 | +- Tool calls show when they finished and how long they ran |
| 35 | + (`✱ Glob "*" (1 match) · 8:05 PM · 500ms`; block tools in their title or a |
| 36 | + trailing line). |
| 37 | +- Every format uses `Locale.todayTimeOrDateFirst` from the turn-timing |
| 38 | + feature. |
| 39 | +- Unset reproduces vanilla rendering exactly. |
| 40 | + |
| 41 | +## Non-goals |
| 42 | + |
| 43 | +- No live "running since" clock on a running tool (upstream #50891). |
| 44 | +- `turn_timing.duration` and `/turn-durations` unchanged. |
| 45 | +- No new slash command; `/timestamps` and `/turn-times` keep their names. |
| 46 | + |
| 47 | +## Rationale and constraints |
| 48 | + |
| 49 | +- Vanilla inventory (`907b3bc518` + turn timing): only user prompts |
| 50 | + (`/timestamps`, kv `timestamps`) and assistant footers (`turn_timing.time`, |
| 51 | + `/turn-times`) show a time. Reasoning headers show a duration only; tool |
| 52 | + rows, text blocks, the assistant error box and the compaction divider show |
| 53 | + nothing. Tool and reasoning parts already carry `time.start`/`time.end`; |
| 54 | + text parts carry an optional `time.end`. |
| 55 | +- Coexist rather than absorb: unset keeps `/timestamps`, `/turn-times` and |
| 56 | + `turn_timing.time` persisting in kv exactly as before. Set, the list |
| 57 | + decides every type on each start and overrides `turn_timing.time`; the two |
| 58 | + toggles still flip prompt and turn times but only for the running TUI. |
| 59 | +- kv-wins was rejected: `kv.json` usually already contains `"timestamps"` |
| 60 | + because the kv store persists its in-memory `kv.signal` defaults with any |
| 61 | + other write, so the config option would be dead on most installs. |
| 62 | +- opencode ships no commented `tui.jsonc` template; the JSON schema |
| 63 | + `description` (generated by `packages/opencode/script/schema.ts` into |
| 64 | + `opencode.ai/tui.json`) is the in-editor documentation and lists every |
| 65 | + value. |
| 66 | + |
| 67 | +## Changes |
| 68 | + |
| 69 | +| Commit | Workday | Change | Stable seam | |
| 70 | +|---|---|---|---| |
| 71 | +| `9163ac0f36` | 2026-10-06 | `timestamps` schema and `timestampTypes`; per-type timestamps on tool rows/blocks, reasoning header, text blocks, error box, compaction divider; `/timestamps` and `/turn-times` session-only when set; docs and tests | `Timestamps`, `timestampTypes` in `packages/tui/src/config/index.tsx`; `showPartTimestamp`, `formatToolTimestamp`, `InlineToolRow` `timestamp` prop in `packages/tui/src/routes/session/index.tsx` | |
| 72 | + |
| 73 | +## Verification |
| 74 | + |
| 75 | +- `bun typecheck` in `packages/tui` and `packages/opencode` - exit 0 on |
| 76 | + `tui-part-timestamps` and on `part-timestamps-land`, with the repo's |
| 77 | + `@types/node` 24.12.2 (see the session record for the ambient 25.9.2). |
| 78 | +- `packages/tui` tests `config.test.tsx`, `inline-tool-wrap-snapshot.test.tsx`, |
| 79 | + `util/locale.test.ts`: 31 pass. `packages/opencode/test/config/tui.test.ts`: |
| 80 | + 31 pass, 4 fail; the 4 plugin-merge failures are identical on the base. |
| 81 | +- Manual surface: isolated TUI (throwaway tmux sockets `oc-part-ts-*`, |
| 82 | + scratch `XDG_*`, `OPENCODE_TOOLS_DATA_DIR`/`OPENCODE_PLUGINS_DATA_DIR`), |
| 83 | + fake OpenAI-compatible provider streaming reasoning, text, parallel glob + |
| 84 | + bash calls, a slow bash call, a final answer, a forced 400, then |
| 85 | + `/compact`. Before (`tui-turn-timing`) and after with `timestamps` unset: |
| 86 | + identical at every stage after normalizing durations. `"all"` with a stale |
| 87 | + `{"timestamps":"hide"}` in kv: every type stamped. `"user, tool"`: prompt |
| 88 | + times and tool rows only; `/timestamps` hid prompt times for the run and |
| 89 | + `kv.json` stayed absent. |
| 90 | + |
| 91 | +## Timeline |
| 92 | + |
| 93 | +- 2026-10-06 |
| 94 | + [`ses_eec3e5569ffe2otGPxp4LBssZb`](../sessions/2026-10-06-tui-part-timestamps.md) |
| 95 | + - `9163ac0f36`: introduce (cherry-pick of `da278a9c97`, conflicts with |
| 96 | + `sidebar`/`usage`/`model_label` schema and `keep_scroll_on_submit` |
| 97 | + resolved by keeping both); design comment on #42498, PR #53654. |
| 98 | + - Build and install: desktop and m4max `1.18.34-vt-130-907b3bc518`; |
| 99 | + `"timestamps": "all"` in both hosts' `tui.json`. |
| 100 | + |
| 101 | +## Current maintenance notes |
| 102 | + |
| 103 | +- Drop the commit once PR #53654 (or an equivalent) is in upstream `dev`; |
| 104 | + it depends on the turn-timing commits. |
| 105 | +- Adjacent to `model_label` in `Info` and to `keep_scroll_on_submit` in the |
| 106 | + session route; upstream bumps touching either may conflict textually. |
| 107 | + |
| 108 | +### Upstream integration checklist |
| 109 | + |
| 110 | +- Locate `Timestamps` and `timestampTypes` in |
| 111 | + `packages/tui/src/config/index.tsx`. |
| 112 | +- Locate `showPartTimestamp`, `formatToolTimestamp` and the `timestamp` |
| 113 | + prop of `InlineToolRow` in `packages/tui/src/routes/session/index.tsx`. |
| 114 | +- Run `bun typecheck` in `packages/tui` and the three `packages/tui` tests |
| 115 | + above. |
| 116 | +- With `"timestamps": "all"`, run a multi-step prompt and check tool rows, |
| 117 | + bash blocks, thinking headers and the footer. |
| 118 | +- Link a new timeline row to the current session record. |
| 119 | + |
| 120 | +## Supersession or removal |
| 121 | + |
| 122 | +- Not applicable; status is active. |
0 commit comments