Skip to content

Retry each Azure retail price page on 429 - #692

Merged
tombeckenham merged 1 commit into
mainfrom
691-azure-retail-price-list-retry-429-on-each-page
Nov 19, 2026
Merged

tombeckenham merged 1 commit into
mainfrom
691-azure-retail-price-list-retry-429-on-each-page

Conversation

@tombeckenham

@tombeckenham tombeckenham commented Nov 19, 2026 •

Copy link
Copy Markdown
Collaborator

Each page of the Azure Retail Prices list is fetched with fetchWithRetry, so one 429 no longer fails the models poll.

A page that still fails after the attempt budget throws with its URL. tryDocs keeps the stored cards, the same as a hard failure did before.

Tests cover page 2 returning 429 once and then succeeding, and page 2 staying 429 until the attempt budget is spent.

Fixes #691

Summary by CodeRabbit

  • Bug Fixes
    • Azure pricing requests now retry temporary rate limits and server errors, allowing pricing to load when a later attempt succeeds.
    • If a pricing page still fails after retries, models remain listed and the pricing failure is reported. Existing stored pricing cards are retained.

A single 429 from prices.azure.com failed the whole price load. Each page now uses fetchWithRetry, and a page that fails every attempt still throws with its URL.
@changeset-bot

changeset-bot Bot commented Nov 19, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: a30de47

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@coderabbitai

coderabbitai Bot commented Nov 19, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

Azure retail price pages now use per-page retries for HTTP 429 and 5xx responses. Tests verify that a one-time throttle succeeds and persistent throttling reports a failure after five attempts.

Changes: Azure retail pricing

Layer / File(s) Summary
Retry each retail price page
src/server/providers/azure-pricing.ts, src/server/providers/adapters/azure.ts
fetchMeters now uses fetchWithRetry to request each page and parse its response as RetailPage. The adapter documentation describes the retry behavior and the failure after retries are exhausted.
Verify retry outcomes
src/server/providers/adapters/azure.test.ts
Tests cover a one-time 429 followed by a successful retry and persistent throttling that leaves pricing unavailable and reports the five-attempt failure.

Estimated code review effort: 2 (Simple) | ~12 minutes

Change: Bug fix · Severity of issue fixed: Medium

Possibly related PRs

Merge Risk: Minimal · up to a30de

Azure retail price pages now retry on 429 and 5xx responses, so brief throttling no longer fails the models poll right away. A page that still fails after the retry budget throws and the stored cards are kept. No merge-blocking risk was found.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title "Retry each Azure retail price page on 429" matches the main change. fetchMeters now sends each Azure Retail Prices API page through fetchWithRetry, so a 429 on any page is retried. The PR o…
Linked Issues check Passed Issue #691 requires four coding changes: (1) each Azure Retail Prices page uses the shared fetchWithRetry; (2) 429/5xx retries with backoff and Retry-After honored up to 15s; (3) exhausted retries…
Out of Scope Changes check Passed All changed files relate to #691.

- src/server/providers/azure-pricing.ts: the fetchWithRetry switch in fetchMeters, the RetailPage type, and the explanatory comment. These implement the issu…
Full details: Title check

Explanation

The title "Retry each Azure retail price page on 429" matches the main change. fetchMeters now sends each Azure Retail Prices API page through fetchWithRetry, so a 429 on any page is retried. The PR objectives describe the same change, and the tests cover a single 429 on page 2 and persistent 429s. The title is specific and short, and it is one sentence.

Full details: Linked Issues check

Explanation

Issue #691 requires four coding changes: (1) each Azure Retail Prices page uses the shared fetchWithRetry; (2) 429/5xx retries with backoff and Retry-After honored up to 15s; (3) exhausted retries still throw with the URL and do not fall back silently; (4) a test where page 2 returns 429 once and then succeeds.

Requirement (1) is met. In src/server/providers/azure-pricing.ts, fetchMeters replaces the plain fetchJson call with fetchWithRetry(url, () => ({}), parse) for every page. The fetchJson import is removed. The RetailPage interface types the parsed body.

Requirements (2) and (3) depend on fetchWithRetry in src/server/providers/types.ts. That function is not changed by this PR. The issue describes its retry, Retry-After, and throw-with-URL behavior. The PR description states that a page failing after the attempt budget throws with its URL, and that tryDocs keeps stored cards. I did not re-read the fetchWithRetry body within the inspection limit. The behavior rests on the issue text and the PR description.

Requirement (4) is met by the test changes in src/server/providers/adapters/azure.test.ts, per the change summary. The test makes page 2 return 429 once and then succeed, and checks that pricing is retained. A second test keeps page 2 at 429 for five attempts and checks that the models lack pricing and report a pricing-documentation failure.

No coding requirement is unmet on the evidence reviewed.

Full details: Out of Scope Changes check

Explanation

All changed files relate to #691.

  • src/server/providers/azure-pricing.ts: the fetchWithRetry switch in fetchMeters, the RetailPage type, and the explanatory comment. These implement the issue.
  • src/server/providers/adapters/azure.test.ts: the throttling stub and the two tests described in the issue. These cover the required test and the exhaustion case.
  • src/server/providers/adapters/azure.ts: a documentation update to listModels that states per-page 429/5xx retry and retained cards on failure. This documents the new behavior.

No change unrelated to the issue was found in the summary.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 8ed09d8a-e158-499b-b812-c6d5932863af
Commits

Reviewing files that changed from the base of the PR and between 69c259b and a30de47.

Files selected for processing: 3

  • src/server/providers/adapters/azure.test.ts
  • src/server/providers/adapters/azure.ts
  • src/server/providers/azure-pricing.ts

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

@tombeckenham
tombeckenham merged commit 72b9e02 into main Nov 19, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Azure retail price list: retry 429 on each page

1 participant