Surface actionable auth-failure message in step and tracking comment - #1508
Open
maksmarcinkiewicz wants to merge 1 commit into
Open
Surface actionable auth-failure message in step and tracking comment#1508maksmarcinkiewicz wants to merge 1 commit into
maksmarcinkiewicz wants to merge 1 commit into
Conversation
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.
Fixes #1501
When the API rejects the run's credentials (expired/revoked
claude_code_oauth_tokenor invalidanthropic_api_key), the failure was generic and the tracking comment gave no cause, so an expired token surfaced as an unexplained ~2s failure. #1496 already makes such runs fail the step; this PR adds the cause and the fix instructions.Changes
base-action/src/run-claude-sdk.ts: on a failed result, checkapi_error_status; for 401/403 the error is now "authentication failed (API returned 401). If you useclaude_code_oauth_token, regenerate it withclaude setup-token; …" instead of the generic messagesrc/entrypoints/run.ts,src/entrypoints/update-comment-link.ts: surface the execution-phase error message in the tracking comment, the same way prepare-phase errors already areVerification
New test fails on the previous code and passes with the fix.
bun test771/771,bun run typecheckandbun run format:checkclean.