fix(agents): add file and filePath aliases to read tool diagnostic path check#68296
fix(agents): add file and filePath aliases to read tool diagnostic path check#682961aifanatic wants to merge 2 commits intoopenclaw:mainfrom
Conversation
…th check The read tool diagnostic guard only checked the `path` and `file_path` parameter aliases when deciding whether to emit a missing-path warning. Models like Claude commonly use `file` and `filePath` as the parameter name, triggering false positives that flood logs and can cascade into retry loops. Adds both missing aliases to the ternary chain in handleToolExecutionStart and extends the test suite to cover all four supported aliases. Closes openclaw#60008
Greptile SummaryFixes false-positive "read tool called without path" warnings in Confidence Score: 5/5Safe to merge — focused diagnostic fix with no behavioral side effects. Change is minimal (4-line ternary extension), directly addresses the root cause, and is validated by two new targeted tests. No P0/P1 findings; only a P2 test description nit. No files require special attention. Prompt To Fix All With AIThis is a comment left during a code review.
Path: src/agents/pi-embedded-subscribe.handlers.tools.test.ts
Line: 118
Comment:
**Stale test description**
Now that `file` and `filePath` are also recognized, the test description is narrower than what's actually being asserted. Consider updating it to reflect all checked aliases.
```suggestion
it("warns when read tool has no recognized path alias", async () => {
```
How can I resolve this? If you propose a fix, please make it concise.Reviews (1): Last reviewed commit: "fix(agents): add file and filePath alias..." | Re-trigger Greptile |
| expect(warn).not.toHaveBeenCalled(); | ||
| }); | ||
|
|
||
| it("warns when read tool has neither path nor file_path", async () => { |
There was a problem hiding this comment.
Now that file and filePath are also recognized, the test description is narrower than what's actually being asserted. Consider updating it to reflect all checked aliases.
| it("warns when read tool has neither path nor file_path", async () => { | |
| it("warns when read tool has no recognized path alias", async () => { |
Prompt To Fix With AI
This is a comment left during a code review.
Path: src/agents/pi-embedded-subscribe.handlers.tools.test.ts
Line: 118
Comment:
**Stale test description**
Now that `file` and `filePath` are also recognized, the test description is narrower than what's actually being asserted. Consider updating it to reflect all checked aliases.
```suggestion
it("warns when read tool has no recognized path alias", async () => {
```
How can I resolve this? If you propose a fix, please make it concise.…path aliases Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Summary
readtool diagnostic guard inhandleToolExecutionStartonly checkedpathandfile_pathwhen deciding whether to emit a "read tool called without path" warningfileandfilePathas the parameter namenormalizeToolParams()Change Type
Scope
Linked Issue/PR
Root Cause
handleToolExecutionStartresolves the read tool path fromrecord.pathandrecord.file_pathonly. ThefileandfilePathaliases — which Claude models commonly emit — were not checked, causing spurious warnings that can flood logs and cascade into retry loops.Fix
Extended the ternary chain to also check
record.fileandrecord.filePathbefore falling back to the empty string. Added test cases for both new aliases.