feat(core): Annotate remaining error paths in tools with type. (#6699)

This commit is contained in:
joshualitt
2025-08-21 14:40:18 -07:00
committed by GitHub
parent 299bf58309
commit ec41b8db8e
19 changed files with 348 additions and 48 deletions

View File

@@ -24,10 +24,43 @@ export enum ToolErrorType {
PERMISSION_DENIED = 'permission_denied',
NO_SPACE_LEFT = 'no_space_left',
TARGET_IS_DIRECTORY = 'target_is_directory',
PATH_NOT_IN_WORKSPACE = 'path_not_in_workspace',
SEARCH_PATH_NOT_FOUND = 'search_path_not_found',
SEARCH_PATH_NOT_A_DIRECTORY = 'search_path_not_a_directory',
// Edit-specific Errors
EDIT_PREPARATION_FAILURE = 'edit_preparation_failure',
EDIT_NO_OCCURRENCE_FOUND = 'edit_no_occurrence_found',
EDIT_EXPECTED_OCCURRENCE_MISMATCH = 'edit_expected_occurrence_mismatch',
EDIT_NO_CHANGE = 'edit_no_change',
// Glob-specific Errors
GLOB_EXECUTION_ERROR = 'glob_execution_error',
// Grep-specific Errors
GREP_EXECUTION_ERROR = 'grep_execution_error',
// Ls-specific Errors
LS_EXECUTION_ERROR = 'ls_execution_error',
PATH_IS_NOT_A_DIRECTORY = 'path_is_not_a_directory',
// MCP-specific Errors
MCP_TOOL_ERROR = 'mcp_tool_error',
// Memory-specific Errors
MEMORY_TOOL_EXECUTION_ERROR = 'memory_tool_execution_error',
// ReadManyFiles-specific Errors
READ_MANY_FILES_SEARCH_ERROR = 'read_many_files_search_error',
// DiscoveredTool-specific Errors
DISCOVERED_TOOL_EXECUTION_ERROR = 'discovered_tool_execution_error',
// WebFetch-specific Errors
WEB_FETCH_NO_URL_IN_PROMPT = 'web_fetch_no_url_in_prompt',
WEB_FETCH_FALLBACK_FAILED = 'web_fetch_fallback_failed',
WEB_FETCH_PROCESSING_ERROR = 'web_fetch_processing_error',
// WebSearch-specific Errors
WEB_SEARCH_FAILED = 'web_search_failed',
}