diff --git a/backend/internal/service/admin_account_concurrency_test.go b/backend/internal/service/admin_account_concurrency_test.go index 3544f80e24..da57b5a64f 100644 --- a/backend/internal/service/admin_account_concurrency_test.go +++ b/backend/internal/service/admin_account_concurrency_test.go @@ -5,23 +5,16 @@ package service import ( "testing" - "github.com/Wei-Shaw/sub2api/internal/pkg/xai" "github.com/stretchr/testify/require" ) -func TestNormalizeAccountConcurrencyCapsGrokOAuthUnlessUnsafe(t *testing.T) { - t.Setenv(xai.EnvUnsafeAllowHighConcurrency, "") - +func TestNormalizeAccountConcurrencyDefaultsInvalidGrokOAuthToOne(t *testing.T) { require.Equal(t, 1, normalizeAccountConcurrency(PlatformGrok, AccountTypeOAuth, 0)) require.Equal(t, 1, normalizeAccountConcurrency(PlatformGrok, AccountTypeOAuth, -5)) - require.Equal(t, 1, normalizeAccountConcurrency(PlatformGrok, AccountTypeOAuth, 50)) +} + +func TestNormalizeAccountConcurrencyPreservesExplicitValues(t *testing.T) { + require.Equal(t, 50, normalizeAccountConcurrency(PlatformGrok, AccountTypeOAuth, 50)) require.Equal(t, 2, normalizeAccountConcurrency(PlatformOpenAI, AccountTypeOAuth, 2)) require.Equal(t, 2, normalizeAccountConcurrency(PlatformGrok, AccountTypeAPIKey, 2)) } - -func TestNormalizeAccountConcurrencyAllowsGrokOAuthUnsafeOverride(t *testing.T) { - t.Setenv(xai.EnvUnsafeAllowHighConcurrency, "true") - - require.Equal(t, 50, normalizeAccountConcurrency(PlatformGrok, AccountTypeOAuth, 50)) - require.Equal(t, 1, normalizeAccountConcurrency(PlatformGrok, AccountTypeOAuth, 0)) -} diff --git a/backend/internal/service/admin_service.go b/backend/internal/service/admin_service.go index bacd134db4..7685174f3b 100644 --- a/backend/internal/service/admin_service.go +++ b/backend/internal/service/admin_service.go @@ -2640,9 +2640,6 @@ func normalizeAccountConcurrency(platform, accountType string, concurrency int) if concurrency <= 0 { return 1 } - if concurrency > 1 && !xai.AllowUnsafeHighConcurrency() { - return 1 - } } return concurrency }