LibreChat/packages/api
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
..
src 🧪 fix: Coalesce default redactionText across PII filter helpers 2026-06-07 22:04:59 -07:00
types 🔬 ci: Add TypeScript Type Checks to Backend Workflow and Fix All Type Errors (#12451) 2026-03-28 21:06:39 -04:00
.gitignore
babel.config.cjs
jest.config.mjs 📜 feat: Improve Skill Authoring Guidance (#13517) 2026-06-04 18:36:16 -04:00
jest.setup.cjs 🌱 fix: Inject Code-Tool Files Into Graph Sessions on First Call (+ read_file Sandbox Fallback) (#12831) 2026-04-27 08:56:39 +09:00
package.json ⬆️ chore: Bump TypeScript to 5.9.3 (+ typescript-eslint 8.60.1) (#13584) 2026-06-07 22:20:44 -04:00
rollup.config.js 📡 feat: Add Backend OpenTelemetry Tracing (#12909) 2026-05-14 09:08:55 -04:00
tsconfig-paths-bootstrap.mjs
tsconfig.build.json
tsconfig.json 📦 chore: npm audit fixes and Mongoose 8.23 TypeScript follow-ups (#12996) 2026-05-07 09:47:40 -04:00
tsconfig.spec.json 📦 chore: Update TypeScript Config for TS v7 (#12794) 2026-04-23 12:51:03 -04:00