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

@@ -0,0 +1,44 @@
import { describe, expect, it } from "vitest";
const { openaiToOpenAIResponsesRequest, openaiResponsesToOpenAIRequest } =
await import("../../open-sse/translator/request/openai-responses.js");
const CHAT_BODY = (extra = {}) => ({
model: "example-model",
messages: [{ role: "user", content: "hello" }],
...extra,
});
describe("#3216 prompt_cache_key across the chat/responses translation", () => {
it("preserves an explicit key when converting chat → responses", () => {
const out = openaiToOpenAIResponsesRequest(
"example-model",
CHAT_BODY({ prompt_cache_key: "stable-cache-key" }),
true,
{},
);
expect(out.prompt_cache_key).toBe("stable-cache-key");
});
it("does not invent a key when the client sent none", () => {
const out = openaiToOpenAIResponsesRequest("example-model", CHAT_BODY(), true, {});
expect(out.prompt_cache_key).toBeUndefined();
});
it("still drops the key on the responses → chat direction", () => {
const out = openaiResponsesToOpenAIRequest(
"example-model",
{
model: "example-model",
input: [{ role: "user", content: [{ type: "input_text", text: "hello" }] }],
prompt_cache_key: "stable-cache-key",
},
true,
{},
);
expect(out.prompt_cache_key).toBeUndefined();
});
});