Repository navigation
Conversation
Contributor
|
The following comment was made by an LLM, it may be inaccurate: |
Nowaker
added a commit
to Nowaker/opencode
that referenced
this pull request
Oct 12, 2026
Feature and session records for the bash, heredoc, file language and tool input coloring (dfbf7f6..8a360b4), upstream PRs anomalyco#54704-anomalyco#54707 and the vt-238 install on desktop and m4max. AI-Model: anthropic/claude-opus-5-5 AI-Variant: high AI-Tool: opencode 1.19.0-vt-227-dfb56f76c7 AI-Platform: linux AI-Harness: Vibeterm e8a9833 AI-Session-ID: ses_ed1e2b932ffe6tTqhsOiGuYXRE
Nowaker
force-pushed
the
tool-input-block
branch
from
October 12, 2026 07:48
5fa8131 to
02be940
Compare
Nowaker
added a commit
to Nowaker/opencode
that referenced
this pull request
Oct 12, 2026
The colored bash command now lays out byte-identically to the plain one, and tool-call code never draws in red (b236851, 91e33c5); upstream branches amended, PRs anomalyco#54704, anomalyco#54705 and anomalyco#54707 updated, vt-241 on desktop and m4max. AI-Model: anthropic/claude-opus-5-5 AI-Variant: high AI-Tool: opencode 1.19.0-vt-227-dfb56f76c7 AI-Platform: linux AI-Harness: Vibeterm e6434eb AI-Session-ID: ses_ed1e2b932ffe6tTqhsOiGuYXRE
Nowaker
force-pushed
the
tool-input-block
branch
from
October 12, 2026 18:55
02be940 to
491363e
Compare
Nowaker
added a commit
to Nowaker/opencode
that referenced
this pull request
Oct 12, 2026
Session record for 2026-10-12: collapsed tool input shows every value on one row, lists in compact YAML (84d27d0), PR anomalyco#54707 amended, vt-243 on desktop and m4max. AI-Model: anthropic/claude-opus-5-5 AI-Variant: high AI-Tool: opencode 1.19.0-vt-227-dfb56f76c7 AI-Platform: linux AI-Harness: Vibeterm e6434eb AI-Session-ID: ses_ed1e2b932ffe6tTqhsOiGuYXRE
A plugin or MCP tool's input is shown as `[key=value, ...]` on the tool's line, and only its primitive values: an object or array argument disappears, and a long or multi-line string runs on as one line with its escapes. A tenth of these calls pass nested input and a tenth carry multi-line text. With `syntax.tool_input: true` in tui.json, input that is all primitives and fits 80 characters keeps that one line. Anything else becomes a block (packages/tui/src/util/tool-input.ts): one key per row, keys and values in different colors and values colored by type, strings unquoted with their newlines, tabs and quotes as themselves, a multi-line string as indented lines under its key, nested objects indented under their key, and lists in compact YAML: `- ` items at their key's indent, an item's other keys aligned under its first. Until the block is clicked, every value takes exactly one row, cut with a muted `…` where it stops fitting; the width is the block's measured width, taken on layout and on resize only. Clicking shows every value whole, together with the output. Keys and values never draw in red, which in the transcript means a failed tool call: the colors come from packages/tui/src/theme/tool-code.ts, where every syntax slot that is red, or the theme's error color, takes a non-red alternative. Keys use the property color (syntaxVariable), which falls back to the function color, then the type color, in themes where it is red. The setting defaults to false, so the transcript looks as it does now. The generic output toggle hides a tool's response, and the block must not lose it: when the toggle is off, a call with a response still shows "Click to expand", and expanding draws the response under the input (`toolOutputReach`); an input short enough for one line expands from its row. Without `syntax.tool_input` the toggle stays in charge.
Nowaker
force-pushed
the
tool-input-block
branch
from
October 13, 2026 00:32
491363e to
6164eba
Compare
Nowaker
added a commit
to Nowaker/opencode
that referenced
this pull request
Oct 13, 2026
Perplexity and other plugin/MCP responses were unreachable under the tool input block with the generic output toggle off (4c00002); PR anomalyco#54707 amended; vt-257 on desktop and m4max. AI-Model: anthropic/claude-opus-5-5 AI-Variant: high AI-Tool: opencode 1.19.0-vt-227-dfb56f76c7 AI-Platform: linux AI-Harness: Vibeterm 41f09c2 AI-Session-ID: ses_ed1e2b932ffe6tTqhsOiGuYXRE
4 of 6 tasks
Author
|
Closing: this targets the v1 TUI, which upstream now maintains for critical fixes only, so it is not going to be merged. The branch stays on Nowaker/opencode if anyone wants to pick it up. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Note: I'm aware v1 is now the maintenance branch and new features go to v2 only. This PR is here for others to use, and I'll submit the v2 version once I've migrated my whole plugin system to it.
Issue for this PR
Closes #54703
Type of change
What does this PR do?
With
syntax.tool_input: truein tui.json, a plugin or MCP tool's input that is all primitives and fits 80 characters keeps today's[key=value]line. Anything else becomes a block (util/tool-input.ts): one key per row, keys and values in different colors, values colored by type, strings unquoted with their newlines, tabs and quotes as themselves, nested objects indented under their key, and lists in compact YAML (-items at their key's indent). Until the block is clicked, every value takes exactly one row, cut with a muted…where it stops fitting, so the collapsed block shows keys and the start of each value; the width is the block's measured width, taken on layout and resize only. Clicking shows everything whole.Keys and values never draw in red, which means a failed tool call in the transcript: the colors come from
theme/tool-code.ts(shared with #54704), where every red or error-colored syntax slot takes a non-red alternative. Keys use the property color, falling back to the function color, then the type color.When the generic output toggle is off, a call with a response still shows "Click to expand", and expanding draws the response under the input, so the block never leaves a stored response unreachable (
toolOutputReach). Withoutsyntax.tool_inputthe toggle stays in charge as today.Off by default, so the transcript looks as it does now. Documented in tui.mdx.
How did you verify your code works?
bun typecheck;bun test test/util test/config.test.tsx test/cli/tui test/tool-code-theme.test.ts: 117 pass, including collapsed render frames at 40, 80 and 160 columns (one row per value, never wider than the block), the compact YAML layout, cutting by display width, and a check of every built-in theme for red slots.syntax.tool_inputoff the inline row is unchanged.Screenshots / recordings
Collapsed, at 80 columns:
Checklist
This PR is AI generated, but under direct supervision and on request of @Nowaker.