Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -692,6 +692,7 @@ func shouldReauthenticate(registered registry.Account, err error) bool {
"expired session",
"cloudflare block",
"signed-in github account not found",
"http 401",
} {
if strings.Contains(message, marker) {
return true
Expand Down
3 changes: 3 additions & 0 deletions main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,9 @@ func TestShouldReauthenticateOnlyForAuthFailures(t *testing.T) {
if !shouldReauthenticate(account, errors.New("Claude session expired or blocked (HTTP 401)")) {
t.Fatal("shouldReauthenticate() = false for expired session")
}
if !shouldReauthenticate(account, errors.New("Claude account settings read failed (HTTP 401)")) {
t.Fatal("shouldReauthenticate() = false for rejected OAuth token")
}
if shouldReauthenticate(account, errors.New("request temporarily unavailable")) {
t.Fatal("shouldReauthenticate() = true for transient failure")
}
Expand Down
Loading