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

1.0 KB
Raw Blame
// #5446 follow-up (PR #5881 checklist item 4): the add-connection modal pre-fills
// the Validation Model Id for Modal with the same model the server-side validator
// probes, so both sides can never drift apart.
import test from "node:test";
import assert from "node:assert/strict";

import { MODAL_DEFAULT_VALIDATION_MODEL_ID } from "../../src/shared/constants/modal";
import { defaultValidationModelIdForProvider } from "../../src/app/(dashboard)/dashboard/providers/[id]/providerPageHelpers";

test("modal pre-fills the server probe model as Validation Model Id", () => {
  assert.equal(defaultValidationModelIdForProvider("modal"), MODAL_DEFAULT_VALIDATION_MODEL_ID);
  assert.equal(MODAL_DEFAULT_VALIDATION_MODEL_ID, "Qwen/Qwen3-4B-Thinking-2507-FP8");
});

test("other providers keep an empty Validation Model Id default", () => {
  assert.equal(defaultValidationModelIdForProvider("openai"), "");
  assert.equal(defaultValidationModelIdForProvider(""), "");
  assert.equal(defaultValidationModelIdForProvider(undefined), "");
});