From b245ab5848e6fddc066eeae44293e7f1be1dfe90 Mon Sep 17 00:00:00 2001 From: Heatherm Huang Date: Tue, 14 Jul 2026 07:52:40 +0800 Subject: [PATCH] fix(grok): satisfy pool health lint --- .../repository/account_repo_temp_unsched_test.go | 4 +++- backend/internal/service/grok_oauth_reconciliation.go | 4 ++-- backend/internal/service/oauth_refresh_api.go | 2 +- .../service/token_refresh_service_candidates_test.go | 9 --------- 4 files changed, 6 insertions(+), 13 deletions(-) diff --git a/backend/internal/repository/account_repo_temp_unsched_test.go b/backend/internal/repository/account_repo_temp_unsched_test.go index 3601c57452..df1e7abf3b 100644 --- a/backend/internal/repository/account_repo_temp_unsched_test.go +++ b/backend/internal/repository/account_repo_temp_unsched_test.go @@ -297,7 +297,9 @@ func TestAccountRepository_ListOAuthRefreshCandidatePage_SQLFilter(t *testing.T) require.Len(t, capturedArgs, 3) require.Equal(t, int64(100), capturedArgs[1]) require.Equal(t, 200, capturedArgs[2]) - platforms, err := capturedArgs[0].(interface{ Value() (driver.Value, error) }).Value() + valuer, ok := capturedArgs[0].(interface{ Value() (driver.Value, error) }) + require.True(t, ok) + platforms, err := valuer.Value() require.NoError(t, err) require.Contains(t, platforms, service.PlatformGrok) require.NoError(t, mock.ExpectationsWereMet()) diff --git a/backend/internal/service/grok_oauth_reconciliation.go b/backend/internal/service/grok_oauth_reconciliation.go index 96475671d2..ca7611191f 100644 --- a/backend/internal/service/grok_oauth_reconciliation.go +++ b/backend/internal/service/grok_oauth_reconciliation.go @@ -170,11 +170,11 @@ func (s *TokenRefreshService) ReconcileGrokOAuth(ctx context.Context, input Grok registration, ok := s.grokRegistration() if !ok { - return nil, errors.New("Grok OAuth refresher is not registered") + return nil, errors.New("grok OAuth refresher is not registered") } conditionalErrorRepo, supportsConditionalError := s.accountRepo.(GrokOAuthConditionalErrorRepository) if input.Apply && !supportsConditionalError { - return nil, errors.New("Grok OAuth conditional error mutation is not configured") + return nil, errors.New("grok OAuth conditional error mutation is not configured") } providerState := &tokenRefreshProviderState{ service: s, diff --git a/backend/internal/service/oauth_refresh_api.go b/backend/internal/service/oauth_refresh_api.go index 6746402226..8b98bfdd73 100644 --- a/backend/internal/service/oauth_refresh_api.go +++ b/backend/internal/service/oauth_refresh_api.go @@ -297,7 +297,7 @@ func (api *OAuthRefreshAPI) RefreshIfNeeded( conditionalRepo, ok := api.accountRepo.(GrokOAuthRefreshSuccessRepository) if !ok { return nil, &providerConfigurationRefreshError{ - err: fmt.Errorf("Grok OAuth refresh success CAS repository is not configured"), + err: fmt.Errorf("grok OAuth refresh success CAS repository is not configured"), } } applied, updateErr := conditionalRepo.UpdateGrokOAuthCredentialsIfUnchanged( diff --git a/backend/internal/service/token_refresh_service_candidates_test.go b/backend/internal/service/token_refresh_service_candidates_test.go index df0ed3a49b..ac4e3cf4f0 100644 --- a/backend/internal/service/token_refresh_service_candidates_test.go +++ b/backend/internal/service/token_refresh_service_candidates_test.go @@ -98,15 +98,6 @@ func (r *tokenRefreshCandidateRepo) ClearTempUnschedulable(context.Context, int6 return nil } -func isOAuthRefreshPlatform(platform string) bool { - switch platform { - case PlatformAnthropic, PlatformOpenAI, PlatformGemini, PlatformAntigravity, PlatformGrok: - return true - default: - return false - } -} - type tokenRefreshTestRefresher struct { err error }