#10189: fix: resolve file_path param in tool display for read/write tools
agents
stale
Cluster:
Tool Execution and Error Handling
## Summary
- `resolveReadDetail` and `resolveWriteDetail` only checked `args.path` for the filename to display in verbose output
- Tools that use `file_path` instead of `path` (e.g. MCP tools) showed no filename, making verbose output less useful
- Added a fallback to check `args.file_path` when `args.path` is absent, while still preferring `path` when both exist
## Test plan
- [x] Added 4 unit tests covering: `file_path` fallback for read, `file_path` with offset/limit range, `file_path` fallback for write, and `path` takes precedence over `file_path`
- [x] All existing tests pass
Closes #10059
🤖 Generated with [Claude Code](https://claude.com/claude-code)
<!-- greptile_comment -->
<h2>Greptile Overview</h2>
<h3>Greptile Summary</h3>
This PR fixes verbose tool display details for `read` and `write` tools by falling back to `args.file_path` when `args.path` is missing, while still preferring `path` when both are present. It updates `resolveReadDetail`/`resolveWriteDetail` in `src/agents/tool-display.ts` and adds unit tests in `src/agents/tool-display.test.ts` to cover the new behavior (including offset/limit range formatting).
<h3>Confidence Score: 5/5</h3>
- This PR is safe to merge with minimal risk.
- Changes are narrowly scoped to display-string derivation for read/write tools and are covered by targeted unit tests; no behavioral changes to tool execution paths were introduced.
- No files require special attention
<!-- greptile_other_comments_section -->
<!-- /greptile_comment -->
Most Similar PRs
#23803: Fix tool metadata truncation
by kamal-ayman · 2026-02-22
80.0%
#11854: fix: resolve per-agent tools.exec config in pi-tools
by Yida-Dev · 2026-02-08
79.8%
#15162: Include tool args in verbose preview summaries
by bufordtjustice2918 · 2026-02-13
77.8%
#18992: fix: suppress spurious tool error warnings for read-only exec commands
by Phineas1500 · 2026-02-17
77.7%
#14734: test(agents): guard against stale allowAgents in existing sessions
by davidahmann · 2026-02-12
77.7%
#12665: fix(tools): recognise tool groups that expand to plugin tools in al...
by mcaxtr · 2026-02-09
77.4%
#6819: fix(tui): handle unstructured tool results and errors in tool execu...
by TreyDong · 2026-02-02
77.0%
#19632: fix: suppressToolErrors now suppresses exec tool failure notifications
by Gitjay11 · 2026-02-18
77.0%
#12487: fix(agents): strip orphaned tool_result when tool_use is sanitized ...
by skylarkoo7 · 2026-02-09
76.9%
#22087: Preserve assistant reply when exec fails under suppressToolErrors
by graysurf · 2026-02-20
76.9%