fix(ui): show correct endpoint URL in intro screen for custom Anthropic endpoints (#735)
Previously, the startup intro screen always displayed 'https://api.anthropic.com' as the endpoint for Anthropic provider, even when a custom endpoint was configured via ANTHROPIC_BASE_URL. This fix reads ANTHROPIC_BASE_URL from environment and displays the actual configured endpoint, providing accurate information to users about where their API requests will be sent (proxy gateways, staging, custom Anthropic-compatible APIs). Also adds isLocal detection for local endpoints to show appropriate visual indicator in the startup banner. Co-authored-by: Ali Alakbarli <ali.alakbarli@users.noreply.github.com>
This commit is contained in:
@@ -153,7 +153,9 @@ function detectProvider(): { name: string; model: string; baseUrl: string; isLoc
|
|||||||
const settings = getSettings_DEPRECATED() || {}
|
const settings = getSettings_DEPRECATED() || {}
|
||||||
const modelSetting = settings.model || process.env.ANTHROPIC_MODEL || process.env.CLAUDE_MODEL || 'claude-sonnet-4-6'
|
const modelSetting = settings.model || process.env.ANTHROPIC_MODEL || process.env.CLAUDE_MODEL || 'claude-sonnet-4-6'
|
||||||
const resolvedModel = parseUserSpecifiedModel(modelSetting)
|
const resolvedModel = parseUserSpecifiedModel(modelSetting)
|
||||||
return { name: 'Anthropic', model: resolvedModel, baseUrl: 'https://api.anthropic.com', isLocal: false }
|
const baseUrl = process.env.ANTHROPIC_BASE_URL ?? 'https://api.anthropic.com'
|
||||||
|
const isLocal = isLocalProviderUrl(baseUrl)
|
||||||
|
return { name: 'Anthropic', model: resolvedModel, baseUrl, isLocal }
|
||||||
}
|
}
|
||||||
|
|
||||||
// ─── Box drawing ──────────────────────────────────────────────────────────────
|
// ─── Box drawing ──────────────────────────────────────────────────────────────
|
||||||
|
|||||||
Reference in New Issue
Block a user