fix(settings): add customSystemPrompt fields to updateSettingsSchema (#10865) (#10890)

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:
Rouzbeh†
2026-08-21 10:41:14 +03:30
committed by GitHub
parent 0940bb6082
commit 9fd19f5522
2 changed files with 17 additions and 0 deletions

View File

@@ -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.

View 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");
});