Compare commits

...

1 Commits

Author SHA1 Message Date
Alexander Whitestone
8b201f1566 fix: improve read_file not-found error with actionable hint (#887)
Some checks are pending
Contributor Attribution Check / check-attribution (pull_request) Waiting to run
Docker Build and Publish / build-and-push (pull_request) Waiting to run
Supply Chain Audit / Scan PR for supply chain risks (pull_request) Waiting to run
Tests / test (pull_request) Waiting to run
Tests / e2e (pull_request) Waiting to run
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
)