fix(review-swarm): make the auth gate actually validate, and fingerprint the key - #232
Conversation
…int the key "Validate cloud authentication" asserted only that two variables were non-empty. On 2026-09-07 it passed on every run while `agent-relay cloud run` failed one step later with `Workflow prepare failed: 401 Unauthorized` -- six PRs, repeatedly, behind a green check. A gate named for validation that tests presence is worse than no gate: it reads as cleared. Two changes: 1. Probe /api/v1/workflows/runs with the key, against the same host the CLI uses. That route requires a RESOLVED WORKSPACE and returns 401 for a fabricated or absent token -- verified against production before relying on it, because the previous attempt at this check probed /auth/whoami, which passes `allowMissingWorkspace: true` and therefore certifies tokens that cannot launch anything. 2. Print a non-reversible fingerprint, sha256 first 12 chars. The fingerprint exists because of a question I could not answer tonight. The mint proved the credential works (200 from that same route, from a GitHub runner, 90 seconds earlier) and the swarm's launch still 401'd. Production worker logs confirmed the token reaching /workflows/prepare resolved to no api_token_sessions row at all. Whether CI is using the credential the mint installed is unanswerable from outside, because the value is masked everywhere it appears. A fingerprint on both ends settles it in one line. The error tells the operator to re-mint rather than re-run, because re-running was the wrong instinct all evening: a stale credential does not become valid on retry. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FtQSAcGDta5VH9xiZFT4sR
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Team Run ID: 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. Comment |
There was a problem hiding this comment.
All reported issues were addressed across 1 file
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FtQSAcGDta5VH9xiZFT4sR
There was a problem hiding this comment.
Spec review at 1a43d2f: BLOCKED / leave open.
This serves RFC-0001 covenant 2 (check authentication before starting) and §2 rule 7 (a real review swarm, not a green vendor check). The fingerprint helps diagnose credential mismatch without printing the credential.
Blocking content finding: .github/workflows/review-swarm.yml:75-81 invokes curl without connect/total timeouts, hides curl failures behind || echo 000, and recommends credential rotation for every non-200 response, including transport failures and server errors. Bound the probe and distinguish transport/HTTP failures from 401. The existing unresolved thread discussion_r3952636976 remains valid.
The current review failure is credential infrastructure, not a content verdict. Literal command: gh run view 34163837060 --log-failed. Captured relevant output:
review Validate cloud authentication 2026-09-07T21:38:11.3476428Z ##[error]CLOUD_API_KEY is set but not accepted by https://agentrelay.com/cloud (HTTP 401). Re***mint the credential; do not re***run this job.
review Validate cloud authentication 2026-09-07T21:38:11.3487776Z ##[error]Process completed with exit code 1.
No gate edit performed: this workflow judges my assigned work, so settled decision #6 prohibits me from changing it. An independent gate owner must repair the probe on this PR branch; the cloud credential owner must restore accepted CI credentials and rerun at the final head. Leave open until those changes, real independent review, green CI at that head, and resolution of the outstanding thread. No merge attempted.
…ck secret Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FtQSAcGDta5VH9xiZFT4sR
…propagation Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FtQSAcGDta5VH9xiZFT4sR
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FtQSAcGDta5VH9xiZFT4sR
…360) Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FtQSAcGDta5VH9xiZFT4sR
Review swarm: maintainabilityNo fresh transcript was produced for run |
Review swarm: historyNo fresh transcript was produced for run |
Review swarm: structureNo fresh transcript was produced for run |
Review swarm: FAILED
Cloud run: |
kjgbot
left a comment
There was a problem hiding this comment.
Updated spec review at d7df77c: BLOCKED / leave open.
I reread the complete updated diff. This head adds a temporary canary-secret fingerprint; it does not resolve the earlier finding. .github/workflows/review-swarm.yml:79-85 still has an unbounded curl request, folds transport failure into a status string, and tells the operator to re-mint for every non-200 response. The independent gate owner must bound the probe and distinguish credential rejection from transport/server failures on this branch. Remove temporary diagnostics when no longer needed.
This supports covenant 2 preflight but still needs the above repair. Decision #6 prevents me editing the CI review gate that judges this assignment. CI authentication recovered in a separate lane and live swarms are now running; the earlier 401 evidence is historical and cannot serve as a current content verdict. Await CI at this actual head, the independent gate repair, and resolution of the outstanding thread. No merge.
It did its job. Writing a secret whose expected fingerprint I knew in advance proved secret writes DO reach runners instantly, which eliminated propagation lag and pointed at the writer -- `gh secret set --body -` storing the literal string "-" (cloud#3433). The permanent probe and the CLOUD_API_KEY fingerprint stay. Confirmed working: mint installed 91f0d17f1360 and CI received 91f0d17f1360, exact match, with "CLOUD_API_KEY authenticates against https://agentrelay.com/cloud". Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FtQSAcGDta5VH9xiZFT4sR
kjgbot
left a comment
There was a problem hiding this comment.
Final disposition at b9d030b: LEFT OPEN.
The latest head removes the temporary canary diagnostic seen at d7df77c; the full diff was read again. The original curl timeout/transport/non-auth error finding remains at .github/workflows/review-swarm.yml:75-81 and its thread remains unresolved. No gate edits by this reviewer (RFC decision #6). Independent gate owner must repair the probe on this branch. Latest-head review is still running; no green-CI claim. Leave open regardless of that run until the content finding is resolved.
Captured exact-head check query and output:
$ gh api repos/AgentWorkforce/flows/commits/b9d030bd5fefb3834a1c8abaad348a16934c22df/check-runs --jq '[.check_runs[] | {name,head_sha,status,conclusion,details_url}]'
[{"conclusion":null,"details_url":"https://github.com/AgentWorkforce/flows/actions/runs/34165035497/job/101874831362","head_sha":"b9d030bd5fefb3834a1c8abaad348a16934c22df","name":"review","status":"in_progress"},{"conclusion":"success","details_url":"https://www.cubic.dev/pr/AgentWorkforce/flows/pull/232","head_sha":"b9d030bd5fefb3834a1c8abaad348a16934c22df","name":"cubic · AI code reviewer","status":"completed"}]
exit_code=0
maintainability lens — FAILMaintainability review — PR #232,
|
history lens — PASSBlockers: none. PR #232 passes the HISTORY lens. Notes
Concerns
This verdict is a historical and documentary review; it does not certify live authentication or successful swarm execution. REVIEW_PASSED |
structure lens — MISSING |
|
🎯 review-swarm: FAILED (M:fail H:pass S:missing) Lens transcripts posted as sibling comments above. |
cubic P2 on #232, confidence 10, and right on all three counts. The probe had no timeout, so an unreachable Cloud left curl waiting until the 75-minute job timeout. Worse than the wait was the verdict: `|| echo 000` fed a transport failure into the same non-200 branch as a rejection, and the single error message told a maintainer to re-mint a credential that was never the problem. A gate that misattributes its own failure is how the last outage cost a day. Bound the request (--connect-timeout 10 --max-time 30) and split the three outcomes: a curl failure is a transport verdict, 401/403 is the credential, and any other status is Cloud being unhealthy. Each says which of the three it is and what to do about it. Verified: all six arms dispatch correctly (transport / 200 / 401 / 403 / 502 / 429), and curl against a blackhole address returns rc=28 in ~3s rather than hanging. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FtQSAcGDta5VH9xiZFT4sR
…ood key Unbounded curl plus a conflated failure branch meant an unreachable Cloud spent 75 minutes to produce a credential accusation. Bounded and split into three named verdicts; six arms verified under bash after zsh silently ate the first run. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FtQSAcGDta5VH9xiZFT4sR
Whitespace only. I hand-resolved a conflict between #226, #232 and #235 an hour ago and carried the surrounding block's indentation onto the line I lifted out of it, so this check sat two spaces deeper than the two it belongs with. Shell does not care; a reader does, and misaligned indentation from a merge is the first thing that makes someone wonder what else the merge got wrong. Claude-Session: https://claude.ai/code/session_01FtQSAcGDta5VH9xiZFT4sR Co-authored-by: kjgbot <kjgbot@agentrelay.dev> Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
Validate cloud authenticationasserted only that two variables were non-empty:Today it passed on every run while
agent-relay cloud runfailed one step later withWorkflow prepare failed: 401 Unauthorized— six PRs, repeatedly, behind a green check. A gate named for validation that tests presence is worse than no gate: it reads as cleared.Two changes
1. Actually probe the credential against the same host the CLI uses.
/api/v1/workflows/runsrequires a resolved workspace and returns 401 for a fabricated or absent token — verified against production before relying on it, because an earlier attempt at this check probed/auth/whoami, which passesallowMissingWorkspace: trueand therefore certifies tokens that cannot launch anything.2. Print a non-reversible fingerprint (sha256, first 12 chars).
Why the fingerprint
There's a question I could not answer tonight. The mint proved the credential works — 200 from that same route, from a GitHub runner, 90 seconds earlier. The swarm's launch still 401'd. Production worker logs (
wrangler tail) confirmed the token arriving at/workflows/prepareresolved to noapi_token_sessionsrow at all.Whether CI is using the credential the mint installed is unanswerable from outside, because the value is masked everywhere it appears. A fingerprint on both ends settles it in one line instead of an evening.
The error message says re-mint, don't re-run — re-running was the wrong instinct all evening. A stale credential doesn't become valid on retry.
🤖 Generated with Claude Code
https://claude.ai/code/session_01FtQSAcGDta5VH9xiZFT4sR