Skip to content

fix(agents): add file and filePath aliases to read tool diagnostic path check#68296

Open
1aifanatic wants to merge 2 commits intoopenclaw:mainfrom
1aifanatic:fix/read-tool-path-aliases
Open

fix(agents): add file and filePath aliases to read tool diagnostic path check#68296
1aifanatic wants to merge 2 commits intoopenclaw:mainfrom
1aifanatic:fix/read-tool-path-aliases

Conversation

@1aifanatic
Copy link
Copy Markdown

Summary

  • The read tool diagnostic guard in handleToolExecutionStart only checked path and file_path when deciding whether to emit a "read tool called without path" warning
  • Models like Claude commonly use file and filePath as the parameter name
  • This triggered false-positive log warnings even though the tool itself succeeds via normalization in normalizeToolParams()

Change Type

  • Bug fix

Scope

  • Skills / tool execution

Linked Issue/PR

Root Cause

handleToolExecutionStart resolves the read tool path from record.path and record.file_path only. The file and filePath aliases — 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.file and record.filePath before falling back to the empty string. Added test cases for both new aliases.

…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
@openclaw-barnacle openclaw-barnacle bot added agents Agent runtime and tooling size: XS labels Apr 17, 2026
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps bot commented Apr 17, 2026

Greptile Summary

Fixes false-positive "read tool called without path" warnings in handleToolExecutionStart by extending the path-alias lookup to include file and filePath, which Claude models commonly emit. The change is minimal, well-targeted, and backed by two new test cases covering each new alias.

Confidence Score: 5/5

Safe 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 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.

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 () => {
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.

P2 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.

Suggested change
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling size: XS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] read tool diagnostic guard missing "file" and "filePath" aliases — false "read tool called without path" warnings

1 participant