Skip to content

Never stop coding. Free MIT AI gateway: one endpoint, 375 providers (150+ free), 1,400+ models Kimi, Claude, GPT, Gemini, GLM, DeepSeek, MiniMax. Works with Claude Code, Codex, Cursor, OpenCode, Cline & Copilot. Quota-aware auto-fallback, RTK+Caveman compression saves 15-95% tokens, MCP/A2A, Desktop/PWA. Built by 900+ contributors

feat: Make `providerId` nullable in `providersBatchTestSchema` and update validation to treat `null` as an absent value.

diegosouzapw7da23a90d4da
diff --git a/package-lock.json b/package-lock.json
index 34d396c9fd..f21d2afc1c 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "omniroute",
- "version": "2.3.3",
+ "version": "2.3.12",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "omniroute",
- "version": "2.3.3",
+ "version": "2.3.12",
"hasInstallScript": true,
"license": "MIT",
"workspaces": [
diff --git a/src/shared/validation/schemas.ts b/src/shared/validation/schemas.ts
index ae54f7f52e..785989a22f 100644
--- a/src/shared/validation/schemas.ts
+++ b/src/shared/validation/schemas.ts
@@ -785,10 +785,13 @@ export const updateProviderConnectionSchema = z
export const providersBatchTestSchema = z
.object({
mode: z.enum(["provider", "oauth", "free", "apikey", "compatible", "all"]),
- providerId: z.string().trim().min(1).optional(),
+ // Frontend may send null when mode != 'provider' — accept and treat as missing
+ providerId: z.string().trim().min(1).nullable().optional(),
})
.superRefine((value, ctx) => {
- if (value.mode === "provider" && !value.providerId) {
+ // Treat null same as undefined
+ const pid = value.providerId ?? null;
+ if (value.mode === "provider" && !pid) {
ctx.addIssue({
code: z.ZodIssueCode.custom,
message: "providerId is required when mode=provider",