Address @claude review of #1583:
- statusOf() now only treats a numeric `.code` as an HTTP status when it
is in the 100-599 range, so an MCP SDK McpError JSON-RPC code (e.g.
-32601 MethodNotFound) is no longer leaked into the envelope `status`
or misclassified as AUTH_REQUIRED (it falls back to USAGE).
- causeOf() now carries a depth cap (MAX_CAUSE_DEPTH) so a cyclic/
self-referential `error.cause` chain terminates instead of recursing
infinitely.
- Add tests for both: a -32601 McpError-shaped error (status undefined,
exit USAGE) and a self-referential cause chain (finite string).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01S3fTN8H3R8YV4yUGvZjYnX