Send anthropic-workspace-id header in the code-review job - #223
Merged
Conversation
The repo's ANTHROPIC_API_KEY is an identity-linked key, and the API rejects such keys with 400 "anthropic-workspace-id is required" unless the header is present — the cause of every instant is_error:true/$0 code-review failure since late August. Verified locally that the Claude CLI forwards ANTHROPIC_CUSTOM_HEADERS onto its API requests (while ANTHROPIC_WORKSPACE_ID alone is ignored for API-key auth). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Root cause of the
code-reviewjob's instant failures (~300 ms, 1 turn, $0,is_error:true, no error text): the repo'sANTHROPIC_API_KEYis an identity-linked key, and the API rejects it with:The action sanitizes the error text (anthropics/claude-code-action#880), which is why the logs showed nothing.
Fix: pass the workspace id via
ANTHROPIC_CUSTOM_HEADERSstep env. Verified locally against a header-dumping server that the Claude CLI forwards this env var onto its API requests as theanthropic-workspace-idheader (and thatANTHROPIC_WORKSPACE_IDalone is ignored for API-key auth — it's only read by the workload-identity-federation path).The claude action self-skips on this PR (workflow-validation guard); real verification happens on PR #221 after merge.
🤖 Generated with Claude Code