Skip to content

Render tool content and collapse tool output by default#228

Open
nicholas-leonard wants to merge 1 commit intoRAIT-09:masterfrom
nicholas-leonard:feat/tool-output-collapsed-default
Open

Render tool content and collapse tool output by default#228
nicholas-leonard wants to merge 1 commit intoRAIT-09:masterfrom
nicholas-leonard:feat/tool-output-collapsed-default

Conversation

@nicholas-leonard
Copy link
Copy Markdown

Description

This PR improves tool-call output rendering in the Obsidian Agent Client UI and reduces duplicate visual noise in chat.

What changed

  1. Added support for ACP tool content items of type content so text output from tools is rendered in the tool block.
  2. Added a collapsible tool output section in each tool-call block.
  3. Tool output is hidden by default and can be expanded with a toggle.
  4. Tool output auto-expands when a tool call fails so error details are immediately visible.
  5. Added styling for the new show/hide control.

Why

When agents summarize tool output in their assistant message, users were seeing the same report twice (once in tool output and again in assistant text).
Collapsing tool output by default keeps chat readable while preserving full details on demand.

Related issue

N/A

Type of change

  • Bug fix
  • New feature
  • Documentation
  • Refactor
  • Other

Checklist

  • npm run lint passes ("Use sentence case for UI text" errors are acceptable for brand names)
  • npm run build passes
  • Tested in Obsidian
  • Existing functionality still works
  • Documentation updated if needed

Lint note: current branch still reports existing baseline sentence-case lint violations in unrelated files.

Testing environment

  • Agent: OpenCode (via ACP in Obsidian Agent Client)
  • OS: macOS

Screenshots

Default collapsed tool output:
Screenshot 2026-04-21 at 1 33 39 PM
Clip to open and see detailed tool output:
Screenshot 2026-04-21 at 1 33 57 PM

@RAIT-09
Copy link
Copy Markdown
Owner

RAIT-09 commented May 2, 2026

@nicholas-leonard
Hey, sorry for the late review — this sat for a while and I appreciate your patience.

Adding support for the content type in tool call blocks is a great improvement, and I'm happy to take that part in!

However, I'm not comfortable with collapsing diffs and terminal output by default. I understand the motivation — tool output can feel redundant when the assistant repeats it — but that behavior tends to depend on the model rather than the agent itself. It's also something that can be tuned via prompt files like AGENTS.md or system prompts, without changing the UI defaults for everyone.

Could you update this PR to focus on the content type rendering only, keeping diffs and terminal output visible as they are today? If you'd still like to explore a collapse option down the road, we could discuss it as an opt-in user setting.

Thanks again for the contribution!

@RAIT-09 RAIT-09 self-requested a review May 2, 2026 07:40
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.

2 participants