Merge remote-tracking branch 'origin/master' into gitea/feature/end

Resolved conflicts taking origin/master (v0.5.55) as canonical, with local
features re-applied:
- runtime log level (LOG_LEVEL env + dashboard Settings → Logging, applied
  immediately and persisted across restarts)
- free/noAuth provider enable/disable toggle via providerStrategies.enabled
- parallel model testing (Test All Models / Test Selected Keys)
This commit is contained in:
2026-08-17 00:38:31 +07:00
parent e7470e955e
commit 7e45ead2ac
557 changed files with 53396 additions and 6935 deletions

View File

@@ -1,7 +1,7 @@
// Guards C2: regex name fallback (no catalog). Terse entries derive name; existing names untouched.
import { describe, it, expect } from "vitest";
import { deriveModelName } from "../../open-sse/providers/models/namePatterns.js";
import { normalizeModel } from "../../open-sse/providers/models/schema.js";
import { normalizeModel, normalizeModelId } from "../../open-sse/providers/models/schema.js";
describe("model name regex fallback (C2)", () => {
it("derives display name from id per family", () => {
@@ -25,4 +25,26 @@ describe("model name regex fallback (C2)", () => {
expect(m.id).toBe("glm-5");
expect(m.name).toBe("GLM 5");
});
it("normalizeModelId: dash between digits becomes a dot (version separator)", () => {
expect(normalizeModelId("claude-sonnet-4-5")).toBe("claude-sonnet-4.5");
expect(normalizeModelId("minimax-m2-5")).toBe("minimax-m2.5");
expect(normalizeModelId("deepseek-3-2")).toBe("deepseek-3.2");
});
it("normalizeModelId: preserves word-suffix hyphens (-thinking, -agentic)", () => {
expect(normalizeModelId("claude-sonnet-4-5-thinking")).toBe("claude-sonnet-4.5-thinking");
expect(normalizeModelId("claude-sonnet-4-5-thinking-agentic")).toBe("claude-sonnet-4.5-thinking-agentic");
});
it("normalizeModelId: leaves ids with no digit-digit hyphen untouched", () => {
expect(normalizeModelId("qwen3-coder-next")).toBe("qwen3-coder-next");
expect(normalizeModelId("claude-sonnet-5")).toBe("claude-sonnet-5");
expect(normalizeModelId("glm-5")).toBe("glm-5");
});
it("normalizeModelId: non-string input passes through", () => {
expect(normalizeModelId(undefined)).toBeUndefined();
expect(normalizeModelId(null)).toBeNull();
});
});