Skip to content

Message timestamp option is missing in OpenCode CLI v2.0.8 #49742

Open

Description

@cateyes99

Description

I'm using OpenCode CLI v2.0.8, and found the option of message timestamps is missing which is inconvenient.

In CLI v1.18.31, pressing Ctrl+P, then can find and toggling the timestamp for each message:

Image Image

But in CLI v2.0.8, it's missing.
Image
Image

Plugins

No response

OpenCode version

2.0.8

Steps to reproduce

No response

Screenshot and/or share link

No response

Operating System

Windows 11

Terminal

Windows Terminal

Activity

  1. argszero commented on Sep 18, 2026

    @argszero
    Contributor

    I'd like to work on this.

    I checked v2 (origin/v2 head db80806651) against the v1 line (production, which is the 1.18.31 you're comparing against) and this is a regression from the v2 rewrite rather than a new feature request: v1 shipped the toggle, and the v2 rewrite dropped all three parts of it.

    What v1 had

    Part v1 location
    Keybinding packages/tui/src/config/keybind.ts:100 — session_toggle_timestamps: keybind("none", "Toggle message timestamps"), mapped to the command id at :307 (session.toggle.timestamps)
    Command palette entry packages/tui/src/routes/session/index.tsx:126 (command id list), :695-701 (title Show timestamps / Hide timestamps, aliases: ["toggle-timestamps"])
    Toggled state packages/tui/src/routes/session/index.tsx:262 — kv.signal<"hide" | "show">("timestamps", "hide")
    Rendering packages/tui/src/routes/session/index.tsx:1440 — <Show when={ctx.showTimestamps()}> printing Locale.todayTimeOrDateTime(props.message.time.created); :1390 (metadataVisible) also gates the spacing above it

    What v2 has now

    • timestamp does not appear anywhere in packages/tui/src except an unrelated comment in component/devtools-bar.tsx:168 — there is no command id, no keybinding, no setting and no render site.
    • The session.toggle.* family exists otherwise and has a consistent shape: session.toggle.thinking (routes/session/index.tsx:953), session.toggle.scrollbar (:967), session.toggle.exploration_grouping (:980), each flipping TUI config through configState.update((draft) => { draft.session = { ...draft.session, ... } }).
    • The config schema has scrollbar (packages/tui/src/config/index.tsx:150), thinking (:151) and grouping (:154), but no timestamps field.
    • Time formatting already exists and is used elsewhere: Locale.time (packages/tui/src/util/locale.ts:7) and Locale.datetime (:12) are called from routes/session/dialog-fork.tsx:68 and routes/session/dialog-timeline.tsx:29. That is exactly why the Timeline popup shows times while the transcript does not.

    Proposed fix (alignment with the existing siblings, no new machinery)

    1. add a boolean to the session block of packages/tui/src/config/index.tsx next to scrollbar;
    2. register session.toggle.timestamps next to session.toggle.scrollbar in routes/session/index.tsx, flipping that value through the same configState.update path;
    3. gate the created-time line in the message row on that value, using the existing Locale.time(message.time.created).

    Cross-references: #43243 asks for the same surface on the v2 line (open since 2026-08-18) — since v1 already shipped it, restoring it is a regression fix rather than a new UI direction; #42782 (24h/locale formatting) would then apply to this surface too.

    One product question I'd rather ask before writing code: should the v2 surface be a palette toggle like v1, or a config-file-only setting? I'll follow whichever you prefer — my default plan is the toggle, matching session.toggle.thinking and session.toggle.scrollbar. Happy to have the issue assigned if that direction looks right.

  2. cateyes99 commented on Sep 19, 2026

    @cateyes99
    Author

    I'd prefer keeping it in the consistent way for both v1 & v2 :)

  3. argszero commented on Sep 19, 2026

    @argszero
    Contributor

    Thanks — that settles my question. I'll keep v2 consistent with v1: the palette toggle, not a config-file-only setting.

    Concretely, matching the existing session.toggle.* siblings on the v2 line — a timestamps boolean in the session block of packages/tui/src/config/index.tsx next to scrollbar; a session.toggle.timestamps command registered beside session.toggle.scrollbar in routes/session/index.tsx, flipping it through the same configState.update path; and the created-time line in the message row gated on it via the existing Locale.time. Same command id as v1's session.toggle.timestamps, so the v1 workflow (and any keybinding you add for it) carries over unchanged.

    I'll open the PR against the v2 line, where the surface was dropped, and cross-reference #43243 and #42782.

  4. DEAD1nsane commented on Oct 1, 2026

    @DEAD1nsane

    Still reproducible on v2.0.21 (Termux, aarch64 Android, 80x24): no /timestamps slash command in the v2 command list (packages/tui/src/app.tsx), no timestamps entry anywhere in the v2 keybind schema, and no message-timestamp rendering path in TUI source at tag v2.0.21 — the only timestamp usages are session-list/stash relative times. Adding a data point that the regression from the rewrite still has not been picked up since the fix plan above.

  5. Maximilian-Pichler commented on Oct 14, 2026

    @Maximilian-Pichler

    I have a V2 version of this working locally and would like to take it on. Here's what it looks like. If the approach works for you, could a maintainer assign this to me? Feedback on the design is welcome.

    • /timestamps toggles it in the session view (same command id as V1, session.toggle.timestamps, no default key). The setting is stored as session.timestamps in cli.json and is off by default.
    • The time is right-aligned on the first line of each user message and on the first row of each agent reply (when the reply finished). Long first lines wrap before the time. With the setting off, nothing changes.
    • Each time only shows what changed since the previous one: nothing within the same minute (so a quick reply doesn't get its own stamp), just the time on the same day, and the day plus time when the day changes: Today 2:36 AM, Sun 2:36 AM within the last week, or Oct 2, 2:35 AM (with the year if it's not the current one). The first time in a session is compared with today.

    Before
    Image
    After
    Image

    More screenshots Image Image Image Image Image

    @argszero you mentioned a V2 PR earlier. If you already started on this, I'm happy to leave it to you or help instead.

  6. DEAD1nsane commented on Oct 15, 2026

    @DEAD1nsane

    I have a V2 version of this working locally and would like to take it on. Here's what it looks like. If the approach works for you, could a maintainer assign this to me? Feedback on the design is welcome.

    • /timestamps toggles it in the session view (same command id as V1, session.toggle.timestamps, no default key). The setting is stored as session.timestamps in cli.json and is off by default.
    • The time is right-aligned on the first line of each user message and on the first row of each agent reply (when the reply finished). Long first lines wrap before the time. With the setting off, nothing changes.
    • Each time only shows what changed since the previous one: nothing within the same minute (so a quick reply doesn't get its own stamp), just the time on the same day, and the day plus time when the day changes: Today 2:36 AM, Sun 2:36 AM within the last week, or Oct 2, 2:35 AM (with the year if it's not the current one). The first time in a session is compared with today.

    Before
    Image
    After
    Image

    More screenshots Image Image Image Image Image

    @argszero you mentioned a V2 PR earlier. If you already started on this, I'm happy to leave it to you or help instead.

    Agree with bringing this back, and the toggle + session.timestamps approach looks right.

    One placement note on the screenshots: in v1 the timestamp sat at the bottom of the user's sent message, which worked well. Right-aligned on the first line feels a bit odd to me — on narrow terminals (e.g. 80x24 on Termux) it competes with long first lines and forces wrapping logic, while bottom placement stays out of the way and matches v1.

    Would it be possible to render it below the message content like v1 did, rather than right-aligned?

  7. HernanVillalba commented on Oct 16, 2026

    @HernanVillalba

    Still missing on v2.0.31 (Windows 11, Windows Terminal): no /timestamps in the command palette, no session.toggle.timestamps binding, and no timestamps field in the cli.json schema served for that build.

    One data point that may help prioritise it: there is no plugin-side workaround. The V2 CLI plugin slot API exposes app, home.footer.*, prompt.footer.*, session.composer.top, session.panel and sidebar.*, with no message-level slot, and timestamp appears nowhere in the plugin types. A plugin can read message.time.created, but it has nowhere to render it on the transcript, so this has to land in the TUI.

    That makes @Maximilian-Pichler's local implementation the only path I can see, and I would like to see it land.

  8. Maximilian-Pichler commented on Oct 17, 2026

    @Maximilian-Pichler

    @rekram1-node i take from the contributing guidelines, that this would need a UI review before implementing anything. is this the right way to do this, or should i ask another maintainer to have a look at it?

    BR Max

  9. joaopaulooooo commented on Oct 21, 2026

    @joaopaulooooo

    Also hit this after moving from v1 (which had the Ctrl+P timestamps toggle). Confirming the data is already available per message in v2 via the API — GET /api/session/<id>/message returns time.created / time.streamed / time.completed for each message. jq workaround while this lands:

    SID=$(opencode api get /api/session | jq -r '.data | sort_by(.time.updated) | last | .id')
    opencode api get "/api/session/$SID/message" | jq -r \
      '.data[] | select(.type=="user" or .type=="assistant")
       | "\(.time.created/1000 | strftime("%d/%m %H:%M:%S")) [\(.type)]"'

    Glad to see a working version in the thread — session.timestamps is exactly the shape I'd expect. 👍

  10. opencodejr commented on Oct 28, 2026

    @opencodejr
    Contributor

    Thanks for the report, @cateyes99, and for the screenshots comparing the two versions.

    In short, you'd like v1's message-timestamp toggle (Ctrl+P → show a timestamp on each message) brought back in v2. v2 is a separate implementation from v1, and it doesn't have this option yet. It wasn't removed by accident, so I've marked this as a feature request. Maintainers will consider it.

    A plugin can't add this for now either, because the v2 TUI plugin API has no hook for rendering content on individual messages.

  11. cep207 commented on Nov 5, 2026

    @cep207

    Same need on the Desktop app side (Windows).

    My workflow keeps day-scoped reports inside long-running sessions; when I scroll
    an older part of a session I can usually see the response duration, but not the
    wall-clock time an exchange happened, so I can't tell "this report was written
    at ~14:00 on 15.09". The v1 /timestamps toggle that v2 dropped covered exactly
    this.

    Plan above (API isPartial: true + session.timestamps config) fully matches
    my usage. One request: when porting the toggle back, please cover the Desktop
    chat surface
    too, not only the TUI — the desktop transcript renderer has the
    same gap and no toggle today.

  12. sagaciouszu commented on Nov 10, 2026

    @sagaciouszu

    Adding the use case from #63016 (closed as a duplicate of this issue):

    I run long sessions and need to correlate transcript messages with external events and logs — when something fails outside OpenCode (CI, a service, another terminal), there is no way to tell when a given message was produced. The v1 toggle fixed exactly that; without it the opencode api + jq workaround means scripting a query for every "what happened around 14:32?" instead of just reading the transcript.

    Environment: v2 on Linux, terminal UI (matches the regression description — worked in v1.18.31, gone in v2). Happy to test a build once the session.timestamps + palette toggle lands.

  13. Lauri-Nomme commented on Nov 12, 2026

    @Lauri-Nomme

    +1 on restoring this in v2, with one requirement the current proposals don't fully cover: the format.

    • I need ISO 8601 with full date and time (2026-11-13T09:41:07+02:00), not hh:mm or a localized date, so transcript lines can be matched against external logs/CI output and parsed unambiguously across DST and timezone changes.
    • It should apply to both user and assistant messages (ideally tool/thinking lines too), not only the assistant footer after completion. session.date_format: "iso" in feat(tui): add configurable reply timestamps #62530 renders a date only, and that PR covers the assistant footer only.
    • The data already exists: time.created on every message from GET /api/session/{id}/message.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions