ci: fetch cc-tokens from token-budget for the suites step #22
Reference in New Issue
Block a user
Delete Branch "fix-20-ci-cc-tokens"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Fixes kotkan/claude-plugin-inference-arbitrage#20.
What I found:
cc-tokens(kotkan/claude-plugin-token-budget'sbin/cc-tokens) is a single, pure-stdlib Python 3 script (606 lines, no third-party deps, no network). It's not published as a Gitea package (npm/PyPI/generic) anywhere — the only documented distribution path isclaude plugin install token-budget@oleks-local, which is a Claude Code plugin-manager action, meaningless inside a bare CI container.bin/offload-scan'sresolve_cc_tokens()doesn't even shell out to it — it locates the file (PATH, then~/.claude/plugins/cache/*/token-budget/*/bin/cc-tokens) and imports it as a Python module viaimportlib, then checks forRec/price_for/parse_dayattributes.Fix (option a from the issue): since it's a single file with no build step, the
suitesstep nowwgets it straight fromkotkan/claude-plugin-token-budget's rawmainbranch (https://git.oleks.space/kotkan/claude-plugin-token-budget/raw/branch/main/bin/cc-tokens, confirmed publicly readable, HTTP 200 with no auth) into/tmp/ci-tools,chmod +xs it, and puts it onPATHbeforetests/run-all.shruns. No vendoring, no mock — CI now exercises the real token-budget pricing/token-accounting logic, consistent with design decision 0.1.Note: this repo has no required-status-check branch protection yet (kotkan/claude-plugin-inference-arbitrage#21 / #28 territory), so
merge_when_checks_succeedwon't actually gate anything today — arming it anyway per convention.