MCPcopy Create free account
hub / github.com/MoonshotAI/kimi-code / isRetryableGenerateError

Function isRetryableGenerateError

packages/kosong/src/errors.ts:91–99  ·  view source on GitHub ↗
(error: unknown)

Source from the content-addressed store, hash-verified

89}
90
91export function isRetryableGenerateError(error: unknown): boolean {
92 if (error instanceof APIConnectionError || error instanceof APITimeoutError) {
93 return true;
94 }
95 if (error instanceof APIEmptyResponseError) {
96 return true;
97 }
98 return error instanceof APIStatusError && [429, 500, 502, 503, 504].includes(error.statusCode);
99}
100
101// `terminated` is the undici signature for an SSE/HTTP body stream that is
102// dropped mid-flight (common with Node's native fetch on long reasoning

Callers 6

errors.test.tsFile · 0.90
retry.test.tsFile · 0.90
isRetryableErrorMethod · 0.90
compactionRoundMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected