Repository navigation
fix(ci): repair the failing update-pricing workflow - #1262
Conversation
The models.dev pricing generator was split in #1244 so that nix/models-dev-gen.ts imports its sibling ./models-dev-compact.ts. The Nix derivation only copied gen.ts into the writable workspace, so Bun could not resolve the new import inside the sandbox: error: Cannot find module './models-dev-compact.ts' from '/build/work/gen.ts' This broke the scheduled "update pricing" workflow on the update-models-dev-pricing job and every manual gen-models-dev-pricing run. Copy models-dev-compact.ts alongside gen.ts under the same relative name the import expects. Verified locally: the regenerated snapshot is byte-identical to the committed rust/crates/ccusage/src/models-dev-pricing.json.
The "Create pull request" steps pushed with --force-with-lease, but the
job checks out main at fetch-depth 1 and never fetches the bot branch.
Without a remote-tracking ref, git refuses the lease:
! [rejected] automation/litellm-pricing -> automation/litellm-pricing (stale info)
error: failed to push some refs
These branches are written only by this workflow, so a plain --force is
safe and is the standard pattern for a bot-owned automation branch.
📝 WalkthroughWalkthroughTwo small, independent fixes address pricing automation safety and build setup: GitHub Actions workflow push commands switch from ChangesGit Push Flag Updates in Pricing Workflows
Models.dev Pricing Generator Build Fix
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
ccusage-guide | 94a62cb | Commit Preview URL Branch Preview URL |
Jun 11 2026, 09:31 AM |
ccusage performance comparisonPR SHA: This compares the Rust PR release binary against the configured base package on the same CI runner. Package runner startupExecution setup measures any pre-benchmark package materialization used by the execution benchmark. Bunx temp cache measures one
Cached bunx execution performanceRuns the same large fixture through Fixtures: Claude
Package runtime diagnosticsCompares the PR package wrapper, the installed native optional dependency binary, and the workspace release binary on the same large fixture. This identifies whether slow package results come from JavaScript wrapper overhead, the published native binary build, or the Rust core itself. Fixtures: Claude
Committed fixture performanceCommitted small fixtures for stable PR-to-PR feedback and explicit Claude/Codex command coverage. Fixtures: Claude
Large real-world-shaped fixture performanceGenerated fixtures shaped from aggregate local log statistics: thousands of JSONL files, many small sessions, and a long tail of larger sessions. No real prompts, paths, or outputs are stored in the fixtures. Fixtures: Claude
Artifact size
Lower medians and smaller artifacts are better. CI runner noise still applies; use same-run ratios as directional PR feedback, not release guarantees. |
ccusage performance comparisonPR SHA: This compares the PR package against the configured base package on the same CI runner. Package runner startupExecution setup measures any pre-benchmark package materialization used by the execution benchmark. Bunx temp cache measures one
Cached bunx execution performanceRuns the same large fixture through Fixtures: Claude
Package runtime diagnosticsCompares the PR package wrapper, the installed native optional dependency binary, and the workspace release binary on the same large fixture. This identifies whether slow package results come from JavaScript wrapper overhead, the published native binary build, or the Rust core itself. Fixtures: Claude
Committed fixture performanceCommitted small fixtures for stable PR-to-PR feedback and explicit Claude/Codex command coverage. Fixtures: Claude
Large real-world-shaped fixture performanceGenerated fixtures shaped from aggregate local log statistics: thousands of JSONL files, many small sessions, and a long tail of larger sessions. No real prompts, paths, or outputs are stored in the fixtures. Fixtures: Claude
Artifact size
Lower medians and smaller artifacts are better. CI runner noise still applies; use same-run ratios as directional PR feedback, not release guarantees. |
Summary
Both jobs of the scheduled update pricing workflow have been failing on every run. This PR fixes the two independent root causes.
What changed
nix/models-dev-pricing.nix— also copymodels-dev-compact.tsinto the writable Bun workspace. perf(pricing): shrink embedded snapshots 58% and binary 2.9% #1244 split the generator somodels-dev-gen.tsimports its sibling./models-dev-compact.ts, but the derivation only copiedgen.ts, so the sandboxed Bun run failed withCannot find module './models-dev-compact.ts'. This broke theupdate-models-dev-pricingjob and any manualjust gen-models-dev-pricing..github/workflows/update-pricing.yaml— push the automation branches withgit push --forceinstead of--force-with-lease. The job checks outmainatfetch-depth: 1and never fetches the bot branch, so there is no remote-tracking ref and the lease check rejects the push withstale info. These branches are written only by this workflow, so a plain force-push is safe.Why
The hourly cron has been red since the #1244 refactor (models.dev job) and on every run that already had an open automation branch (force-with-lease push). Restoring both keeps the LiteLLM and models.dev pricing snapshots updating automatically.
Testing
nix build .#models-dev-pricingnow succeeds locally, and the regenerated snapshot is byte-identical to the committedrust/crates/ccusage/src/models-dev-pricing.json.Need help on this PR? Tag
/codesmithwith what you need. Autofix is disabled.Summary by cubic
Fixes the scheduled update-pricing workflow by addressing failures in the Nix build and CI push step. Restores automatic LiteLLM and models.dev pricing snapshot updates.
nix/models-dev-pricing.nix, copymodels-dev-compact.tsalongsidegen.tsso Bun can resolve the sibling import..github/workflows/update-pricing.yaml, push automation branches withgit push --forceinstead of--force-with-leaseto avoid lease errors on shallow checkouts.Written for commit 94a62cb. Summary will update on new commits.
Summary by CodeRabbit