fix(grok): satisfy pool health lint

This commit is contained in:
Heatherm Huang
2026-07-15 09:40:08 +08:00
parent 6a62ea1b1d
commit b245ab5848
4 changed files with 6 additions and 13 deletions
@@ -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())
@@ -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,
@@ -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(
@@ -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
}