Repository navigation
ci(pr-pipeline): fall back to the subscription token when the capture key is out of credit - #13536
Conversation
…ture's key is out of credit The capture's probe leg ran on PR_VERIFY_CLAUDE_API_KEY alone, so every capture since the key ran out went red at the probe (run 41984197946: "pr-verify-capture ended class=credit-stop", exit 1 on "Probe what head code can reach"). - The capture job reads the key's credit history (ci-workflows check-key-credit, key-job capture) after the agree step; a key inside a credit stop's window skips every key step and leaves a skipped lane record. - The probe runs continue-on-error. A handoff (credit stop, or auth 401 or 402) skips "Check the probe", and with it every step from the head checkout on, so the job ends green. Any other probe failure fails "Check the probe" before head code runs. - The probing marker and the credit-stop marker are written, scanned and uploaded before the head checkout only, so head code cannot forge one. - A new capture-subscription job, on its own VM, holds only PR_VERIFY_CLAUDE_CODE_OAUTH_TOKEN and repeats the capture job's steps, the reach probe included. It runs when the capture job's gate skipped the key, its probe handed off, or the key is empty. It uploads the same pr-capture-<pr>-<head-sha> name, which find-capture.mjs reads per run. - capture-probe.mjs also scans ~/.claude/.credentials.json, where Claude Code keeps a subscription login on Linux. - Retention rows for both markers, a lane-funding entry for the new job, and merge.verify-capture.app set to claude-code-plugins again. Refs: #12232 Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude Code keeps a subscription login in ~/.claude/.credentials.json on Linux, and capture-subscription now holds a subscription token. Every run-claude-cli step in both capture jobs denies Read(~/.claude/**) and Edit(~/.claude/**). The probe writes a harmless fence file under ~/.claude and checks that its Read was refused, beside /proc/self/environ and the prompt file, so the fence is proven on a file that exists. Refs: #12232 Co-Authored-By: Claude Opus 5.5 <[email protected]>
…managed settings Head code in the drive leg can write ~/.claude/settings.json or the head's .claude/settings*.json, which Claude Code reloads mid-session. Both capture jobs now pass apply-claude-managed-settings a settings input: the action's required pins plus env.CLAUDE_CODE_SUBPROCESS_ENV_SCRUB "1" and env.NODE_TLS_REJECT_UNAUTHORIZED "1". Managed settings sit above every file, and an env block follows that order. The marker comments no longer claim a marker cannot be forged: any same-repository pull_request workflow can upload either name, and a forged one only moves captures to the subscription token. Refs: #12232 Co-Authored-By: Claude Opus 5.5 <[email protected]>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
claude-security-review reviewed Security review: no security issues foundcritical-findings: 0 I read every hunk of all 7 changed files in What I checkedThe new
Credit markers
Pinned actions
Not covered
Spend (not a finding, not a hold)
|
|
claude-review reviewed Code review: no findingsI read every hunk of all 7 changed files. The change does what the PR says: What I checked against the code
Not verified (author-claimed)
Other checks
Spend (not a finding): setting |
|
The pr-verify verifier failed head What it wrote (35 lines)This pull request leaves the merge queue, and ci-status holds it out while it carries |
Refs: #12232
Summary
The pr-verify capture goes back on, now with a credential fallback the owner chose in session: "The keys are promotional, so its $200 per account. If they're used up - it should efficiently fall back to the subscription token in GitHub actions". The
capturejob triesPR_VERIFY_CLAUDE_API_KEYfirst. When that key is out of credit, a separatecapture-subscriptionjob captures onPR_VERIFY_CLAUDE_CODE_OAUTH_TOKEN. Each job holds one credential, the same shape pr-verify's judges use (.github/workflows/pr-verify.yml:32-43). The decision is recorded on the issue: issuecomment-6662742618.Fix
.github/workflows/pr-verify-capture.yml:capturereads the key's credit history with ci-workflowscheck-key-credit(pinned b8bdd7f) and skips the key while a credit stop is insideKEY_CREDIT_WINDOW_HOURS(1 h unset)..github/artifact-retention.json. Any same-repo workflow can still upload a marker with that name. A forged one can only skip the key leg, which moves captures to the subscription token. That costs plan capacity and leaks nothing. The workflow comments now say so.continue-on-error. "Check the probe" fails on any probe outcome other than success unless the probe handed off, and it is skipped on a handoff. Every step from the head checkout on needs the probe check to have succeeded. Run 41984197946 went red in the probe step itself.capture-subscription: runs on a fresh VM only whencapturehanded off, skipped the key, or had no key. Those facts come from steps that run before the head checkout and are compared to literals. It repeats every step, the reach probe included, and uploads the samepr-capture-<pr>-<head-sha>name.find-capture.mjsreads the run's conclusion and artifacts, so it needed no change.Read(~/.claude/**)andEdit(~/.claude/**). The probe proves the fence with a refused Read of a fence file that exists.capture-probe.mjsalso scans~/.claude/.credentials.json.env.CLAUDE_CODE_SUBPROCESS_ENV_SCRUB: "1"andenv.NODE_TLS_REJECT_UNAUTHORIZED: "1", so head code that writes a settings file mid-session cannot turn off the scrub or TLS checks.Also:
.github/lane-funding.jsongets thecapture-subscriptionlane.docs/conventions/pr-pipeline.yamlsetsmerge.verify-capture.app: claude-code-pluginsagain.Verification
node --testover.github/scripts/pr-verify/*.test.mjs: 298 pass, 0 fail. workflow.test holds the two jobs' fences and settings equal and checks that no step after the head checkout runs when the probe check is skipped.check-artifact-retention --check: 98 uploads matched. zizmor offline: no findings. Local actionlint reports only the existingcache-modekey.find-capture.mjsWAIT_MS). The key handoff took 36 s in run 41984197946, and the subscription job has a 30 min timeout. If the second job queues more than about 5 min, the judges record arunningmiss, and a miss never fails a verdict.Remaining
Related
🤖 Generated with Claude Code