Repository navigation
Conversation
The assistant footer only appears on the final message of a prompt and shows one number: the time since that prompt. Intermediate tool-call turns show no footer, so there is no way to see when a turn finished or which step of a long run took the time. Add a `turn_timing` option to tui.json with two independent booleans: - `time`: when each assistant turn finished, as the time of day if today and the date followed by the time otherwise (Locale.todayTimeOrDateFirst, e.g. `10/4/2026 11:26 PM`). Locale.todayTimeOrDateTime keeps its time-then-date order for its existing callers. - `duration`: how long each turn took (created -> completed). The final turn keeps the existing total since the prompt and labels it `total`, so both numbers are visible. Either option gives every completed assistant turn a footer. Both default to false, so the footer is unchanged unless enabled. /turn-times and /turn-durations (also in the command palette and bindable via session_toggle_turn_time / session_toggle_turn_duration) toggle them at runtime. Like /timestamps, a toggled value persists in kv.json and takes precedence over tui.json, which supplies the default. AI-Tool: opencode 1.18.33-vt-60-2fa3363c92 AI-Model: anthropic/claude-opus-5-5 AI-Variant: high AI-Platform: linux AI-Harness: Vibeterm e8a11eb AI-Session-ID: ses_ef81c1485ffeC5Sb59U9mVI77g
Only prompts (/timestamps) and assistant turn footers (/turn-times, turn_timing.time) can show when something happened. Tool calls, thinking blocks, text blocks, errors and compactions never do, so a long run gives no way to see when a step finished or how long a tool call ran. Add a `timestamps` option to tui.json naming the entry types that show a timestamp: "all", "none", a comma-separated list such as "user,tool", or an array. The types are user, assistant, text, reasoning, tool, error and compaction. Tool calls show when they finished and how long they ran; thinking blocks put the time before their existing duration; text blocks and errors get a muted time line; the compaction divider gets the time in its title. All use Locale.todayTimeOrDateFirst, like the turn footer. Unset, nothing changes: /timestamps, /turn-times and turn_timing.time work and persist exactly as before. Set, the list decides every type on each start and overrides turn_timing.time; /timestamps and /turn-times still flip prompt and turn times, until the TUI exits. A kv-wins rule would make the option dead for most existing installs: kv.json usually already holds "timestamps", because the kv store persists its in-memory defaults alongside any other write. The JSON schema description documents every value, since opencode ships no commented tui.jsonc template. AI-Model: anthropic/claude-opus-5-5 AI-Variant: high AI-Tool: opencode 1.18.34-vt-126-907b3bc518 AI-Platform: linux AI-Harness: Vibeterm a042c6b AI-Session-ID: ses_eec3e5569ffe2otGPxp4LBssZb
Contributor
|
The following comment was made by an LLM, it may be inaccurate: |
Nowaker
added a commit
to Nowaker/opencode
that referenced
this pull request
Oct 7, 2026
Add the feature and session records for `timestamps` in tui.json (9163ac0, upstream PR anomalyco#53654 on issue anomalyco#42498), link the turn-timing feature timeline to it, and index both in the forklog README. AI-Model: anthropic/claude-opus-5-5 AI-Variant: high AI-Tool: opencode 1.18.34-vt-126-907b3bc518 AI-Platform: linux AI-Harness: Vibeterm 30e51ce AI-Session-ID: ses_eec3e5569ffe2otGPxp4LBssZb
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue for this PR
Closes #42498
Builds on #53195 (
turn_timing,Locale.todayTimeOrDateFirst); this branch contains that commit, so the diff to review is the last commit only.Type of change
What does this PR do?
Only prompts (
/timestamps) and assistant turn footers (/turn-times,turn_timing.time) can show when something happened. Tool calls, thinking blocks, text blocks, errors and compactions never do, so in a long run there is no way to see when a step finished or how long a tool call ran.This adds a
timestampsoption totui.json. It names the entry types that show a timestamp:"all","none", a comma-separated list such as"user,tool", or an array. The types areuser,assistant,text,reasoning,tool,errorandcompaction.tool: inline rows append· <end> · <duration>, block tools append it to their title (or add a line when they have no title). Both readstate.timeof completed and errored calls throughformatToolTimestamp.reasoning: the time goes before the existing duration (Thought: 8:05 PM · 359ms).text,error: a muted time line under the block or inside the error box.compaction: the time goes in the divider title.user,assistant: the existing prompt time and turn-footer time.All of them use
Locale.todayTimeOrDateFirstfrom #53195: time of day if today, date then time otherwise.When
timestampsis unset nothing changes, and/timestamps,/turn-timesandturn_timing.timework and persist as before. When it is set, the list decides every type each time the TUI starts and overridesturn_timing.time./timestampsand/turn-timesstill flip prompt and turn times, but only until the TUI exits. I didn't let kv win here:kv.jsonusually already contains"timestamps", because the kv store writes its in-memory defaults together with any other key, so a kv-wins rule would make the option do nothing for most existing installs.opencode doesn't ship a commented
tui.jsonctemplate, so the schemadescriptionis the in-editor documentation. It lists every value.tui.mdxgets a Timestamps section with a table of the types.How did you verify your code works?
bun typecheckinpackages/tuiandpackages/opencode(pre-push turbo typecheck: 30/30).timestampsdecoding (all,none, spaced list, array, and rejection of unknown names,all,user, a trailing comma and["all"]);formatToolTimestampfor each tool state; anInlineToolRowrender with a timestamp;loads timestamps configinpackages/opencode/test/config/tui.test.ts. The four plugin-merge failures in that file also fail ondev.XDG_*dirs, against a local OpenAI-compatible fake that streams reasoning, text, two parallel tool calls (glob, bash), a slow bash call, a final answer, a forced 400 error, then/compact. Pane captures:Before, and this branch with
timestampsunset (identical after normalizing durations, at every stage):"timestamps": "all", with a stale{"timestamps":"hide"}inkv.json:"timestamps": "user, tool": prompt times plus tool rows only./timestampshid the prompt times for that run and did not writekv.json.Screenshots / recordings
Text captures above.
Checklist