LibreChat/packages/api/src
Marco Beretta 8ae65f28dd
⚡ perf: Async Local File Saves and Compile Hot-Path Regexes Once (#16712)
* perf: Async Local File Saves and Compile Hot-Path Regexes Once

* perf: Check Closing Code Fences Without a Per-Length Regex Cache

* test: Build the Delivery Route Config Before Routing Instead of Mutating It

mergeFileConfig now memoizes by config identity, so the CSV fallback tests
must set textFallbackWithoutTools when they build the request config rather
than mutate the object after the agent's routing already merged it.

* fix: Write Local Buffers Atomically So Concurrent Saves Cannot Interleave

Async writeFile calls to one deterministic path (OpenID and SAML avatars)
could truncate and interleave each other. Write through a temp file and a
rename instead, and add scenario specs for local saves and longer closing
fences.

* refactor: Move Local Save Logic Into packages/api

saveLocalBuffer, the temp-upload move and the atomic directory writes now live
in packages/api/src/storage/local.ts and receive their paths from the caller;
the Local strategy in /api keeps its logging and calls through. The traversal
check now runs before any directory is created.

* fix: Copy Moved Uploads Through a Temp File and Rename Into Place

Concurrent async copies to one destination could interleave just like direct
writes, so moveLocalFile now fills a sibling temp file and renames it.

* fix: Contain Every Local Write and Move Inside Its Target Directory

The traversal check that guarded saveLocalBuffer now runs in writeLocalFile
and moveLocalFile too, before any directory is created, and the buffer
save accepts only the images and uploads base paths.

* test: Define the Success Assertion Inside the Local File Saves Scenario

* fix: Give Atomic Write Temp Files a Fixed-Length Name So Long Targets Still Fit

* test: Send Image Dimensions and Read the Message Array in the Local Saves Scenarios
2026-10-04 15:52:55 -04:00
..
acl
actions
admin 🔑 feat: Passkey Authentication with WebAuthn Sign-In and Management (#14715) 2026-10-01 03:46:16 +00:00
agents ⚡ perf: Async Local File Saves and Compile Hot-Path Regexes Once (#16712) 2026-10-04 15:52:55 -04:00
apiKeys 🔐 feat: Enforce Required Two-Factor Authentication (#14731) 2026-10-01 23:39:51 +02:00
app 🔭 feat: Recover Stale Chunks Without the Error Page and Ship Client Logs to RUM (#16701) 2026-10-03 23:17:56 -04:00
artifacts ⚡ perf: Async Local File Saves and Compile Hot-Path Regexes Once (#16712) 2026-10-04 15:52:55 -04:00
assistants
auth 🗝️ fix: Strengthen Two-Factor Recovery Credentials (#16742) 2026-10-04 12:16:37 -04:00
cache 🧯 fix: Outlast Failed Auth Cache Eviction on Credential Changes (#16435) 2026-10-01 03:46:18 +00:00
cdn
cluster
code 🎣 feat: Poll Durable Workspace Requests Without Rejoining Admission (#16733) 2026-10-04 13:22:42 -04:00
conversations 🖲️ fix: Enable Running Chat Menus and Preserve Renamed Titles (#16697) 2026-10-03 23:17:15 -04:00
crypto
db
endpoints 🫰 feat: Configure Tool Approval Modes Per Agent (#16707) 2026-10-04 13:14:48 -04:00
favorites 🧯 fix: Outlast Failed Auth Cache Eviction on Credential Changes (#16435) 2026-10-01 03:46:18 +00:00
files 🔐 fix: Authenticate Code Session Probes the Way Their Route Expects (#16688) 2026-10-02 20:12:08 -04:00
flow
html ⚖️ refactor: Move Policy Links to the Signup Consent (#16138) 2026-10-01 03:46:16 +00:00
images 🔐 feat: Enforce Required Two-Factor Authentication (#14731) 2026-10-01 23:39:51 +02:00
insights
langfuse
mcp 🫰 feat: Configure Tool Approval Modes Per Agent (#16707) 2026-10-04 13:14:48 -04:00
memory
middleware 🫰 feat: Configure Tool Approval Modes Per Agent (#16707) 2026-10-04 13:14:48 -04:00
modelSpecs 💬 refactor: ChatForm UI redesign with unified palette (#14473) 2026-10-01 03:46:18 +00:00
oauth 🛖 fix: Scope OAuth Binding Cookies to the Public API Path (#16649) 2026-10-02 13:21:49 -04:00
openapi
plugins
projects 🎒 feat: Carry Project Context Across Conversations (#15684) 2026-10-01 03:46:19 +00:00
prompts ♻️ refactor: Native Prompts Behind a Shared Service and Adapter (#16506) 2026-10-02 08:40:39 -04:00
protection 🐦 test: Define PII Policy and Conformance Fixtures (#16726) 2026-10-03 21:22:52 -04:00
rum 🔭 feat: Recover Stale Chunks Without the Error Page and Ship Client Logs to RUM (#16701) 2026-10-03 23:17:56 -04:00
schedules 🦫 feat: Enforce Scheduled MCP Read-Only Authority (#16681) 2026-10-03 20:39:43 -04:00
security
shared-links 📔 feat: Preserve Owner Text During PII Redaction (#16311) 2026-10-02 11:43:10 -04:00
skills 🔤 test: Cover Alias Frontmatter Keys in the Skill Sync Skip (#16725) 2026-10-04 15:28:36 +02:00
storage ⚡ perf: Async Local File Saves and Compile Hot-Path Regexes Once (#16712) 2026-10-04 15:52:55 -04:00
stream 🌲 feat: Expose Navigable Subagent Progress Trees (#16748) 2026-10-04 15:49:57 -04:00
telemetry
tools 🫰 feat: Configure Tool Approval Modes Per Agent (#16707) 2026-10-04 13:14:48 -04:00
traces
types 🦫 feat: Enforce Scheduled MCP Read-Only Authority (#16681) 2026-10-03 20:39:43 -04:00
user
utils 🫰 feat: Configure Tool Approval Modes Per Agent (#16707) 2026-10-04 13:14:48 -04:00
web 👫 fix: Keep Firecrawl and SearXNG Credentials Paired (#16538) 2026-09-29 20:54:53 -04:00
credentials.spec.ts 🧨 fix: Reject Invalid AES Credentials Before Startup (#16402) 2026-09-26 20:28:47 -04:00
credentials.ts 🧨 fix: Reject Invalid AES Credentials Before Startup (#16402) 2026-09-26 20:28:47 -04:00
imports.spec.ts
imports.ts 📔 feat: Preserve Owner Text During PII Redaction (#16311) 2026-10-02 11:43:10 -04:00
index.ts 🫰 feat: Configure Tool Approval Modes Per Agent (#16707) 2026-10-04 13:14:48 -04:00
telemetry.ts