LibreChat/packages
Dustin Healy 432b70cd8f 🧪 fix: Coalesce default redactionText across PII filter helpers
The messagePiiFilterSchema declares
`redactionText: z.string().default('[REDACTED]')` but the LibreChat
config loader at api/server/services/Config/loadCustomConfig.js only
copies `result.data.modelSpecs` back onto the raw YAML object after
parsing, so Zod's parsed defaults for every other field are dropped.
An operator who omits `redactionText` ends up with `undefined` at
runtime even though the schema documents `[REDACTED]` as the default.

The browser serializer already coalesced to `[REDACTED]` for the
client side, but the server-side factory hook and the
`applyMessagePiiRedaction` helper passed `config.redactionText`
through unchanged. That produced a UX mismatch (client toasts said
`sk-[REDACTED]` while server-scrubbed prompts were stamped with
literal `undefined`) for the default-shape config.

Added a shared `DEFAULT_PII_REDACTION_TEXT` constant in
packages/api/src/agents/messagePiiFilter.ts and routed all three
helpers (factory, applyMessagePiiRedaction, serializer) through it
so the server and client always agree on the redaction text without
relying on the loader to surface schema defaults.
2026-06-07 22:04:59 -07:00
..
api 🧪 fix: Coalesce default redactionText across PII filter helpers 2026-06-07 22:04:59 -07:00
client ⬆️ chore: Bump TypeScript to 5.9.3 (+ typescript-eslint 8.60.1) (#13584) 2026-06-07 22:20:44 -04:00
data-provider 🛡️ feat: Client-Side PII Prefilter 2026-06-07 21:09:36 -07:00
data-schemas 🔧 fix: PII filter end-to-end wiring for warn/silent/block modes 2026-06-07 21:09:36 -07:00