#355

fix(vercel-optimize): handle CDN Requests rename and Flat Rate CDN

Openlayonthebeechwants to merge intofrom

Vercel renamed the Edge Requests usage metric to CDN Requests on 2026-09-30, and Flat Rate CDN is now GA for Pro. vercel-optimize still matched the old billing name and assumed CDN usage is always billed per unit.

Why

  • lib/cost-coverage.mjs classifies billing lines with ^Edge Requests$ and ^Edge Requests.*Additional CPU Duration. Per the changelog, invoice line items and ServiceName now return the new name, and pricing lists CDN Request CPU Duration. These lines fall into the unknown family, so the report's "Coverage gaps" section understates what the audit covers and lists CDN Requests as an uncovered gap.
  • lib/gates/platform-bot-protection.mjs finds request cost with /edge.request/i. On current billing data it finds nothing, so the gate loses its cost evidence and priority signal.
  • Customer-facing copy (playbooks, display labels, gate and scanner descriptions) still says Edge Requests, and voice.md told the agent to keep that name.
  • With Flat Rate CDN, CDN Requests and Fast Data Transfer are covered by a fixed monthly tier. Playbook advice such as "Bot Protection pays for itself" can then promise a lower bill that won't happen.

Approach

Because the billing name changed but metric IDs did not, matching both names (and leaving the internal edge-requests dimension ID alone) should restore classification and gate evidence for both old and new billing windows without touching schemas or fixtures.

  • Cost coverage: match Edge|CDN Requests and Edge|CDN Request(s) ... CPU Duration.
  • Bot protection gate: match ^(edge|cdn) requests?$ exactly, so CDN Request CPU Duration is not mistaken for request cost.
  • Copy: Edge Requests becomes CDN Requests in playbooks, labels, descriptions, scoring.md, doctrine.md; voice.md now says to use CDN Requests and note the rename once if a window still shows the old name. Generated candidates.md and scanner-patterns.md regenerated.
  • Flat Rate CDN: new rule in scoring.md (frame CDN request or transfer reductions as tier headroom, not a lower bill, when billing shows them covered by a tier), pointers from the CDN-heavy playbooks and the bot-protection support topic, and an allow-listed citation for the Flat Rate CDN docs. The manage-cdn-usage citation topic is updated to the current page title.

Out of scope: the CLI metrics fixes in #354, the build-cost work in #353, and the citation issue in #339.

Validation

node --test packages/vercel-optimize-tests/test/*.test.mjs   # 773/773
node skills/vercel-optimize/scripts/check-docs-fresh.mjs     # OK
node skills/vercel-optimize/scripts/check-citations.mjs      # OK, 100 URLs

New tests cover CDN Requests, CDN Request CPU Duration, and the legacy names in classifyService, plus the bot gate reading cost from either name and ignoring the CPU Duration line. With the two source files reverted, the CDN Requests cases fail; with this change they pass.

Not verified against a live vercel usage payload on a Flat Rate CDN team, so the "usage but zero billed cost" heuristic in the new scoring rule is guidance to the agent, not code.

Activity

2
vercel[bot]15d ago

The latest updates on your projects. Learn more about Vercel for GitHub.

ProjectDeploymentActionsUpdated
agent-skills ReadyPreview, v0Oct 28, 2026 7:18pm UTC