@ynhcj/xiaoyi-channel 0.0.57-next → 0.0.58-next
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/provider.js +4 -6
- package/package.json +1 -1
package/dist/src/provider.js
CHANGED
|
@@ -11,17 +11,15 @@ import { createHash } from "crypto";
|
|
|
11
11
|
import { getCurrentSessionContext } from "./tools/session-manager.js";
|
|
12
12
|
// ── Retry config ──────────────────────────────────────────────
|
|
13
13
|
const RETRY_DELAYS_MS = [10_000, 20_000, 40_000, 60_000];
|
|
14
|
-
const MAX_RETRY_ATTEMPTS =
|
|
15
|
-
/** Check if an errorMessage
|
|
14
|
+
const MAX_RETRY_ATTEMPTS = 8;
|
|
15
|
+
/** Check if an errorMessage indicates a retryable provider error by type. */
|
|
16
16
|
function isRetryableProviderError(message) {
|
|
17
17
|
if (!message)
|
|
18
18
|
return false;
|
|
19
19
|
const lower = message.toLowerCase();
|
|
20
|
-
|
|
21
|
-
if (lower.includes("server_error") || lower.includes("server had an error"))
|
|
20
|
+
if (lower.includes("server_error"))
|
|
22
21
|
return true;
|
|
23
|
-
|
|
24
|
-
if (lower.includes("rate_limit") || lower.includes("rate limit reached"))
|
|
22
|
+
if (lower.includes("rate_limit_error"))
|
|
25
23
|
return true;
|
|
26
24
|
return false;
|
|
27
25
|
}
|