Skip to content

build(nix): add ccusage to the dev shell - #592

Merged
kixelated merged 1 commit into
mainfrom
nix/ccusage
Nov 9, 2026
Merged

kixelated merged 1 commit into
mainfrom
nix/ccusage

Conversation

@kixelated

@kixelated kixelated commented Nov 9, 2026 •

Copy link
Copy Markdown
Collaborator

quest usage prices agent sessions with ccusage from PATH, and without it reports accuracy alone, so m0's model check (moq-dev/quest#584) had no cost data. Anthropic's model guide compares models by cost per finished task, which m1's check now needs to retune the routing tables (moq-dev/quest#590).

Changes

  • The dev shell adds nixpkgs' ccusage (20.0.37 at the locked nixpkgs), so the model check, which runs in this checkout, gets it. Pinning it with flake.lock keeps its session --json format in step with parseCcusage, which fails on any field it lacks; a global npm install -g ccusage floats.
  • Its closure is 52.8 MiB, with no Node runtime.

Public API

None. quest usage's install hint for hosts without ccusage is unchanged.

Validation

  • nix develop --command ccusage --version prints ccusage 20.0.37.
  • nix develop --command bun run quest usage --since 2026-11-08 --pr 584 parses and prices its sessions.
  • just check and just test pass in the new shell (1183 passed, 5 skipped). No test reads ccusage from PATH; the usage tests inject it.

Limitations

  • In that run, quest: finish the m0 model check #584's Claude Code implementer session did not attribute, only its Codex sessions, likely because its worktree is deleted: the README says a deleted checkout's session needs a Codex log for that directory. m1's check may undercount Claude writers' cost for PRs whose worktrees are gone.

Models

Size: XS
Implementer: Claude Code, claude-opus-5-5, xhigh effort

🤖 Generated with Claude Code

(Written by Claude Opus 5.5 with xhigh)

Review

Rewritten by quest review after each round.

  • Reviewer: Codex, gpt-6.1-sol, low effort
  • Session: 01a1c261-a4af-7512-8f45-c25730b7575a, round 1
  • Head: 425152b
  • Base: origin/main at 3302e8a
  • Score: 9/10, The change is small and focused with no actionable defects identified by code inspection, pending runtime validation because builds and tests were not run as instructed.
  • Findings: none

`quest usage` prices sessions with ccusage and reports accuracy alone
without it, so the model check had no cost data. Pinning it with the lock
keeps its JSON in step with the parser.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@pullfrog

pullfrog Bot commented Nov 9, 2026

Copy link
Copy Markdown

Pullfrog  | Review this ➔

@kixelated
kixelated marked this pull request as ready for review November 9, 2026 22:16
@coderabbitai

coderabbitai Bot commented Nov 9, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 26 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 7ef9440f-f53a-413f-85d8-7e889b068aba
Commits

Reviewing files that changed from the base of the PR and between 3302e8a and 425152b.

Files selected for processing: 1

  • flake.nix
  • 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

@kixelated kixelated left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated review by review (OpenAI)

Reviewed head: 425152b3bd491f0968364d2a4c95e4fe7033c7e8.

No actionable defects found in the two-line flake.nix change. Adding ccusage to the existing locked dev shell fits quest usage's current PATH-based invocation and keeps the dependency scoped to development tooling.

Verification: inspected the complete diff, flake configuration, lockfile, and runCcusage/parseCcusage. This was a GitHub-only static review; Nix evaluation and runtime/tests were not run. The upstream nixpkgs package-definition read returned HTTP 429, so its version and platform support were not independently verified. Current Check/Queue runs are skipped; the PR body's reported local checks were not reproduced.

(written by unknown)

@kixelated
kixelated added this pull request to the merge queue Nov 9, 2026
Merged via the queue into main with commit 1b9d324 Nov 9, 2026
11 checks passed
@kixelated
kixelated deleted the nix/ccusage branch November 9, 2026 22:47
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