* Run a single read tool to completion and return its raw ToolResult, * classifying expected failures the same way execute's catch does so * the SHAPE is identical whether dispatch runs in-process or on a worker: * NotIndexed → success-shaped guidance, PathRefusal → clean er
(toolName: string, args: Record<string, unknown>)
| 1416 | * path validation already ran in {@link execute} before routing here. |
| 1417 | */ |
| 1418 | async executeReadTool(toolName: string, args: Record<string, unknown>): Promise<ToolResult> { |
| 1419 | try { |
| 1420 | return await this.dispatchTool(toolName, args); |
| 1421 | } catch (err) { |
| 1422 | if (err instanceof NotIndexedError) { |
| 1423 | return this.textResult(err.message); |
| 1424 | } |
| 1425 | if (err instanceof PathRefusalError) { |
| 1426 | return this.errorResult(err.message); |
| 1427 | } |
| 1428 | return this.errorResult( |
| 1429 | `Tool execution failed: ${err instanceof Error ? err.message : String(err)}. ` + |
| 1430 | 'This is an internal codegraph error — retry the call once; if it persists, ' + |
| 1431 | 'continue without codegraph for this task.' |
| 1432 | ); |
| 1433 | } |
| 1434 | } |
| 1435 | |
| 1436 | /** |
| 1437 | * Pure dispatch over the read tools — the switch, with no gate, no notices, no |
no test coverage detected