Fix CI: switch to data/models.json with paid & free multipliers#195
Open
Rob Bos (rajbos) wants to merge 2 commits into
Open
Fix CI: switch to data/models.json with paid & free multipliers#195Rob Bos (rajbos) wants to merge 2 commits into
Rob Bos (rajbos) wants to merge 2 commits into
Conversation
With GitHub Copilot's usage-based billing, model multipliers no longer apply. Each premium request counts as 1 PRU at \.04 regardless of model. Changes: - scripts/update-model-multipliers.py: treat empty multiplier cells as 1 (no longer a fatal error; upstream data stopped publishing multipliers) - model-multipliers.legacy.ts: flatten all non-zero multipliers to 1; only the free/default distinction (0 vs 1) still has meaning - model-multipliers.generated.ts: regenerate from latest release - utils.ts: remove '* multiplier' from partial-month cost projection (full-month path already omitted it); update comments - App.tsx: remove Multiplier column from model table; update tooltip - Tests: update model-summary-total and model-info-limits accordingly Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
|
Tagging Rob Bos (@rajbos) for notifications |
Instead of parsing the markdown release body, the update script now fetches data/models.json directly from rajbos/github-copilot-model-notifier. This file has structured fields for both multiplier_paid and multiplier_free. Changes: - scripts/update-model-multipliers.py: fetch data/models.json via raw URL; parse multiplier_paid and multiplier_free; generate both _PAID and _FREE constants; keep CURRENT_MODEL_MULTIPLIERS as backward-compat alias for _PAID - model-multipliers.generated.ts: regenerated with PAID/FREE split - model-multipliers.legacy.ts: add LEGACY_MODEL_MULTIPLIERS_FREE; rename to LEGACY_MODEL_MULTIPLIERS_PAID (alias preserved for compat) - utils.ts: import _PAID/_FREE variants; expose MODEL_MULTIPLIERS_PAID, MODEL_MULTIPLIERS_FREE; make getModelMultiplier() plan-aware (default 'paid'); -1 sentinel (not available on plan) is folded to 0 for cost math Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The daily
update-model-multipliersCI job has been failing with:The upstream source stopped populating the multiplier column in release markdown bodies. More importantly, GitHub Copilot has moved to usage-based billing — the old single "multiplier" concept has been replaced by separate paid-plan and free-plan values in the notifier's structured
data/models.jsonfile.Root cause
Our script was parsing the release body markdown table, which no longer contains multiplier data. The correct data source is
data/models.jsonin the notifier repo, which has structured fields:multiplier_paid,multiplier_free,provider,release_status.Changes
scripts/update-model-multipliers.pydata/models.jsondirectly instead of parsing markdownmultiplier_paid(Business / Enterprise / Pro) andmultiplier_free(Copilot Free)-1= model not available on this plan;0= included free;>0= premium1(unknown premium, costs 1 PRU per request)src/lib/model-multipliers.generated.tsCURRENT_MODEL_MULTIPLIERS_PAIDandCURRENT_MODEL_MULTIPLIERS_FREECURRENT_MODEL_MULTIPLIERSkept as a backward-compat alias for_PAIDsrc/lib/model-multipliers.legacy.tsLEGACY_MODEL_MULTIPLIERS_FREEfor legacy model identifiersLEGACY_MODEL_MULTIPLIERS→LEGACY_MODEL_MULTIPLIERS_PAID(alias preserved)src/lib/utils.tsMODEL_MULTIPLIERS_PAIDandMODEL_MULTIPLIERS_FREEgetModelMultiplier(model, plan?)is now plan-aware (defaults to'paid')-1sentinel is folded to0in cost calculations (not-available = no cost)Verification
All 239 tests pass ✅
When GitHub re-populates
multiplier_paid/multiplier_freein the docs (as their billing data stabilizes), the daily workflow will automatically pick up the real values.