# agent: Fix tool paths preferring files in subdirectories named after the project root \(\#56230\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/9fe2931297c38a39296c46188f51537351f0fb57)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: 9fe2931297c38a39296c46188f51537351f0fb57

Requested commit: 9fe2931297c38a39296c46188f51537351f0fb57

Commit: 9fe2931297c38a39296c46188f51537351f0fb57

Tree: deb7c98641a8780257fe6c05c669049766602d1e

Author: procr1337

Committer: GitHub

## Message

```
agent: Fix tool paths preferring files in subdirectories named after the project root (#56230)

The tool definition is very clearly contradicting the previous behavior.
Performance impact is unclear to me, we increase the work in a
potentially expensive loop, but it seems necessary to have both the
specified behavior from the tool definition, as well as the
heuristic/fallback for misbehaving models that seems to be intended.

Self-Review Checklist:

- [X] I've reviewed my own diff for quality, security, and reliability
- [X] Unsafe blocks (if any) have justifying comments
- [X] The content is consistent with the [UI/UX
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
- [X] Tests cover the new/changed behavior
- [X] Performance impact has been considered and is acceptable

Closes #56225

Release Notes:

- Fixed tool paths preferring files in subdirectories named after the
project root
```

## Parents

- [1376b200c853b85e0dc3d34dc4ded2da53df6649](https://git.cafe/gitcafe/zed/commit/1376b200c853b85e0dc3d34dc4ded2da53df6649?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/9fe2931297c38a39296c46188f51537351f0fb57?format=markdown)
