fix(grok): normalize refresh errors

This commit is contained in:
Heatherm Huang
2026-07-15 09:40:08 +08:00
parent b245ab5848
commit 3a3b962de3
2 changed files with 4 additions and 4 deletions
@@ -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
@@ -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(