mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-11-16 13:00:55 +00:00
* 🧼 fix: Strip Cache-Bust Query Before Local Vision Encode
Reused code-interpreter images persist filepath with a ?v= suffix.
prepareImagesLocal now strips it before disk encode, matching crud/share.
Co-authored-by: Zsanz3 <Zsanz3@users.noreply.github.com>
* 🧪 test: Isolate prepareImagesLocal query-strip coverage
Mock sharp and resize so the local vision-encode test does not load
the rest of the file-strategy graph.
Co-authored-by: Zsanz3 <Zsanz3@users.noreply.github.com>
* 🪒 fix: Strip Cache-Bust Suffixes From Every Local File Read
Reused code-interpreter outputs persist a `?v=<timestamp>` suffix on the file
document's filepath, and local storage resolves that field into a filesystem path.
prepareImagesLocal already handled it after the cherry-picked commits; getLocalFileStream
did not, so every download-stream consumer (the download route, provisioning, agent and
skill file reads) still hit ENOENT for a regenerated image.
Move the strip into one documented helper and call it from all three local read paths.
* 🧱 refactor: Move Cache-Bust Stripping Into the Storage Package
`/api` holds wiring, not behavior, so `stripCacheBust` moves out of a new CJS helper and
into `packages/api/src/storage/path.ts`, beside `resolveDownloadPath` — the function that
already decides what a stored filepath means to a download. Its doc comment now states why
the two differ: a remote strategy's query string can carry a presigned signature, so only
the local paths may strip.
The local storage modules keep just the call into it. Semantics are covered by the storage
package's own test; the `/api` specs pin the wiring.
Addresses the Codex P1 finding on
|
||
|---|---|---|
| .. | ||
| controllers | ||
| middleware | ||
| routes | ||
| services | ||
| utils | ||
| cleanup.js | ||
| csp.spec.js | ||
| experimental.js | ||
| experimental.spec.js | ||
| index.js | ||
| index.metrics.spec.js | ||
| index.spec.js | ||
| socialLogins.js | ||
| socialLogins.spec.js | ||
| telemetry.js | ||
| telemetry.spec.js | ||