Skip to content

Show tool call parameters in expanded tool blocks - #69

Merged
wesm merged 2 commits into
mainfrom
claude-tool-calls
Feb 28, 2026
Merged

Show tool call parameters in expanded tool blocks#69
wesm merged 2 commits into
mainfrom
claude-tool-calls

Conversation

@wesm

@wesm wesm commented Feb 28, 2026

Copy link
Copy Markdown
Member

Summary

  • Extract tool parameter display logic into tool-params.ts utility with metadata tags and fallback content generation
  • When expanding Read, Edit, Write, Grep, Glob, Bash, and Skill tool blocks, show structured metadata tags (file, pattern, glob, mode, etc.) and generated fallback content (Edit diffs, Write previews, generic key-value display) instead of empty space
  • Add 31 unit tests covering all tool types, truncation, and edge cases (zero-valued params, empty Write content)
image

Fixes #66

Test plan

  • Run npx vitest run src/lib/utils/tool-params.test.ts -- 31 tests pass
  • Run npm run check in frontend/ -- 0 errors
  • Open a Claude Code session with Read/Edit/Write/Grep tool calls, expand them, verify parameters are displayed

🤖 Generated with Claude Code

wesm and others added 2 commits February 27, 2026 17:29
…b, Bash, and Skill tool blocks

Previously these tools expanded to show empty content because the regex-
captured text was empty and only Task/TaskCreate/TaskUpdate had metadata
extraction from input_json. Extract parameter display logic into a
reusable tool-params utility with metadata tags (file, pattern, glob,
mode, etc.) and fallback content generation (Edit diffs, Write previews,
generic key-value display).

Fixes #66

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Use null checks instead of truthiness for offset/limit (preserves 0)
and Write content (shows "(empty file)" marker for empty strings).
Add tests for both edge cases.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@wesm

wesm commented Feb 28, 2026

Copy link
Copy Markdown
Member Author

cc @cderv

@roborev-ci

roborev-ci Bot commented Feb 28, 2026

Copy link
Copy Markdown

roborev: Combined Review (2a276ae)

Verdict: All agents agree the code is clean; no medium, high, or critical severity issues were found.


Synthesized from 4 reviews (agents: codex, gemini | types: default, security)

@wesm
wesm merged commit f397a93 into main Feb 28, 2026
6 checks passed
@cderv

cderv commented Mar 2, 2026

Copy link
Copy Markdown

Awesome thanks. Glad the report was useful !

cursor Bot pushed a commit to diazMelgarejo/periscope that referenced this pull request Jun 1, 2026
## Summary

- Extract tool parameter display logic into `tool-params.ts` utility
with metadata tags and fallback content generation
- When expanding Read, Edit, Write, Grep, Glob, Bash, and Skill tool
blocks, show structured metadata tags (file, pattern, glob, mode, etc.)
and generated fallback content (Edit diffs, Write previews, generic
key-value display) instead of empty space
- Add 31 unit tests covering all tool types, truncation, and edge cases
(zero-valued params, empty Write content)

<img width="1216" height="340" alt="image"
src="https://github.com/user-attachments/assets/292fa989-9091-4b6c-ac9f-9f5ba41bce38"
/>

Fixes kenn-io#66

## Test plan

- [ ] Run `npx vitest run src/lib/utils/tool-params.test.ts` -- 31 tests
pass
- [ ] Run `npm run check` in frontend/ -- 0 errors
- [ ] Open a Claude Code session with Read/Edit/Write/Grep tool calls,
expand them, verify parameters are displayed

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
@wesm
wesm deleted the claude-tool-calls branch June 25, 2026 12:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Tool calls expand to show empty content

2 participants