Compare commits

...

1 Commits

Author SHA1 Message Date
Alexander Whitestone
8b201f1566 fix: improve read_file not-found error with actionable hint (#887)
Some checks failed
Contributor Attribution Check / check-attribution (pull_request) Failing after 35s
Docker Build and Publish / build-and-push (pull_request) Has been skipped
Supply Chain Audit / Scan PR for supply chain risks (pull_request) Successful in 39s
Tests / e2e (pull_request) Successful in 2m10s
Tests / test (pull_request) Failing after 1h41m47s
2026-04-16 01:08:15 -04:00

View File

@@ -601,8 +601,12 @@ class ShellFileOperations(FileOperations):
scored.sort(key=lambda x: -x[0])
similar = [fp for _, fp in scored[:5]]
hint = " Use search_files to find the correct path before reading."
similar_hint = ""
if similar:
similar_hint = f" Did you mean one of: {', '.join(similar[:3])}?"
return ReadResult(
error=f"File not found: {path}",
error=f"File not found: {path}.{similar_hint}{hint}",
similar_files=similar
)