(reason: string)
| 1238 | // Calling client.onclose?.() directly would only clear the cache — pending |
| 1239 | // tool calls would stay hung. |
| 1240 | const closeTransportAndRejectPending = (reason: string) => { |
| 1241 | if (hasTriggeredClose) return |
| 1242 | hasTriggeredClose = true |
| 1243 | logMCPDebug(name, `Closing transport (${reason})`) |
| 1244 | void client.close().catch(e => { |
| 1245 | logMCPDebug(name, `Error during close: ${errorMessage(e)}`) |
| 1246 | }) |
| 1247 | } |
| 1248 | |
| 1249 | const isTerminalConnectionError = (msg: string): boolean => { |
| 1250 | return ( |
no test coverage detected