mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-08-21 22:52:19 +03:00
Reconciliado com a release (mesmo drift dos PRs irmãos em typecheck-baseline/glm.ts/fetchTimeout.ts/stryker.conf.json). Validado: lint limpo, teste focado passando. Fix real (schema Zod não incluía customSystemPromptEnabled/customSystemPrompt, causando perda silenciosa da configuração). CI vermelho é o base-red já rastreado em #9985. Obrigado!
This commit is contained in:
@@ -174,6 +174,8 @@ export const updateSettingsSchema = z.object({
|
||||
)
|
||||
.optional(),
|
||||
customBannedSignals: z.array(z.string().max(200)).optional(),
|
||||
customSystemPromptEnabled: z.boolean().optional(),
|
||||
customSystemPrompt: z.string().max(10000).optional(),
|
||||
// #9817: opt-in (default off) — lets a probe-origin (model test-all)
|
||||
// failure deactivate a connection like real traffic. Off by default:
|
||||
// probe failures are recorded but never mutate routing state.
|
||||
|
||||
15
tests/unit/custom-system-prompt-settings-persistence.test.ts
Normal file
15
tests/unit/custom-system-prompt-settings-persistence.test.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
import test from "node:test";
|
||||
import assert from "node:assert/strict";
|
||||
import { updateSettingsSchema } from "@/shared/validation/settingsSchemas";
|
||||
|
||||
test("updateSettingsSchema preserves customSystemPromptEnabled and customSystemPrompt fields", () => {
|
||||
const input = {
|
||||
customSystemPromptEnabled: true,
|
||||
customSystemPrompt: "Always respond politely",
|
||||
};
|
||||
|
||||
const parsed = updateSettingsSchema.parse(input);
|
||||
|
||||
assert.equal(parsed.customSystemPromptEnabled, true);
|
||||
assert.equal(parsed.customSystemPrompt, "Always respond politely");
|
||||
});
|
||||
Reference in New Issue
Block a user