@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/runtime.js CHANGED
@@ -1758,7 +1758,9 @@ var init_LLMRequest = __esm({
1758
1758
  console.error(`Error calling ${actualModelId} (attempt ${attempts}):`, error2);
1759
1759
  await this.logError(state, error2, "api_error", actualModelId, startTime, logId);
1760
1760
  if (attempts < MAX_RETRIES_PER_MODEL) {
1761
- const backoffMs = BACKOFF_BASE * Math.pow(2, attempts - 1);
1761
+ const base = BACKOFF_BASE * Math.pow(2, attempts - 1);
1762
+ const retryAfterMs = typeof error2?.retryAfter === "number" ? error2.retryAfter * 1e3 : 0;
1763
+ const backoffMs = Math.max(base, retryAfterMs);
1762
1764
  await this.sleep(backoffMs);
1763
1765
  previousLogId = logId;
1764
1766
  logId = void 0;