Skip to content

Pricing: scheduled price sync every other day (opens a PR when a price changes) - #265

Open
yl231 wants to merge 1 commit into
mainfrom
ci/price-sync-schedule
Open

yl231 wants to merge 1 commit into
mainfrom
ci/price-sync-schedule

Conversation

@yl231

@yl231 yl231 commented Oct 31, 2026

Copy link
Copy Markdown
Contributor

For review; not merged. Merge after #263, so the schedule syncs standard prices rather than OpenRouter's model-level prices.

Adds .github/workflows/price-sync.yml, the automatic part of the price path:

  1. Every other day (06:17 UTC on odd days of the month), and on demand from the Actions tab, it runs scripts/pricing/sync_openrouter.py.
  2. If any price changed, it opens one pull request on branch price-sync/auto, or updates it if it's still open. The PR contains:
    • the new model_profiles.yaml, model_cost.json and dated snapshot;
    • the sync report: each change with its basis, plus flags for prices that double or halve;
    • a preview of the leaderboard at the new prices from reprice.py --all. It's report only and skips the dataset download, so the optimality columns aren't included.
  3. Nothing is merged or re-priced automatically. A maintainer reviews the PR, merges it, and re-prices the leaderboard when they choose with reprice.py --all --write. That keeps the ranking from moving on its own.

One setting needed

The workflow can open the PR in either of two ways:

  • Repository setting: turn on Settings → Actions → General → Allow GitHub Actions to create and approve pull requests. The PR's own checks won't run, because GitHub doesn't trigger workflows from the built-in token.
  • Secret (recommended): add a PRICE_SYNC_TOKEN secret, a fine-grained token with Contents: write and Pull requests: write on this repository. The workflow uses it when present, and the PR's checks then run.

Testing

  • actionlint (via pre-commit) passes.
  • The two scripted steps were run locally:
  • The workflow itself can only run once it's on main. After merging, a first run from the Actions tab will test it end to end.

🤖 Generated with Claude Code

…hanges

.github/workflows/price-sync.yml runs scripts/pricing/sync_openrouter.py at
06:17 UTC on odd days of the month (and on demand). When a price changed,
it opens or updates one pull request (branch price-sync/auto) with the new
price table, the sync report, and a preview of the leaderboard at the new
prices from reprice.py (report only). Nothing is merged or re-priced
automatically.

Creating the PR needs the repository setting that lets Actions create pull
requests, or a PRICE_SYNC_TOKEN secret; with the secret the PR's checks run.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.

1 participant