LibreChat/api/server
Hao bd08a363c4
🔣 fix: Encode Images From Storage Keys (#15851)
* fix: Prefer storage keys for image encoding

* fix: Sanitize assistant image errors

* fix: Sanitize agent image storage errors

* fix: Move blob image encoding into API package

* fix: Complete image encoder TypeScript migration

* fix: Keep request-boundary error logs diagnosable

getSafeErrorMetadata reduces an error to { type: 'Error' } and an optional
status. That is the right bound where an error may echo submitted content, and
it stays in place at getS3FileStream, getAzureFileStream and
getFirebaseFileStream, where a signed URL reaches the log.

Applied at ResumableAgentController's initialization catch and the chatV1
generic branch it blinded the whole route: a missing key, an agent that fails to
load and a database error all logged as { type: 'Error' }, with no message,
name, code or stack.

getSafeErrorText keeps the error's own description and stack, reduces every URL
to its origin so an object path and signature cannot ride along, and strips
bearer credentials. It returns text so the two handlers log it inside the
message and pass no winston metadata, which is what stops an SDK error's own
enumerable properties (request.url, config, response.headers) from being
promoted onto the record.

---------

Co-authored-by: Danny Avila <danny@librechat.ai>
2026-09-12 12:39:26 -04:00
..
controllers 🔣 fix: Encode Images From Storage Keys (#15851) 2026-09-12 12:39:26 -04:00
middleware ⏳ fix: Separate Temporary and General Chat Retention (#15734) 2026-09-08 11:22:54 -04:00
routes 📿 fix: Inspect Stored File Locators Per Message (#15841) 2026-09-11 16:47:48 -04:00
services 🔣 fix: Encode Images From Storage Keys (#15851) 2026-09-12 12:39:26 -04:00
utils 📿 fix: Inspect Stored File Locators Per Message (#15841) 2026-09-11 16:47:48 -04:00
cleanup.js
csp.spec.js 🔌 fix: Close Leaked HTTP Server in Server Specs (#15821) 2026-09-10 15:17:06 -04:00
experimental.js 🛟 fix: Recover CodeAPI File Uploads After Throttling (#15784) 2026-09-09 15:48:11 -04:00
experimental.spec.js 🛎️ fix: Start Code Environment Reconciliation After Mongo Connects (#15620) 2026-09-04 19:08:44 -04:00
index.js 🛟 fix: Recover CodeAPI File Uploads After Throttling (#15784) 2026-09-09 15:48:11 -04:00
index.metrics.spec.js 🔌 fix: Close Leaked HTTP Server in Server Specs (#15821) 2026-09-10 15:17:06 -04:00
index.spec.js 🔌 fix: Close Leaked HTTP Server in Server Specs (#15821) 2026-09-10 15:17:06 -04:00
socialLogins.js
socialLogins.spec.js
telemetry.js 🪵 feat: Add OpenTelemetry Logs Pipeline via Winston Bridge (#15565) 2026-09-03 21:16:09 -04:00
telemetry.spec.js 🪵 feat: Add OpenTelemetry Logs Pipeline via Winston Bridge (#15565) 2026-09-03 21:16:09 -04:00