fix(ui/team): annotate effectiveGuardrails as string[] for strict typecheck
Some checks failed
Unit Tests: Proxy DB Operations / proxy-db (auth-checks, tests/proxy_unit_tests/test_auth_checks.py tests/proxy_unit_tests/test_user_api_key_auth.py, 20, 8) (push) Has been cancelled
Unit Tests: Proxy DB Operations / proxy-db (key-generation, tests/proxy_unit_tests/test_key_generate_prisma.py, 30, 0) (push) Has been cancelled
Unit Tests: Proxy DB Operations / proxy-db (remaining, tests/proxy_unit_tests --ignore=tests/proxy_unit_tests/test_key_generate_prisma.py --ignore=tests/proxy_unit_tests/test_auth_checks.py --ignore=tests/proxy_unit_tests/test_user_api_key_auth.py, 20, 8) (push) Has been cancelled
Unit Tests: Security / security (push) Has been cancelled

The new effectiveGuardrails computation derived its element type from
`info.metadata?.guardrails`, which is implicitly typed `any[]`, so the
downstream `.map((name) => ...)` callback inferred `name` as implicit
`any` and broke the production typecheck.
This commit is contained in:
Ryan Crabbe 2026-04-11 16:30:51 -07:00
parent 3d72e2a6f3
commit 30c2357fe3
No known key found for this signature in database

View file

@ -610,10 +610,10 @@ const TeamInfoView: React.FC<TeamInfoProps> = ({
const initialKillSwitchOn = info.metadata?.disable_global_guardrails === true;
const optedOutGlobals = new Set<string>(info.metadata?.opted_out_global_guardrails || []);
const nonGlobalOptIns = (info.metadata?.guardrails || []).filter(
const nonGlobalOptIns: string[] = (info.metadata?.guardrails || []).filter(
(n: string) => !globalGuardrailNames.has(n),
);
const effectiveGuardrails = initialKillSwitchOn
const effectiveGuardrails: string[] = initialKillSwitchOn
? nonGlobalOptIns
: [
...Array.from(globalGuardrailNames).filter((n) => !optedOutGlobals.has(n)),