Commit cd71afc
Add zero-config free tier via GitHub OIDC + hosted proxy
The action required an llm_api_key secret. It can now run with NO secret on a
free hosted tier: when the workflow grants `permissions: id-token: write` and no
key/license is given, the action mints a GitHub Actions OIDC JWT and points the
engine's OPENROUTER_BASE_URL at CodeBoarding's gha_proxy, which verifies the
token, meters per repository owner against a weekly cap, and swaps in the real
OpenRouter key. A user key or a CodeBoarding license remain the more-usage paths.
Backward compatible — stays on @v1. A secret-based workflow behaves identically
(no OIDC, no base-url override, same provider preflight).
Changes:
- Inputs: llm_api_key now optional (default ''); add proxy_url (the gha_proxy
Function URL) and license_key.
- "Prepare & verify LLM key": three credential modes in precedence order —
byokey (current behavior verbatim) / license (bearer = license, base-url =
proxy) / oidc (mint from ACTIONS_ID_TOKEN_REQUEST_URL/_TOKEN with
&audience=codeboarding-proxy, base-url = proxy). Hosted modes pin OpenRouter +
default models and skip the openrouter.ai preflight; the JWT/license is masked.
Writes a `mode` output.
- Engine-run steps (base/head/analyze): export OPENROUTER_BASE_URL from
cb-base-url when present (hosted modes only); export CB_QUOTA_SENTINEL so the
adapter can flag a 402. cb-base-url added to the key-material cleanup.
- Cache key folds in the credential mode so switching free-tier <-> BYO key never
reuses the other mode's cached base analysis.
- engine_adapter.py: detect HTTP 402 / "Resource exhausted: token limit reached"
(status attr or cause chain) and drop a cb-quota-exhausted sentinel, then
re-raise so the step still fails. The failure-comment step branches on the
sentinel to post a "free weekly limit reached — add a key/license" comment.
- README: zero-config quick start (no secret, requires id-token: write), a "More
usage" section for the key/license paths, updated inputs table.
- Tests: 8 new (quota detection by status/marker/cause-chain; main() drops the
sentinel on 402 and not on other errors). Full suite 156, all green.
The 200/402 paths against the dev proxy need a real id-token: write workflow;
exercised separately. The proxy is licensing-aws#10 (deploy prod + bake the prod
proxy_url default before merging this).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent 3a21003 commit cd71afc
4 files changed
Lines changed: 326 additions & 52 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
77 | 77 | | |
78 | 78 | | |
79 | 79 | | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
80 | 84 | | |
81 | 85 | | |
82 | 86 | | |
| |||
95 | 99 | | |
96 | 100 | | |
97 | 101 | | |
98 | | - | |
99 | | - | |
100 | 102 | | |
101 | 103 | | |
102 | | - | |
| 104 | + | |
103 | 105 | | |
104 | | - | |
105 | | - | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
106 | 112 | | |
107 | 113 | | |
108 | | - | |
| 114 | + | |
| 115 | + | |
109 | 116 | | |
110 | | - | |
| 117 | + | |
111 | 118 | | |
112 | 119 | | |
113 | 120 | | |
114 | | - | |
115 | | - | |
116 | | - | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
117 | 125 | | |
118 | 126 | | |
| 127 | + | |
| 128 | + | |
119 | 129 | | |
120 | 130 | | |
121 | 131 | | |
| |||
193 | 203 | | |
194 | 204 | | |
195 | 205 | | |
| 206 | + | |
196 | 207 | | |
197 | 208 | | |
198 | 209 | | |
| |||
206 | 217 | | |
207 | 218 | | |
208 | 219 | | |
209 | | - | |
| 220 | + | |
| 221 | + | |
210 | 222 | | |
211 | 223 | | |
212 | 224 | | |
| |||
240 | 252 | | |
241 | 253 | | |
242 | 254 | | |
243 | | - | |
244 | | - | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
245 | 259 | | |
246 | 260 | | |
247 | 261 | | |
| |||
0 commit comments