From f14d4685381bc896169f1bf5c789a28f5fad6b2b Mon Sep 17 00:00:00 2001 From: YG Park Date: Thu, 10 Sep 2026 16:56:16 +0900 Subject: [PATCH] fix: reauthenticate rejected OAuth sessions --- main.go | 1 + main_test.go | 3 +++ 2 files changed, 4 insertions(+) diff --git a/main.go b/main.go index b156ddc..3d92569 100644 --- a/main.go +++ b/main.go @@ -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 diff --git a/main_test.go b/main_test.go index 04d5710..620b73c 100644 --- a/main_test.go +++ b/main_test.go @@ -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") }