Skip to content

About

Fold OpenCode reasoning, progress and tools into expandable Pi-style Run summaries. Keep questions and final answers visible.

Resources

Stars

7 stars

Watchers

1 watching

Forks

Repository files navigation

OpenCode Run Groups

Keep the question and final answer visible. Fold the reasoning, progress updates, and tool calls into a compact, expandable Run summary.

Independent community fork of opencode-fold-tools v0.1.1, inspired by Pi's aggregate display. Tiếng Việt · Credits

Your question

▸ ✓ Run (9 calls · 8 turns) · bash ×7 · task ×2
  took 2m14s · tok ↑5.3k ↓9.1k R1.9M · $0.052 · at 2026-09-13 12:00:00
  model provider/model-name · subagents 2 calls · 2 sessions

The final answer

Illustrative values. The status line uses the theme's status color; metadata uses muted text. Expanded runs reveal the original reasoning and progress text alongside individually expandable tools.

Install from GitHub

Tested with OpenCode 1.18.29. The installer/tests require Node.js 22+ and Git.

git clone --branch v0.3.1 https://github.com/nguyenngothuong/opencode-run-groups.git
cd opencode-run-groups
npm ci --ignore-scripts
npm run install:plugin

Restart OpenCode. Keep the checkout: the installer registers its absolute index.js file URL in your global tui.json or tui.jsonc. No npm release is published.

The installer backs up existing configuration, preserves JSONC comments and other settings, and replaces an npm opencode-fold-tools entry with this fork. If you use a local checkout of upstream, opencode-fold-diffs, or another tool-row renderer, remove/disable that entry first. Do not load multiple tool-row renderers together.

For a custom configuration:

npm run install:plugin -- --config /path/to/tui.jsonc

If both tui.json and tui.jsonc exist, select one explicitly. This extension does not change provider/model settings, execute tool calls, or rewrite your session history.

Use

  • Click the Run header to expand/collapse the whole processing sequence.
  • Inside an expanded run, click a tool to inspect its output; native file diffs and subtask links are inherited from upstream.
  • Ctrl+O expands/collapses all runs without automatically opening every output panel.
  • The plugin registers Xem tất cả tool (all tool details) as a fallback command for inspecting tool records the row matcher cannot render inline.
  • Some inherited detail messages remain in Chinese; custom commands and warnings are Vietnamese. Tool names and output keep their original text.

An assistant message is treated as a final answer only when it has completed and its finish reason is neither tool-calls nor unknown. Ordinary progress text stays inside the folded run. While waiting for final-answer nodes to mount, already-folded progress stays folded and unrecognized new content stays visible. An assistant error restores native content for inspection.

Read the summary

Field Meaning
calls Tool calls recorded in the loaded portion of this user turn
turns Assistant messages in that turn, including the final answer
took / elapsed User-message timestamp to completion / current time
↑ / ↓ Recorded input / output tokens
R / W Cache read / cache write tokens
think Recorded reasoning tokens, shown separately; not added to output again
cost Sum of recorded costs in the parent turn
model Provider/model IDs used by the parent turn
subagents Number of task calls, plus unique child sessions when IDs exist

Usage/cost totals cover the parent turn. Child-session usage is not fetched or added. Agents launched indirectly through shell commands cannot be counted reliably. Missing values are omitted; partially loaded history is marked lịch sử chưa đủ. Times use your machine's timezone.

Limits and validation

This plugin modifies OpenCode's internal render tree, not the executable. Compatibility with other OpenCode versions, terminals, and future updates is not guaranteed.

  • Eleven automated tests cover grouping/final-answer handling, UI visibility/restoration, streaming update ordering, metrics, and configuration installation/removal.
  • v0.3.1 reconciles visibility before OpenTUI layout and batches events per frame. A local PTY test inserting 40 synthetic streaming rows emitted all 40 rows to the terminal with v0.3.0, and none while collapsed with v0.3.1. This is a rendering regression check, not a model/API or general speed benchmark.
  • Local OpenCode 1.18.29 PTY checks exercised nested tool expansion and whole-run toggling with synthetic data.
  • An isolated private-session copy retained all eight loaded final-answer blocks through collapse/expand/collapse. One leading thinking line remained visible where paginated history lacked a usable anchor. The private data is not in this repository.
  • Full-history edge cases and long-running memory/performance still need broader testing. Earlier 300-tool latency measurements applied to the simpler tool-only prototype, so this version makes no numerical speedup claim.
  • The plugin can display only data OpenCode retains; compacted/truncated output cannot be recovered.
npm run check

Tests use synthetic fixtures and do not call model APIs. CI runs syntax checks and the test suite.

Uninstall / return to upstream

From this checkout:

npm run uninstall:plugin

Pass the same -- --config ... if you used a custom path. Restart OpenCode. The uninstaller removes only this fork's matching entry. You can then reinstall upstream:

opencode plugin opencode-fold-tools@0.1.1 -g

If the checkout was moved or deleted, remove its old file URL manually from the TUI plugin array. To update this pinned checkout, fetch tags and check out a reviewed newer release, then run npm ci --ignore-scripts and restart OpenCode.

License

MIT. Upstream tool-row rendering by ningzimu, with original Tanner Bruhn / tanman24 attribution preserved. Fork additions by nguyenngothuong. See LICENSE and THIRD_PARTY_NOTICES.md. This is not an official OpenCode or Pi product.

About

Fold OpenCode reasoning, progress and tools into expandable Pi-style Run summaries. Keep questions and final answers visible.

Resources

Stars

7 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages