ci: fetch cc-tokens from token-budget for the suites step #22

Merged
oleks merged 1 commits from fix-20-ci-cc-tokens into main 2026-07-30 15:48:44 +03:00
Owner

Fixes kotkan/claude-plugin-inference-arbitrage#20.

What I found: cc-tokens (kotkan/claude-plugin-token-budget's bin/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 is claude plugin install token-budget@oleks-local, which is a Claude Code plugin-manager action, meaningless inside a bare CI container. bin/offload-scan's resolve_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 via importlib, then checks for Rec/price_for/parse_day attributes.

Fix (option a from the issue): since it's a single file with no build step, the suites step now wgets it straight from kotkan/claude-plugin-token-budget's raw main branch (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 on PATH before tests/run-all.sh runs. 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_succeed won't actually gate anything today — arming it anyway per convention.

Fixes kotkan/claude-plugin-inference-arbitrage#20. **What I found**: `cc-tokens` (kotkan/claude-plugin-token-budget's `bin/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 is `claude plugin install token-budget@oleks-local`, which is a Claude Code plugin-manager action, meaningless inside a bare CI container. `bin/offload-scan`'s `resolve_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 via `importlib`, then checks for `Rec`/`price_for`/`parse_day` attributes. **Fix (option a from the issue)**: since it's a single file with no build step, the `suites` step now `wget`s it straight from `kotkan/claude-plugin-token-budget`'s raw `main` branch (`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 +x`s it, and puts it on `PATH` before `tests/run-all.sh` runs. 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_succeed` won't actually gate anything today — arming it anyway per convention.
oleks added 1 commit 2026-07-30 15:48:39 +03:00
ci: fetch cc-tokens from token-budget for the suites step
ci/woodpecker/push/test Pipeline was successful
ci/woodpecker/pr/test Pipeline was successful
eba3449e60
kotkan/claude-plugin-inference-arbitrage#20 -- the bare alpine:3 CI
container has neither the Claude Code plugin cache nor `claude plugin
install`, so bin/offload-scan's cc-tokens PATH lookup always failed.
Per design decision 0.1 this plugin never vendors token-budget's
pricing/token-accounting logic, so fetch the single cc-tokens file
straight from kotkan/claude-plugin-token-budget's raw main branch and
put it on PATH before running tests/run-all.sh, rather than mocking
its behavior.
oleks scheduled this pull request to auto merge when all checks succeed 2026-07-30 15:48:43 +03:00
oleks merged commit 4230782aaa into main 2026-07-30 15:48:44 +03:00
Sign in to join this conversation.