Skip to content

A reactive notebook for Python — run reproducible experiments, query with SQL, execute as a script, deploy as an app, and version with git. Stored as pure Python. All in a modern, AI-native editor.

don't allow '.' when creating custom provider names (#8115)

Shahmir Varqha1234c1b0031b
diff --git a/frontend/src/components/app-config/ai-config.tsx b/frontend/src/components/app-config/ai-config.tsx
index 0c19fbfd89..b4db16f016 100644
--- a/frontend/src/components/app-config/ai-config.tsx
+++ b/frontend/src/components/app-config/ai-config.tsx
@@ -609,9 +609,13 @@ export const CustomProvidersConfig: React.FC<AiConfigProps> = ({
const isDuplicate =
KNOWN_PROVIDERS.includes(normalizedName as KnownProviderId) ||
(customProviders && Object.keys(customProviders).includes(normalizedName));
+ const hasInvalidChars = normalizedName.includes(".");
const hasValidValues =
- normalizedName.trim() && newProviderBaseUrl.trim() && !isDuplicate;
+ normalizedName.trim() &&
+ newProviderBaseUrl.trim() &&
+ !isDuplicate &&
+ !hasInvalidChars;
const resetForm = () => {
setNewProviderName("");
@@ -669,7 +673,12 @@ export const CustomProvidersConfig: React.FC<AiConfigProps> = ({
A provider with this name already exists.
</p>
)}
- {newProviderName && (
+ {hasInvalidChars && (
+ <p className="text-xs text-destructive">
+ Provider names cannot contain '.' characters.
+ </p>
+ )}
+ {newProviderName && !hasInvalidChars && (
<p className="text-xs text-muted-secondary">
Use models with prefix:{" "}
<Kbd className="inline text-xs">{normalizedName}/</Kbd>