From 3a3b962de3a4c18d5c9c6ffa7ae206474b5a4097 Mon Sep 17 00:00:00 2001 From: Heatherm Huang Date: Tue, 14 Jul 2026 07:54:18 +0800 Subject: [PATCH] fix(grok): normalize refresh errors --- backend/internal/service/oauth_refresh_api.go | 4 ++-- backend/internal/service/token_refresh_service.go | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/backend/internal/service/oauth_refresh_api.go b/backend/internal/service/oauth_refresh_api.go index 8b98bfdd73..c940bd335a 100644 --- a/backend/internal/service/oauth_refresh_api.go +++ b/backend/internal/service/oauth_refresh_api.go @@ -327,7 +327,7 @@ func (api *OAuthRefreshAPI) RefreshIfNeeded( readErr = fmt.Errorf("account not found after Grok OAuth success CAS miss") } return nil, &providerCycleContainmentRefreshError{ - err: fmt.Errorf("Grok OAuth success CAS lost and current state is unavailable: %w", readErr), + err: fmt.Errorf("grok OAuth success CAS lost and current state is unavailable: %w", readErr), } } slog.Info("oauth_refresh_success_cas_skipped_stale_credentials", @@ -342,7 +342,7 @@ func (api *OAuthRefreshAPI) RefreshIfNeeded( readErr = fmt.Errorf("account not found after Grok OAuth success CAS") } return nil, &providerCycleContainmentRefreshError{ - err: fmt.Errorf("Grok OAuth success persisted but durable account state is unavailable: %w", readErr), + err: fmt.Errorf("grok OAuth success persisted but durable account state is unavailable: %w", readErr), } } // The CAS changes credentials only. A concurrent admin or scheduler diff --git a/backend/internal/service/token_refresh_service.go b/backend/internal/service/token_refresh_service.go index 09c7096a27..31d2e19909 100644 --- a/backend/internal/service/token_refresh_service.go +++ b/backend/internal/service/token_refresh_service.go @@ -996,7 +996,7 @@ func (s *TokenRefreshService) refreshWithRetryWithRateGate( conditionalRepo, ok := s.accountRepo.(GrokOAuthRefreshMutationRepository) if !ok { return &providerConfigurationRefreshError{ - err: errors.New("Grok OAuth conditional refresh mutation repository is not configured"), + err: errors.New("grok OAuth conditional refresh mutation repository is not configured"), } } else { persistentlyBlocked, setErr = conditionalRepo.SetGrokOAuthRefreshErrorIfCredentialsUnchanged( @@ -1091,7 +1091,7 @@ func (s *TokenRefreshService) refreshWithRetryWithRateGate( conditionalRepo, ok := s.accountRepo.(GrokOAuthRefreshMutationRepository) if !ok { return &providerConfigurationRefreshError{ - err: errors.New("Grok OAuth conditional refresh mutation repository is not configured"), + err: errors.New("grok OAuth conditional refresh mutation repository is not configured"), } } applied, setErr := conditionalRepo.SetGrokOAuthRefreshTempUnschedulableIfCredentialsUnchanged(