Repository navigation
feat(tools): suggest nearby files on Read NOT_FOUND and normalise the repeated-failure key - #1468
Merged
Merged
Conversation
… repeated-failure key A wrong path cost a whole session: Read was called 51 times on a file that lives one directory over and never succeeded. Read now appends up to five candidate paths to NOT_FOUND. It ranks the siblings of the nearest existing ancestor by name similarity and, when none carries the missing base name, searches the containing sandbox directory for files with that base name. The repeated-failure guard keys on the file path alone for Read and on the canonical JSON of the arguments without offset and limit for other tools, so retries that only change pagination, key order or whitespace reach the threshold and trigger the reminder. Closes #1453
3 tasks
Contributor
|
🎉 This PR is included in version 0.222.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #1453
What
Readon a missing path returnsNOT_FOUND: <path>followed by up to five candidate paths. Siblings of the nearest existing directory are ranked by name similarity first. When none of them carries the missing base name, the containing sandbox directory is searched for files with that base name (bounded walk, skips dot dirs,node_modules,vendor).Read, and on the canonical JSON of the arguments withoutoffsetandlimitfor every other tool. Retries that only change pagination, key order or whitespace now count toward the threshold of 3.on_repeated_failurerow indocs/configuration-reference.mdsay "same arguments" instead of "identical".Tests
TestReadTool_Execute_NotFoundSuggestions: same name in another directory, typo in the base name, nothing nearby.TestRepeatedFailureKeyand an extra step inTestTrackRepeatedFailurecovering offset/limit/key-order noise.Docs follow-up
inference-gateway/docs#896