@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.
package/dist/index.js CHANGED
@@ -1767,7 +1767,9 @@ var init_LLMRequest = __esm({
1767
1767
  console.error(`Error calling ${actualModelId} (attempt ${attempts}):`, error2);
1768
1768
  await this.logError(state, error2, "api_error", actualModelId, startTime, logId);
1769
1769
  if (attempts < MAX_RETRIES_PER_MODEL) {
1770
- const backoffMs = BACKOFF_BASE * Math.pow(2, attempts - 1);
1770
+ const base = BACKOFF_BASE * Math.pow(2, attempts - 1);
1771
+ const retryAfterMs = typeof error2?.retryAfter === "number" ? error2.retryAfter * 1e3 : 0;
1772
+ const backoffMs = Math.max(base, retryAfterMs);
1771
1773
  await this.sleep(backoffMs);
1772
1774
  previousLogId = logId;
1773
1775
  logId = void 0;