Feat: Add configurable AI provider base URL flag and update documentation (#3059)

* feat: add FLAG_ALLOW_UNSAFE_AI_BASE_URL for configurable AI provider base URLs

* feat: add FLAG_ALLOW_UNSAFE_AI_BASE_URL documentation

* fix: remove AI_ALLOWED_BASE_URLS from documentation and environment variable reference

---------

Co-authored-by: Amruth Pillai <im.amruth@gmail.com>
This commit is contained in:
SirSKillz
2026-05-13 19:01:37 -06:00
committed by GitHub
parent 6c4a4b2aa5
commit c71f3b0b92
8 changed files with 20 additions and 28 deletions
@@ -76,17 +76,6 @@ const providerOptions: AIProviderOption[] = [
},
];
function isValidOptionalBaseURL(value: string) {
const trimmedValue = value.trim();
if (!trimmedValue) return true;
try {
return new URL(trimmedValue).protocol === "https:";
} catch {
return false;
}
}
function AIForm() {
const { set, model, apiKey, baseURL, provider, enabled, testStatus } = useAIStore();
@@ -94,7 +83,7 @@ function AIForm() {
return providerOptions.find((option) => option.value === provider);
}, [provider]);
const canTestConnection = model.trim().length > 0 && apiKey.trim().length > 0 && isValidOptionalBaseURL(baseURL);
const canTestConnection = model.trim().length > 0 && apiKey.trim().length > 0;
const { mutate: testConnection, isPending: isTesting } = useMutation(orpc.ai.testConnection.mutationOptions());