Add custom base URL support for Anthropic provider#12718
Open
melissa-barca wants to merge 5 commits intomainfrom
Open
Add custom base URL support for Anthropic provider#12718melissa-barca wants to merge 5 commits intomainfrom
melissa-barca wants to merge 5 commits intomainfrom
Conversation
Support custom base URLs for the Anthropic provider to enable corporate proxies, litellm, and other Anthropic-compatible endpoints. - Add baseUrl to supportedOptions so the config dialog renders the field - Add baseUrl getter with /v1 suffix and trailing slash normalization - Pass baseURL to the Anthropic SDK client constructor - Relax sk-ant- key format validation when a custom URL is set - Handle 404 gracefully in resolveConnection for custom endpoints - Read ANTHROPIC_BASE_URL env var for autoconfigure and config dialog - Add tests for baseUrl getter, validateCredentials, and env var support
…8007) Add baseUrl support to the Anthropic Vercel provider, update the auth extension validator to derive the models endpoint from config.baseUrl, and fix the close-modal warning for autoconfigured providers.
) Route ANTHROPIC_API_KEY environment variable credentials through the auth extension's credential chain pattern so they appear as standard auth sessions. This lets other extensions access Anthropic credentials via vscode.authentication.getSession without knowing how they were configured. - Add credential chain to Anthropic auth provider for env var resolution - Add authentication.anthropic.baseUrl config setting synced from ANTHROPIC_BASE_URL env var - Protect chain sessions from UI deletion (must unset env var to remove) - Delegate env var credential checks from positron-assistant to auth extension sessions for migrated providers
|
E2E Tests 🚀 |
…8007) - Validate ANTHROPIC_API_KEY against the configured base URL during credential chain resolution, preventing sign-in with invalid keys - Sync ANTHROPIC_BASE_URL to config before chain resolution so validation uses the correct endpoint - Block removal of chain sessions when the credential source is still available (env var still set), preventing inconsistent state where models work but UI shows signed out - Show informational message when sign-out is blocked explaining that env var credentials cannot be removed from the UI
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Addresses #8007
Adds custom base URL support for Anthropic.
ANTHROPIC_BASE_URLenvironment variable for automatic configuration/v1, Vercel SDK requires it)/v1/modelsas a successful connection for custom endpoints that don't expose model listing@:assistant