opencode-immune 1.0.23 → 1.0.24
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/plugin.js +25 -1
- package/package.json +1 -1
package/dist/plugin.js
CHANGED
|
@@ -185,6 +185,17 @@ function isRetryableApiError(error) {
|
|
|
185
185
|
maybeError.data?.isRetryable === true) {
|
|
186
186
|
return true;
|
|
187
187
|
}
|
|
188
|
+
// HTTP status code based detection (retryable server/gateway errors + rate limits)
|
|
189
|
+
const status = maybeError.status ?? maybeError.statusCode ?? maybeError.data?.status;
|
|
190
|
+
if (status && (status === 404 || // transient endpoint not found (API gateway issues)
|
|
191
|
+
status === 429 || // rate limit
|
|
192
|
+
status === 500 || // internal server error
|
|
193
|
+
status === 502 || // bad gateway
|
|
194
|
+
status === 503 || // service unavailable
|
|
195
|
+
status === 504 // gateway timeout
|
|
196
|
+
)) {
|
|
197
|
+
return true;
|
|
198
|
+
}
|
|
188
199
|
// Text-based detection for model access errors (not marked as retryable
|
|
189
200
|
// by the API but retryable with a fallback model)
|
|
190
201
|
const message = `${maybeError.message ?? ""} ${maybeError.data?.message ?? ""}`.toLowerCase();
|
|
@@ -192,7 +203,20 @@ function isRetryableApiError(error) {
|
|
|
192
203
|
message.includes("not allowed") ||
|
|
193
204
|
message.includes("model not available") ||
|
|
194
205
|
message.includes("model_not_found") ||
|
|
195
|
-
message.includes("access denied")
|
|
206
|
+
message.includes("access denied") ||
|
|
207
|
+
message.includes("404") ||
|
|
208
|
+
message.includes("not found") ||
|
|
209
|
+
message.includes("page not found") ||
|
|
210
|
+
message.includes("502") ||
|
|
211
|
+
message.includes("bad gateway") ||
|
|
212
|
+
message.includes("503") ||
|
|
213
|
+
message.includes("service unavailable") ||
|
|
214
|
+
message.includes("504") ||
|
|
215
|
+
message.includes("gateway timeout") ||
|
|
216
|
+
message.includes("econnrefused") ||
|
|
217
|
+
message.includes("econnreset") ||
|
|
218
|
+
message.includes("etimedout") ||
|
|
219
|
+
message.includes("fetch failed")) {
|
|
196
220
|
return true;
|
|
197
221
|
}
|
|
198
222
|
return false;
|