Skip to content

Commit 33e5ad0

Browse files
committed
docs(forklog): record per-turn completion time and duration
17dca85 adds turn_timing.time / turn_timing.duration to tui.json and the /turn-times and /turn-durations toggles, so every assistant turn can show when it finished and how long it took, and the final turn also keeps the total since the prompt. Defaults stay as upstream. Offered upstream as issue anomalyco#53192 and PR anomalyco#53195. 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
1 parent 8ba308a commit 33e5ad0

3 files changed

Lines changed: 195 additions & 0 deletions

File tree

‎.vibeterm/forklog/README.md‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ carries every feature forward unchanged. That commit includes the full
4444
- [Reopen opencode.log after an external rotation](./features/2026-10-03-log-reopen.md)
4545
- [One-line "LSPs are disabled" in the sidebar](./features/2026-10-04-sidebar-lsp-disabled-oneline.md)
4646
- [Keep the scroll position when a prompt is submitted](./features/2026-10-04-keep-scroll-on-submit.md)
47+
- [Per-turn completion time and duration in the TUI](./features/2026-10-04-tui-turn-timing.md)
4748

4849
## Session records
4950

@@ -61,6 +62,11 @@ carries every feature forward unchanged. That commit includes the full
6162
- Fold the sidebar's "LSPs are disabled" into the LSP heading line;
6263
upstream issue #53183 and PR #53185.
6364

65+
- [2026-10-04 `ses_ef81c1485ffeC5Sb59U9mVI77g`](./sessions/2026-10-04-tui-turn-timing.md)
66+
- Show completion time and duration on every assistant turn and the total
67+
on the final one (`turn_timing`, `/turn-times`, `/turn-durations`);
68+
upstream issue #53192 and PR #53195.
69+
6470
- [2026-10-03 `ses_efb698c02ffefXlxsxKlISKpRH`](./sessions/2026-10-03-log-reopen.md)
6571
- Reopen `opencode.log` when a rotator renames or deletes it, so
6672
rename-based rotation is lossless; build and install on desktop and
Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
# Per-turn completion time and duration in the TUI
2+
3+
## Identity
4+
5+
- Status: active
6+
- Integration branch: `dev-nowaker`
7+
- Development branch(es): `tui-turn-timing` (off upstream `dev` `907b3bc518`; also the upstream PR head)
8+
- First local commit: `17dca85fb5`
9+
- Current local commit(s): `17dca85fb5`
10+
- Upstream base when introduced: `907b3bc518` (upstream `dev`)
11+
- Last checked against upstream: `907b3bc518` (upstream `dev`)
12+
- Upstream: issue [#53192](https://github.com/anomalyco/opencode/issues/53192), PR [#53195](https://github.com/anomalyco/opencode/pull/53195)
13+
14+
## Original request
15+
16+
Relayed by coordinator `ses_ef8235798ffejGr4sa22eXmVNv` (effort item 3),
17+
quoting the user:
18+
19+
> each ai turn should show time (if today), datetime (if not today) and how
20+
> long it took (e.g. 2h3m). additionally, final ai messages (after a series of
21+
> turns), should have both the time it took to generate final response AND the
22+
> entire interaction since the prompt that triggered this turn. configurable in
23+
> tui and in /tui commands. defaults: matching current defaults, whatever they
24+
> are.
25+
26+
## Goals
27+
28+
- Every completed assistant turn can show when it finished
29+
(`Locale.todayTimeOrDateTime`: time of day if today, date and time
30+
otherwise) and how long it took (`completed - created`).
31+
- The final turn shows its own duration and keeps the existing total since
32+
the prompt, labelled `total`.
33+
- Configurable in `tui.json` and toggleable at runtime.
34+
35+
## Non-goals
36+
37+
- Defaults unchanged: both options off, so only the final message has a
38+
footer with the total, as upstream.
39+
- Duration format stays upstream `Locale.duration` (`8.3s`, `3m 12s`,
40+
`2h 3m`); not reformatted to `2h3m`.
41+
- No change to `/timestamps`, which still covers user messages only.
42+
43+
## Rationale and constraints
44+
45+
- Vanilla `907b3bc518` renders no footer on intermediate tool-call turns and
46+
only the prompt-to-completion total on the final one.
47+
- Two independent booleans, `turn_timing.time` and `turn_timing.duration`,
48+
instead of a mode enum: the two facts are wanted independently.
49+
- Runtime toggles `/turn-times` and `/turn-durations` (palette entries,
50+
keybinds `session_toggle_turn_time` / `session_toggle_turn_duration`,
51+
default `none`). A toggled value persists in `kv.json` and wins over
52+
`tui.json`, which only supplies the default; the value is read with
53+
`kv.get` rather than `kv.signal` so the default is never written to kv.
54+
55+
## Changes
56+
57+
| Commit | Workday | Change | Stable seam |
58+
|---|---|---|---|
59+
| `17dca85fb5` | 2026-10-04 | `turn_timing` schema; `showTurnTime` / `showTurnDuration` memos, palette/slash commands, context fields; `AssistantMessage` footer shown for every completed turn when either is on, with time, per-turn duration and `total` suffix; docs and config test | `TurnTiming` in `packages/tui/src/config/index.tsx`; `AssistantMessage` footer in `packages/tui/src/routes/session/index.tsx`; `packages/tui/src/config/keybind.ts` |
60+
61+
## Verification
62+
63+
- `bun typecheck` in `packages/tui` and `packages/opencode` - exit 0 on
64+
`tui-turn-timing` and on the landing branch.
65+
- `packages/opencode/test/config/tui.test.ts`: new `loads turn timing config`
66+
passes (30 pass); 4 plugin-merge tests fail identically on pristine
67+
`907b3bc518`. `packages/tui/test/config.test.tsx` 9/9.
68+
- Manual surface: `bun dev` in throwaway tmux socket `oc-tui-timing`
69+
(140x50), isolated `XDG_*` dirs, a fake OpenAI-compatible provider that
70+
answers each prompt with two `glob` tool-call steps and a final text step.
71+
Vanilla: only `▣ Build · Fake · 15.8s` on the final message. Patched with
72+
defaults: identical. Both toggles on: `· 1:07 PM · 8.3s`, `· 1:07 PM ·
73+
3.5s`, `· 1:07 PM · 3.7s · 15.6s total`. Time only: `· 1:07 PM` on each,
74+
final `· 1:07 PM · 15.6s`. `tui.json` `{"turn_timing":{"duration":true}}`
75+
with no kv override, after restart: durations shown from the start.
76+
77+
## Timeline
78+
79+
- 2026-10-04
80+
[`ses_ef81c1485ffeC5Sb59U9mVI77g`](../sessions/2026-10-04-tui-turn-timing.md)
81+
- `17dca85fb5`: introduce (cherry-pick of `2fda6d8d7a`, conflicts with
82+
`keep_scroll_on_submit` resolved by keeping both); open upstream issue
83+
#53192 and PR #53195.
84+
85+
## Current maintenance notes
86+
87+
- Drop the fork commit once PR #53195 (or an equivalent) is in upstream `dev`.
88+
- Adjacent to `keep_scroll_on_submit` in the `Info` schema and the session
89+
command list; an upstream bump touching either may conflict textually.
90+
91+
### Upstream integration checklist
92+
93+
- Locate `TurnTiming` and `turn_timing` in `packages/tui/src/config/index.tsx`.
94+
- Locate `showTurnTime`, `showTurnDuration` and the `completed` memo in
95+
`packages/tui/src/routes/session/index.tsx`.
96+
- Run `bun typecheck` in `packages/tui`.
97+
- Run `/turn-times` and `/turn-durations` on a multi-step turn and check
98+
every assistant footer.
99+
- Link a new timeline row to the current session record.
100+
101+
## Supersession or removal
102+
103+
- Not applicable; status is active.
Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
# Per-turn completion time and duration in the TUI
2+
3+
## Identity
4+
5+
- Workday: 2026-10-04
6+
- Session: `ses_ef81c1485ffeC5Sb59U9mVI77g`
7+
- Agent/platform: `Sisyphus - ultraworker` on `anthropic/claude-opus-5-5` (variant high) / linux, Vibeterm
8+
- Repository: `~/projekty/webapps/opencode`
9+
- Integration branch: `dev-nowaker`
10+
- Development branch(es): `tui-turn-timing` (worktree under `.vibeterm/worktrees/`, off upstream `dev` `907b3bc518`); landing worktree `tui-turn-timing-land` off `dev-nowaker` `35bba9112a`
11+
- Upstream base: `907b3bc518` (upstream `dev`); unchanged
12+
- Source result commit(s): `17dca85fb5` (cherry-pick of `2fda6d8d7a` on `tui-turn-timing`)
13+
- Forklog commit: this file's introducing commit
14+
15+
## User requests
16+
17+
Spawned by coordinator `ses_ef8235798ffejGr4sa22eXmVNv` as effort item 3
18+
("opencode TUI improvements"), quoting the user:
19+
20+
> each ai turn should show time (if today), datetime (if not today) and how
21+
> long it took (e.g. 2h3m). additionally, final ai messages (after a series of
22+
> turns), should have both the time it took to generate final response AND the
23+
> entire interaction since the prompt that triggered this turn. configurable in
24+
> tui and in /tui commands. defaults: matching current defaults, whatever they
25+
> are.
26+
27+
## Goals
28+
29+
- Per-turn completion time and duration, final turn also showing the total.
30+
- `tui.json` option plus runtime slash/palette toggles; defaults unchanged.
31+
- Same change offered upstream.
32+
33+
## Constraints and non-goals
34+
35+
- Vanilla defaults documented first: `/timestamps` (kv `timestamps`, default
36+
`hide`) shows times on user messages only; the assistant footer
37+
(`▣ Mode · model · total`) appears only on the last/final/interrupted
38+
message, with the total since the prompt.
39+
- Landed only after the reintegration session
40+
`ses_ef81db9cdffe5vRz7Y2HqCmvNs` declared `dev-nowaker` final.
41+
- No TUI tab or vibeterm tmux server restarted.
42+
43+
## Branch and upstream movement
44+
45+
| Repository | Branch | Before | After | Action |
46+
|---|---|---|---|---|
47+
| `opencode` | `dev-nowaker` | `35bba9112a` | `17dca85fb5` + this forklog commit | cherry-pick from `tui-turn-timing` (conflicts with `keep_scroll_on_submit` resolved by keeping both), fast-forward; pushed to `origin` and `nowaker-github` |
48+
| `opencode` (GitHub fork) | `tui-turn-timing` | - | `2fda6d8d7a` | new branch off upstream `dev` `907b3bc518`; head of PR #53195 |
49+
50+
## Features touched
51+
52+
| Feature | Outcome | Evidence |
53+
|---|---|---|
54+
| [Per-turn completion time and duration in the TUI](../features/2026-10-04-tui-turn-timing.md) | introduced | typecheck; config test; before/after tmux frames |
55+
56+
## Other delivered work
57+
58+
- Upstream issue [#53192](https://github.com/anomalyco/opencode/issues/53192)
59+
(issue-first policy; related #43243, #35348) and PR
60+
[#53195](https://github.com/anomalyco/opencode/pull/53195).
61+
62+
## Verification
63+
64+
- `bun typecheck` in `packages/tui` and `packages/opencode` - exit 0 on both
65+
branches.
66+
- `packages/opencode/test/config/tui.test.ts` - 30 pass, 4 fail; the same 4
67+
plugin-merge tests fail on pristine `907b3bc518` (29 pass without the new
68+
test). `packages/tui/test/config.test.tsx` - 9/9.
69+
- Manual surface: see the feature record; vanilla and patched-default frames
70+
identical, both toggles, time-only, and `tui.json` default checked.
71+
72+
## Build and install
73+
74+
- Recorded by this session's follow-up forklog commit, after the build on
75+
both hosts.
76+
77+
## Commit provenance
78+
79+
- `17dca85fb5` - TUI change, docs, config test.
80+
- Required trailer: `AI-Session-ID: ses_ef81c1485ffeC5Sb59U9mVI77g`
81+
82+
## Unknowns and blocked verification
83+
84+
- `/tmp` is a nearly full tmpfs with a user quota; zsh heredocs there failed
85+
with "disk quota exceeded" and left empty files. Scratch moved into the
86+
worktree's `tmp/`.

0 commit comments

Comments
 (0)