Skip to content

[FEATURE]: TUI: collapse a finished turn into one group, keeping only the final message visible #59721

Open

Description

@VictorVow

Feature hasn't been suggested before.

  • I have verified this feature I'm about to request hasn't been suggested before.

Describe the enhancement you want to request

Version: opencode v2.1.4 (CLI/TUI)

Related: #49088 asks for the same layout in Desktop. #54515 asks for auto-collapsing individual tool groups. This request is the per-turn version for the TUI, plus a plugin-API alternative.

Problem

In a long agent turn, the TUI transcript keeps everything the agent did above the answer. session.verbosity gives some control over this:

  • high / medium: every tool call, reasoning block and intermediate text part is shown.
  • low: each run of tool calls/reasoning folds into its own activity group, but any text the agent writes between runs stays visible. A 20-step turn still leaves a long trail of "Now I'll check X…" lines above the answer.

None of these give the layout that works best for reading a session afterwards: show everything live while the turn is running, then fold the whole finished turn into a single collapsed group with only the final assistant message visible. Orca's native chat view for opencode2 renders turns this way, and it's much easier to scan.

Proposal

Either of these would solve it:

  1. A per-turn collapse mode, e.g. session.verbosity: "turn" (or session.collapse: "turn"). While a turn is running, render it as high does. Once the turn ends (finish reason not tool-calls, or the idle marker), put every part of that turn except the last text part into one activity group that starts collapsed. This looks like a small change to the transcript builder: low already gives tool/reasoning parts the ["activity"] group path, and this would also give it to the non-final text parts of a completed turn.

  2. A transcript slot for TUI plugins. Right now ctx.ui.slot() can only target app, home.footer*, prompt.footer*, session.composer.top, session.panel and sidebar.*, and plugins can't reach the group-expansion state. A slot or hook around transcript rows/groups, or exposing groupExpanded / setGroupExpanded to plugins, would let this be done as a plugin.

Current workaround

A TUI plugin that dispatches session.verbosity.cycle to switch to high while the routed session is busy and back to low when it goes idle (it reads the current level from the command's palette title). This works, but verbosity is global (older turns expand while a new turn runs), every switch writes cli.json, and intermediate text still stays visible after the turn ends.

Activity

  1. opencodejr commented on Oct 27, 2026

    @opencodejr

    Thanks for the detailed request! In short, you'd like the TUI to show everything live while a turn is running, then fold the whole finished turn into one collapsed group with only the final assistant message visible. That could be a new mode such as session.verbosity: "turn", or a TUI plugin API that can reach transcript rows and groups.

    You're right about how low works today: only tool and reasoning parts get the activity group, and text written between them stays visible. That is by design, so this would be a new mode rather than a fix. It also can't be done cleanly as a plugin yet, because the TUI plugin slots don't include the transcript and plugins can't control whether a group is expanded. I've passed both options to the maintainers, who will consider them.

    Related issues:

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions