@standardagents/builder 0.27.11 → 0.27.12

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.
@@ -1783,7 +1783,9 @@ var init_LLMRequest = __esm({
1783
1783
  console.error(`Error calling ${actualModelId} (attempt ${attempts}):`, error2);
1784
1784
  await this.logError(state, error2, "api_error", actualModelId, startTime, logId);
1785
1785
  if (attempts < MAX_RETRIES_PER_MODEL) {
1786
- const backoffMs = BACKOFF_BASE * Math.pow(2, attempts - 1);
1786
+ const base = BACKOFF_BASE * Math.pow(2, attempts - 1);
1787
+ const retryAfterMs = typeof error2?.retryAfter === "number" ? error2.retryAfter * 1e3 : 0;
1788
+ const backoffMs = Math.max(base, retryAfterMs);
1787
1789
  await this.sleep(backoffMs);
1788
1790
  previousLogId = logId;
1789
1791
  logId = void 0;
@@ -43659,7 +43661,7 @@ var init_dist6 = __esm({
43659
43661
  return new ProviderError(error.message, "rate_limit", status, retryAfter);
43660
43662
  }
43661
43663
  if (status === 403 && _OpenAIProvider.isEdgeBlock(anyError)) {
43662
- return new ProviderError(error.message, "server_error", status);
43664
+ return new ProviderError(error.message, "server_error", status, retryAfter ?? 3);
43663
43665
  }
43664
43666
  if (status === 401 || status === 403) {
43665
43667
  return new ProviderError(error.message, "auth_error", status);
@@ -66289,7 +66291,7 @@ var config_get_default = defineController2(async ({ config, env: env2, req }) =>
66289
66291
  });
66290
66292
 
66291
66293
  // src/version.ts
66292
- var BUILDER_VERSION = "0.27.11".length > 0 ? "0.27.11" : "dev";
66294
+ var BUILDER_VERSION = "0.27.12".length > 0 ? "0.27.12" : "dev";
66293
66295
 
66294
66296
  // src/api/diagnostics.get.ts
66295
66297
  init_LLMRequest();