(error: unknown)
| 112 | } |
| 113 | |
| 114 | function isStaleConnectionError(error: unknown): boolean { |
| 115 | if (!(error instanceof APIConnectionError)) { |
| 116 | return false |
| 117 | } |
| 118 | const details = extractConnectionErrorDetails(error) |
| 119 | return details?.code === 'ECONNRESET' || details?.code === 'EPIPE' |
| 120 | } |
| 121 | |
| 122 | export interface RetryContext { |
| 123 | maxTokensOverride?: number |
no test coverage detected