Refactor LLM provider authentication handling to default to 'none' fo… - #3051
Conversation
…r missing credentials. Update related components to ensure consistent behavior across provider configurations.
|
Warning Review limit reached
Next review available in: 49 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughLLM provider creation and updates now normalize credentials and preserve upstream authentication types. Proxy creation and provider switching default missing authentication types to ChangesLLM authentication normalization
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 4
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@portals/ai-workspace/src/contexts/llmProvider/LLMProvidersContext.tsx`:
- Around line 198-201: Update the auth object construction in the affected
provider mappings to remove the spread of provider.upstream.main.auth and
explicitly include only header, type, and value. Preserve the existing type
fallback and secret placeholder assignment, and apply the same whitelist to the
additional occurrence identified in the diff.
- Around line 278-279: Update the credential handling in the update path to trim
the incoming auth value and derive the existing credential/hasCredential state
before rotating or persisting the secret. Use that normalized state to send auth
type “none” and avoid creating or retaining a credential when the value is
empty, including whitespace-only input; do not rely on the later type fallback
after buildSecretPlaceholder.
- Around line 154-183: Update the provider normalization around hasCredential,
authType, and isNoCredentialsAuthType so any missing credential, including when
auth.type is empty, produces explicit none auth with blank header and value.
Before createSecret, explicitly reject or handle credentials whose auth type is
empty, other, or none, preventing secret creation and the later contradictory
none-with-secret state. Preserve secret creation only for credential-bearing
auth types.
In
`@portals/ai-workspace/src/pages/appShell/appShellPages/proxies/LLMProxyNew.tsx`:
- Around line 356-358: Normalize proxy authentication atomically in
LLMProxyNew.tsx lines 356-358 and LLMProxyProviderTab.tsx lines 160-164: when
the auth type is none or absent, clear both header and value; when credentials
are populated, retain them only with a matching non-none auth type. Update the
related providerAuthType, providerAuthHeader, and providerAuthValue assignments
together in both sites.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 1cd84eb6-3508-48fb-9fa3-272555d77ae9
📒 Files selected for processing (3)
portals/ai-workspace/src/contexts/llmProvider/LLMProvidersContext.tsxportals/ai-workspace/src/pages/appShell/appShellPages/proxies/LLMProxyNew.tsxportals/ai-workspace/src/pages/appShell/appShellPages/proxies/LLMProxyProviderTab.tsx
…eatment of credentials across components. Update logic to clear header and value when auth type is 'none', and adjust related components for improved clarity and functionality.
$subject