(cause: Cause.Cause<unknown>)
| 522 | }); |
| 523 | |
| 524 | const toMcpFailureResult = (cause: Cause.Cause<unknown>): McpToolResult => { |
| 525 | const correlationId = newCorrelationId(); |
| 526 | // oxlint-disable-next-line executor/no-try-catch-or-throw -- boundary: best-effort defect logging must tolerate non-serializable causes |
| 527 | try { |
| 528 | console.error( |
| 529 | `[executor:mcp] execute defect correlation_id=${correlationId}`, |
| 530 | Cause.pretty(cause), |
| 531 | ); |
| 532 | } catch { |
| 533 | /* ignore logger failures */ |
| 534 | } |
| 535 | const text = `Internal tool error [${correlationId}]`; |
| 536 | return { |
| 537 | content: [{ type: "text", text: `Error: ${text}` }], |
| 538 | structuredContent: { status: "error", error: text }, |
| 539 | isError: true, |
| 540 | }; |
| 541 | }; |
| 542 | |
| 543 | const recoveryText = |
| 544 | "To recover, run the execute tool again with the original code; if it pauses, a fresh executionId will be issued."; |
no test coverage detected