fix(errors): report caller-selected evidence path failures as invalid input

An EvidenceFileError for a missing evidence file, a selected path that is
not a regular file, or an output that already exists projected code and
category execution_failure. The message already told the caller to
correct the path, but agents branching on code or category saw a tool
failure.

Project those three reasons as invalid_request with category
invalid_input. An unreadable file (io) and invalid JSON keep their
codes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Kaoru0822
2026-10-09 09:23:00 +00:00
co-authored by Claude Opus 5.5
parent f4c99ab8a5
commit db177c91b8
3 changed files with 43 additions and 5 deletions
+7
View File
@@ -119,6 +119,13 @@ export const analysisErrorCategory = (
return "unavailable";
if (error instanceof ArtifactOperationError)
return artifactErrorCategory(error.reason);
if (
error instanceof EvidenceFileError &&
(error.reason === "missing" ||
error.reason === "not-file" ||
error.reason === "exists")
)
return "invalid_input";
return STATIC_ERROR_CATEGORIES[error._tag] ?? "execution_failure";
};