Repository navigation
fix(assistant): surface Claude gateway authentication failures - #1270
Open
DivyamTalwar wants to merge 1 commit into
Open
DivyamTalwar wants to merge 1 commit into
DivyamTalwar 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.
What changed
Refs #1130.
Claude Code 2.1.329 emits an API-error assistant event and a failed result with
api_error_status: 401when a gateway rejects its credentials. The existing parser ignored both structured statuses. Because the CLI also exits nonzero, the workspace turn was reported asCLI_EXIT_NONZEROand could show the unrelatedunrecognized_modelstderr warning.The assistant now recognizes structured 401 and 403 status on CLI API-error events, including a failed result with a nonempty error message. The existing credential failure path shows the actionable authentication error, and runner-login failures keep their existing login guidance. Successful replies and ordinary model content keep their existing handling.
This addresses the error reporting part of #1130. Gateway authentication header configuration is tracked separately in #897.
Scope
Compatibility
No API response fields, stored data, or provider credential configuration change. A rejected credential now receives the existing
AUTHENTICATION_FAILEDclassification.Validation
go vet -p=2 ./internal/httpapi,git diff --check,python3 scripts/check-public.py, and Gitleaks 8.30.1 on candidate tracked files passed.Safety
Codex assisted with the code and tests. I verified the protocol using the installed CLI and confirmed the regression fails on upstream and passes with the patch.