Skip to content

feat(tools): suggest nearby files on Read NOT_FOUND and normalise the repeated-failure key - #1468

Merged
edenreich merged 1 commit into
mainfrom
feat/read-not-found-suggestions
Oct 2, 2026
Merged

edenreich merged 1 commit into
mainfrom
feat/read-not-found-suggestions

Conversation

@edenreich

@edenreich edenreich commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

Closes #1453

What

  • Read on a missing path returns NOT_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).
  • 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 every other tool. Retries that only change pagination, key order or whitespace now count toward the threshold of 3.
  • Reminder text and the on_repeated_failure row in docs/configuration-reference.md say "same arguments" instead of "identical".

Tests

  • TestReadTool_Execute_NotFoundSuggestions: same name in another directory, typo in the base name, nothing nearby.
  • TestRepeatedFailureKey and an extra step in TestTrackRepeatedFailure covering offset/limit/key-order noise.

Docs follow-up

inference-gateway/docs#896

… 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
@edenreich
edenreich requested a review from a team as a code owner October 1, 2026 23:54
@edenreich
edenreich merged commit 1ede5e9 into main Oct 2, 2026
12 checks passed
@edenreich
edenreich deleted the feat/read-not-found-suggestions branch October 2, 2026 00:04
@inference-gateway-releaser

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 0.222.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@inference-gateway-releaser inference-gateway-releaser Bot added the released Shipped in a release label Oct 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

released Shipped in a release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE] Read suggests nearby files on NOT_FOUND and the repeated-failure guard ignores argument noise

1 participant