Skip to content

fix(session-ui): reveal generic tool inputs and output - #58498

Open
as992949791 wants to merge 3 commits into
anomalyco:devfrom
as992949791:generic-tool-disclosure
Open

as992949791 wants to merge 3 commits into
anomalyco:devfrom
as992949791:generic-tool-disclosure

Conversation

@as992949791

@as992949791 as992949791 commented Oct 23, 2026 •

Copy link
Copy Markdown

Issue for this PR

Closes #55961

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

Restore collapsed input/output details for plugin and MCP tools without a dedicated renderer. ToolDisplay → GenericTool → BasicTool now reveals complete input values and literal text output while keeping the compact header.

Reversible UI change; scope is fallback tool details and one English label. Codex assisted implementation and verification.

How did you verify your code works?

Merged dev at 44fc9d2, retaining its schema-checked input type and the reviewed disclosure behavior. The string-rendering expression now follows the current schema-decoder lint rule.

  • Before: the real ToolDisplay regression fails on current dev because clicking creates no details. After: all 6 focused cases pass, with 40/40 repetitions and a 4× CPU rehearsal.
  • Cold component suites: 156 session-ui and 122 app tests pass on the final merged tree.
  • Unit tests: 268 session-ui and 162 UI tests pass.
  • Affected-package Bun and official compiler checks, both root check commands (34 packages), warning-free changed-file lint, formatting, UI build and Storybook build pass locally.

Screenshots / recordings

Native component fixture with synthetic data.

Before:
Before

After opening:
After

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

@opencode-agent opencode-agent Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I checked this with the component test it adds, which goes through the real ToolDisplay → GenericTool path in Chromium. On the base, its main case fails because the row has no expandable content. With this change all 8 tests in basic-tool.spec.ts pass, and the session-ui unit tests and tsc -b are clean. I couldn't run the issue's full web-UI script end to end in this environment, so I have no before/after screenshots of the app; yours cover that.

The change looks sound. ToolDisplay already passes output. The row stays collapsed by default, can't be opened while the tool is running, and has no arrow when it's hidden or empty. Inputs are shown as plain text or JSON, and so is the output, so nothing in them is rendered as HTML.

Public API: unchanged.

The only request is to make the new component test smaller (see inline).

})

for (const scenario of ["input", "output", "empty", "hidden", "running"] as const) {
story(`preserves generic tool details for ${scenario} calls`, async ({ mount, page }) => {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These six stories, with a fixture that switches between six scenarios and branches inside the loop, are a lot of test for a small change, and they're hard to follow. Could you cut it down to the core case? Mount a tool with a multi-line string input and an output, click to open, then check that the full input and the output are visible and that the output is shown as plain text. You could add one check that an empty tool has no arrow. The running, hidden and long per-field toContainText checks can go.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reduced this to the multiline input and literal output case, plus one empty-tool arrow check. Removed the scenario loop and running, hidden, and per-field assertions. Production code is unchanged. The native component suites, unit tests, type checks, and root checks pass.

@opencode-agent opencode-agent Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My earlier comment is addressed: the test is now one small story that checks the full multi-line input and the output shown as plain text, plus one that checks an empty tool has no arrow. The fix itself is the same as before. With these commits the component tests pass, and the main story still fails on the base. Public API: unchanged. Nothing else from me.

@opencode-agent opencode-agent Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This push only merges the latest dev, and the fix works the same as before. With it, the component tests, tsc -b and the session-ui unit tests pass. The smaller test from the previous push is still in place. Public API: unchanged. Nothing new from me.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG]: V2 web app: plugin and MCP tool calls can't be expanded, so their input and output are not shown

1 participant