feat(tui): add tool_output_expanded_default option
Issue for this PR
No existing issue — small, self-contained TUI config addition.
Type of change
- [ ] Bug fix
- [x] New feature
- [ ] Refactor / code improvement
- [ ] Documentation
What does this PR do?
Adds a tool_output_expanded_default option to tui.json. When true, tool and shell-command output renders expanded by default instead of collapsing to a few lines behind "Click to expand". Defaults to false, so behaviour is unchanged unless you opt in.
It sets the initial value of the existing expanded signal in the two output renderers — GenericTool (maxLines 3) and Shell (maxLines 10) in routes/session/index.tsx — from ctx.tui.tool_output_expanded_default instead of hardcoding false. The field is added to the Info schema in config/index.tsx; resolve() already spreads ...input, so it flows through with no extra wiring. The "Click to expand" / "Click to collapse" toggle still works. Reasoning blocks are unaffected — this only touches tool/command output.
How did you verify your code works?
Built locally, set tool_output_expanded_default: true in tui.json, and ran shell commands with long output — they render expanded. Unset / false collapses as before. Also confirmed the generated tui.json schema includes the new key.
Screenshots / recordings
No new UI — the existing expanded output view, just shown by default. Can add a recording if preferred.
Checklist
- [x] I have tested my changes locally
- [x] I have not included unrelated changes in this PR
Automated task review for PR #34246, refreshed 2026-06-28:
- Current
dev:61a7f6db35e1b8284258de247b889edf14748234; PR head:c56aa7e8a5029cad28b8bd71b04bbd50bb06cdf1. - Branch freshness: PR remains 1 commit ahead and 7 commits behind current
dev; merge-base is5d63020dcd0bc75e4c7bdbc1db09c53e3d172dd1. - GitHub state:
mergeable=MERGEABLE, butmergeStateStatus=BLOCKED; review decision is empty and there are no reviews. - Checks: GitHub PR checks currently shown by
gh pr checksare passing:check-duplicates,check-standards,add-contributor-label,check-compliance. - Local merge validation: PR head merged cleanly into current
origin/devin isolated worktree/tmp/opencode-pr34246-validate; diff is limited topackages/tui/src/config/index.tsxandpackages/tui/src/routes/session/index.tsx. - Focused validation passed locally in that worktree:
bun install --frozen-lockfilebun run --cwd packages/tui typecheckbun --cwd packages/tui test test/config.test.tsx(9 pass, 0 fail)bun --cwd packages/opencode test test/config/tui.test.ts(33 pass, 3 skip, 0 fail)bun --cwd packages/tui test test/cli/tui/inline-tool-wrap-snapshot.test.tsx(17 pass, 0 fail, 8 snapshots)git diff --check --cached
- Independent adversarial review found no functional/type code blocker. Low follow-ups: no committed targeted regression test for
tool_output_expanded_default: true, and docs do not mention the new option.
Merge blocker from this session: do not merge while GitHub reports mergeStateStatus=BLOCKED. This authenticated viewer also has repository.viewerPermission=READ; the collaborator permission API returns 403, so this session cannot update the branch or merge the PR. Recommended next step: update/refresh the PR branch or clear the protected-branch blocker/review requirement, then rerun validation before merging.
Automated task review refresh for PR #34246 at 2026-06-28T04:45:35Z:
- Current
dev:dfeb1b5051a05b359bd4af711b204d2c0342c5f4; PR head:c56aa7e8a5029cad28b8bd71b04bbd50bb06cdf1. - Branch freshness: PR is 1 commit ahead and 8 commits behind current
dev; merge-base is5d63020dcd0bc75e4c7bdbc1db09c53e3d172dd1. - GitHub state:
mergeable=MERGEABLE, butmergeStateStatus=BLOCKED;reviewDecisionis empty and there are no reviews. - Checks: GitHub PR checks currently shown by
gh pr checksare passing:check-duplicates,check-standards,add-contributor-label,check-compliance. - Local merge validation: PR head merged cleanly into current
origin/devin isolated worktree/tmp/opencode-pr34246-current.DZOeoN; diff is limited topackages/tui/src/config/index.tsxandpackages/tui/src/routes/session/index.tsx. - Focused validation passed locally in that worktree:
bun install --frozen-lockfilegit diff --check --cachedbun run --cwd packages/tui typecheckbun --cwd packages/tui test test/config.test.tsx(9 pass, 0 fail)bun --cwd packages/opencode test test/config/tui.test.ts(33 pass, 3 skip, 0 fail)bun --cwd packages/tui test test/cli/tui/inline-tool-wrap-snapshot.test.tsx(17 pass, 0 fail, 8 snapshots)
- Independent adversarial verifier found no functional/type/config/UI blocker. Residual non-blocking risks: no direct UI regression for
tool_output_expanded_default: true, generated/public docs/schema not regenerated in this review, and plugin-facingTuiConfigViewdoes not expose the field.
Merge blocker from this session: do not merge while GitHub reports mergeStateStatus=BLOCKED. This authenticated viewer has repository.viewerPermission=READ, viewerCanUpdate=false, and viewerCanEnableAutoMerge=false, so this session cannot refresh the branch or merge the PR. Next step for a maintainer: update/refresh the PR branch or clear the protected-branch/review blocker, then rerun validation before merging.
Automated task review refresh for PR #34246 at 2026-06-28T11:53:34Z:
I did not merge this PR.
Current state:
- Current dev: 6ee817d0416cc902bdf1e05b0a3db1e94d07434a; PR head: c56aa7e8a5029cad28b8bd71b04bbd50bb06cdf1.
- Branch freshness: PR is 1 commit ahead and 9 commits behind current dev; merge-base is 5d63020dcd0bc75e4c7bdbc1db09c53e3d172dd1.
- GitHub state: mergeable=MERGEABLE, but mergeStateStatus=BLOCKED; reviewDecision is empty and there are no reviews.
- Checks shown by gh pr checks are passing: check-duplicates, check-standards, add-contributor-label, check-compliance.
Local validation on a no-commit merge into current origin/dev passed:
-
bun install --frozen-lockfile
-
git diff --check --cached
-
cd packages/tui && bun run typecheck
-
cd packages/tui && bun test test/config.test.tsx (9 pass, 0 fail)
-
cd packages/opencode && bun test test/config/tui.test.ts (33 pass, 3 skip, 0 fail)
-
cd packages/tui && bun test test/cli/tui/inline-tool-wrap-snapshot.test.tsx (17 pass, 0 fail, 8 snapshots) Blockers before merge:
-
Legacy config migration: packages/opencode/src/config/tui-migrate.ts normalizeTui only preserves scroll_speed, scroll_acceleration, and diff_style from legacy opencode.json tui config. With this PR, tui.tool_output_expanded_default in legacy opencode.json would be stripped/ignored rather than migrated into tui.json.
-
Plugin-facing types: plugin api.tuiConfig is typed via PluginConfig['tui'], but generated SDK Config.tui currently only exposes scroll_speed, scroll_acceleration, and diff_style, so plugin authors cannot type-read api.tuiConfig.tool_output_expanded_default.
-
Repository policy/access: this viewer has repository.viewerPermission=READ, viewerCanUpdate=false, and viewerCanEnableAutoMerge=false, so this session cannot refresh the branch or merge even after code fixes.
Next step: add the migration/type coverage fixes or decide those surfaces are intentionally unsupported, clear the blocked review/protection state, update/refresh the branch if required, then rerun validation before merge.
Blocked after current-dev merge review.
Evidence:
- PR is open/non-draft and GitHub reports mergeable, but head
c56aa7e8a5029cad28b8bd71b04bbd50bb06cdf1is 243 commits behind currentorigin/dev(b7e4f1ef7433f83ba009eefa2997aeb81017f6ed). - Local no-commit merge into current
origin/devapplied cleanly. - Validation on the local merge:
packages/tui:bun typecheckpassed;packages/opencode:bun test test/config/tui.test.ts --timeout 30000passed (33 pass, 3 skip);git diff --cached --checkclean.
Blockers before merge:
tool_output_expanded_defaultis added topackages/tui/src/config/index.tsx, but legacy migration inpackages/opencode/src/config/tui-migrate.tsonly preservesscroll_speed,scroll_acceleration, anddiff_stylefrom nested legacyopencode.jsontuiconfig. A legacytui: { tool_output_expanded_default: true }would be dropped during migration.- Current
devhas anexecuterenderer inpackages/tui/src/routes/session/index.tsxthat collapses runtime error output viaoutputPreview = collapseToolOutput(...); this stale PR only wires the new default intoGenericToolandShell, so the new option does not consistently apply to current tool/command output paths. - No regression coverage was added for schema/default loading, legacy migration, or expanded/collapsed TUI output behavior.
Recommendation: update the PR for current dev by carrying the new key through migration, deciding/wiring behavior for Execute, and adding focused tests before merge.