(result: ToolResultBlockParam['content'], {
verbose
}: {
verbose: boolean;
})
| 142 | } |
| 143 | } |
| 144 | export function renderToolUseErrorMessage(result: ToolResultBlockParam['content'], { |
| 145 | verbose |
| 146 | }: { |
| 147 | verbose: boolean; |
| 148 | }): React.ReactNode { |
| 149 | if (!verbose && typeof result === 'string') { |
| 150 | // FileReadTool throws from call() so errors lack <tool_use_error> wrapping — |
| 151 | // check the raw string directly for the cwd note marker. |
| 152 | if (result.includes(FILE_NOT_FOUND_CWD_NOTE)) { |
| 153 | return <MessageResponse> |
| 154 | <Text color="error">File not found</Text> |
| 155 | </MessageResponse>; |
| 156 | } |
| 157 | if (extractTag(result, 'tool_use_error')) { |
| 158 | return <MessageResponse> |
| 159 | <Text color="error">Error reading file</Text> |
| 160 | </MessageResponse>; |
| 161 | } |
| 162 | } |
| 163 | return <FallbackToolUseErrorMessage result={result} verbose={verbose} />; |
| 164 | } |
| 165 | export function userFacingName(input: Partial<Input> | undefined): string { |
| 166 | if (input?.file_path?.startsWith(getPlansDirectory())) { |
| 167 | return 'Reading Plan'; |
nothing calls this directly
no test coverage detected