GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — feat(app): let GUI plugins render tool results by Hona · Pull Request #61536 · anomalyco/opencode Conversation
|
Before (dev) |
After: default row | After: demo plugin for jira_* |
|---|---|---|
![]() |
![]() |
![]() |
These numbers come from a story that mounts 600 collapsed MCP tool rows, measured from the click through a forced layout. The runs alternated between the two variants, and the tables show medians.
| Registry lookup, same build (n=20 pairs) | Mount | Script | DOM nodes |
|---|---|---|---|
| No tool renderers provided | 224.2 ms | 197.9 ms | 16,821 |
| Host index provided, no row matches | 224.0 ms | 196.5 ms | 16,821 |
Rows vs dev (n=24 pairs) |
Mount | Script | DOM nodes |
|---|---|---|---|
dev (rows can't expand) |
251.1 ms | 224.3 ms | 12,638 |
| This PR | 318.4 ms | 277.0 ms | 16,821 |
Map.get plus a scan of the * patterns. It costs nothing measurable. Built-in rows skip the lookup.dev within noise (217.0 vs 221.3 ms, equal node count).render mount only after the row expands. File views, diagnostics and image loads start there too. The virtualizer's row observer picks up height changes.bun run bench:tabs). Its stable-timeline wait times out on this Windows machine even on dev.Closes #55961
Closes #57180
Part of #21227: images now show for plugin and MCP tools. The built-in webfetch row still hides attachments.
<svg xmlns="http://www.w3.org/2000/svg" width="240" height="72" viewBox="0 0 240 72" fill="none"> <defs> <clipPath id="body"> <rect x="0" y="22" width="240" height="50"> <animate attributeName="height" values="0;0;50;50;0" keyTimes="0;0.15;0.35;0.85;1" dur="4s" repeatCount="indefinite" /> </rect> </clipPath> </defs> <g fill="currentColor"> <path d="M14 7l5 4-5 4z" opacity="0.5" transform="rotate(90 16 11)"> <animateTransform attributeName="transform" type="rotate" values="0 16 11;0 16 11;90 16 11;90 16 11;0 16 11" keyTimes="0;0.15;0.35;0.85;1" dur="4s" repeatCount="indefinite" /> </path> <rect x="26" y="7" width="72" height="8" rx="2" opacity="0.8" /> <rect x="104" y="7" width="56" height="8" rx="2" opacity="0.35" /> <rect x="166" y="7" width="22" height="8" rx="2" opacity="0.2" /> </g> <g clip-path="url(#body)" fill="currentColor"> <rect x="16" y="24" width="1" height="44" opacity="0.25" /> <rect x="26" y="26" width="30" height="5" rx="1.5" opacity="0.35" /> <rect x="60" y="26" width="84" height="5" rx="1.5" opacity="0.6" /> <rect x="26" y="36" width="120" height="16" rx="3" opacity="0.08" stroke="currentColor" stroke-opacity="0.3" /> <rect x="31" y="41" width="70" height="2" opacity="0.5" /> <rect x="31" y="46" width="48" height="2" opacity="0.5" /> <rect x="156" y="26" width="40" height="30" rx="3" opacity="0.12" stroke="currentColor" stroke-opacity="0.35" /> <path d="M160 52l9-11 7 7 5-5 11 9z" opacity="0.45" /> <circle cx="186" cy="33" r="3" opacity="0.45" /> <rect x="26" y="58" width="164" height="8" rx="2" fill="currentColor" opacity="0.1" /> <rect x="30" y="60.5" width="40" height="3" rx="1" opacity="0.55" /> </g> </svg>
Added by the opencode bot (AI-generated).
Related: #21227, #54703, #57818
Public API: adds the ToolRenderer registry and ToolCall/ToolCallFile/ToolCallStatus/ToolRenderProps/ToolTrigger types to @opencode/plugin/gui (backwards compatible)
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
I could not verify this by running it. The change is only visible in the web/desktop app, and this environment has no browser for the app or the Playwright component tests. Type checks pass for session-ui, app and plugin, and the session-ui unit tests pass. The rest of the review is from reading the code: matching, precedence, per-row isolation and the on-demand image reload all look right.
Public API: this adds to the GUI plugin API in @opencode/plugin/gui. It adds the ToolRenderer registry ({ tool, trigger?, render? }) and the types ToolCall, ToolCallFile, ToolCallStatus, ToolRenderProps and ToolTrigger. Inside the monorepo, session-ui gets an optional readToolFiles prop on DataProvider and a new context/tools module. Nothing is removed or changed, so it is backwards compatible.
One concern: when a plugin's renderer matches a tool that failed, the error card is no longer shown (inline comment).
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| <Show when={!hideQuestion()}> | ||
| <div data-component="tool-part-wrapper" data-timeline-part-id={props.id}> | ||
| <Switch> | ||
| <Match when={view()} keyed> |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
This Match comes before error(), so a tool row that a plugin matches never gets the error card that every other row gets. BasicTool has no visual error state, so a failed call looks like a success in its collapsed row. The message only appears in the default body after you expand the row. If the plugin provides render, the message is never shown unless the plugin renders props.tool.error itself. Could the row keep the error card on failure (for example, try the plugin view only when !error(), or at least on the trigger), so a plugin can't hide tool failures by accident?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
web: tool-result metadata.diagnostics renders in TUI but is dropped in the web timeline [BUG]: V2 web app: plugin and MCP tool calls can't be expanded, so their input and output are not shown
There was an error while loading. Please reload this page.