LibreChat/api/server/controllers/agents/__tests__
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
..
askUserQuestion.e2e.spec.js 🪬 fix: Fence Agent Checkpoint Ownership and Cleanup Recovery (#15680) 2026-09-07 22:04:59 -04:00
callbacks.spec.js 🧰 feat: Unify Tool Activity, Reasoning, Search, and Agent Workflows (#14546) 2026-09-06 14:56:50 -04:00
client.contextMetadata.spec.js
client.eventActorPause.spec.js 🤖 feat: make Event Actor HITL durable (#15305) 2026-08-28 08:05:11 -04:00
client.memory.spec.js
client.steerWiring.spec.js 🎒 fix: Bound Agent Attachment Context (#15694) 2026-09-07 08:16:34 -04:00
client.subagentUsage.spec.js 🧵 feat: Persist View-Only Subagent Threads (#14957) 2026-08-18 07:41:42 -04:00
client.traceContext.spec.js 🪬 feat: Configure Langfuse Trace User Identity and Metadata (#15667) 2026-09-06 17:30:23 -04:00
client.transactions.spec.js 🧾 fix: Honor Disabled Transactions on the Token-Count Fallback Path (#14774) 2026-08-12 22:31:13 -04:00
hitlCheckpoint.e2e.spec.js 🪬 fix: Fence Agent Checkpoint Ownership and Cleanup Recovery (#15680) 2026-09-07 22:04:59 -04:00
jobReplacement.spec.js
modelEndHandler.spec.js 🫠 fix: Surface Bedrock Content Filter Refusals (#15647) 2026-09-06 17:39:02 -04:00
openai.spec.js 📯 fix: Propagate Host Cancellation Into API Tools (#15812) 2026-09-10 08:29:47 -04:00
protocol.spec.js 🛫 refactor: Promote Generation Protocol V2 Automatically (#15324) 2026-08-28 17:17:09 -04:00
request.partialDisconnect.spec.js 🔣 fix: Encode Images From Storage Keys (#15851) 2026-09-12 12:39:26 -04:00
request.resumeMetadata.spec.js 🔣 fix: Encode Images From Storage Keys (#15851) 2026-09-12 12:39:26 -04:00
responses.unit.spec.js 📯 fix: Propagate Host Cancellation Into API Tools (#15812) 2026-09-10 08:29:47 -04:00
resume.spec.js 🛑 fix: Preserve BYOM Foreground Cancellation Identity (#15777) 2026-09-09 09:22:08 -04:00
steer.spec.js 🛫 refactor: Promote Generation Protocol V2 Automatically (#15324) 2026-08-28 17:17:09 -04:00
toolContext.spec.js 🧮 feat: Surface Retained Tool-Message Context Usage (#15796) 2026-09-11 15:53:29 -04:00
usageEvents.integration.spec.js 🧮 feat: Surface Retained Tool-Message Context Usage (#15796) 2026-09-11 15:53:29 -04:00
usageEvents.live.spec.js
v1.duplicate-actions.spec.js 🛞 feat: Manage Personal Code Environment Lifecycles (#15369) 2026-09-01 21:10:05 -04:00
v1.spec.js 🔣 refactor: Replace Mongo Filters With Typed Criteria (#15580) 2026-09-04 11:54:21 -04:00