(cause: Cause.Cause<unknown>)
| 473 | }); |
| 474 | |
| 475 | const toMcpFailureResult = (cause: Cause.Cause<unknown>): McpToolResult => { |
| 476 | const correlationId = newCorrelationId(); |
| 477 | // oxlint-disable-next-line executor/no-try-catch-or-throw -- boundary: best-effort defect logging must tolerate non-serializable causes |
| 478 | try { |
| 479 | console.error( |
| 480 | `[executor:mcp] execute defect correlation_id=${correlationId}`, |
| 481 | Cause.pretty(cause), |
| 482 | ); |
| 483 | } catch { |
| 484 | /* ignore logger failures */ |
| 485 | } |
| 486 | const text = `Internal tool error [${correlationId}]`; |
| 487 | return { |
| 488 | content: [{ type: "text", text: `Error: ${text}` }], |
| 489 | structuredContent: { status: "error", error: text }, |
| 490 | isError: true, |
| 491 | }; |
| 492 | }; |
| 493 | |
| 494 | // A paused execution lives in the session runtime's memory: it expires when |
| 495 | // the user takes too long to answer, and dies early when the runtime is |
no test coverage detected