fix: Add support for multimodal content (text + images)
authormkroemer <redacted>
Fri, 9 Jan 2026 19:58:56 +0000 (20:58 +0100)
committermkroemer <redacted>
Fri, 9 Jan 2026 19:58:56 +0000 (20:58 +0100)
commitd0f18d93f8bd55fed7a2f73cb16d5b4eff28476c
treee0def2e76ae63c60e1c367c6055a9d0b28512503
parentd7fee80abc264cc56545cb032da7a701b845b0e2
fix: Add support for multimodal content (text + images)

Fixes crashes when processing OpenAI Chat Completion requests with
multimodal content (array format). Previously, the code assumed message
content is always a string, causing Presidio errors and 502/503 responses
when LibreChat Agents sent vision requests.

Changes:
- Add extractTextContent() utility to safely extract text from both
  string and array content formats
- Update PII detection to handle multimodal messages
- Update secrets detection to extract text from array content
- Update message redaction to preserve images while redacting text
- Fix dashboard display to show readable content instead of [object Object]

This enables full support for OpenAI's multimodal API format while
maintaining PII/secrets protection on text portions.

Resolves issues with LibreChat Agents feature returning 502 errors.
src/routes/proxy.ts
src/secrets/detect.ts
src/services/pii-detector.ts
src/utils/content.ts [new file with mode: 0644]
git clone https://git.99rst.org/PROJECT