fix: use safeFetch for Copilot Plus to bypass browser TLS errors (#2255)

Browser's native fetch() fails with net::ERR_CERT_AUTHORITY_INVALID when
calling models.brevilabs.com. Using safeFetch routes through Obsidian's
requestUrl (Node/Electron layer), bypassing browser-level TLS validation.

Fixes #2250

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Logan Yang 2026-03-03 18:03:39 -08:00 committed by GitHub
parent d7d54d2a34
commit fcac972bb2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -347,7 +347,7 @@ export default class ChatModelManager {
apiKey: await getDecryptedKey(settings.plusLicenseKey),
configuration: {
baseURL: BREVILABS_MODELS_BASE_URL,
fetch: customModel.enableCors ? safeFetch : undefined,
fetch: safeFetch,
},
},
[ChatModelProviders.MISTRAL]: {