LibreChat/api/server/controllers/agents
shars ac8cdcc1ea fix(agents): keep file context in the message that carries the file
With execute_code and resendFiles, a code-environment file is loaded into
the turn's attachments on every turn. addPreviousAttachments treated every
attachment as submitted by the current request, so the file's text was cut
from the message it was attached to and added to the newest message. The
bytes in the middle of the history changed each turn and the provider cache
stopped at that point.

Only files named in req.body.files move to the current message. A refreshed
tool file stays in its own message, and the latest message skips files an
earlier message already carries, so the text appears once and the attachment
limits count it once.

Reported-by: FFourtyTwo
2026-11-02 10:32:23 +03:00
..
__tests__ 🦿 chore: Bump Agents SDK to 4.2.1 (#17664) 2026-10-31 15:17:05 -04:00
callbacks.background.spec.js 🛂 feat: Filter Model-Bound Content by Source (#14425) 2026-08-21 22:43:32 -04:00
callbacks.js 🧯 fix: Guard SSE Writes and Interval Cleanups Against Crashes (#17462) 2026-10-27 23:06:58 +01:00
client.codeDecision.spec.js 🍯 fix: Stop Approval Pauses From Unsealing Code Environments (#15963) 2026-09-15 12:30:37 -04:00
client.imageDetail.spec.js 🖍️ fix: Honor Agent Image Detail Settings (#15407) 2026-08-31 08:34:05 -04:00
client.js fix(agents): keep file context in the message that carries the file 2026-11-02 10:32:23 +03:00
client.test.js fix(agents): keep file context in the message that carries the file 2026-11-02 10:32:23 +03:00
filterAuthorizedTools.spec.js 🚚 chore: Point Repository and Image References at LibreChat-AI (#16005) 2026-09-23 23:08:36 -04:00
openai.js 🔑 perf: Cache JWT Users and Batch Auth-Path Reads (#17466) 2026-10-30 00:24:08 +01:00
protocol.js 🛫 refactor: Promote Generation Protocol V2 Automatically (#15324) 2026-08-28 17:17:09 -04:00
queuedTurns.js 🍱 fix: Carry Coding Approval Mode With Queued Turns (#16326) 2026-09-25 07:28:43 -04:00
recordCollectedUsage.spec.js 🥢 fix: Fit MCP App Snapshots Within Message Documents (#16299) 2026-10-01 03:46:17 +00:00
request.js 🛟 fix: Promote Reconciled Compaction Snapshots to the Terminal Row (#16553) 2026-10-28 11:13:50 +01:00
responses.js 🔑 perf: Cache JWT Users and Batch Auth-Path Reads (#17466) 2026-10-30 00:24:08 +01:00
resume.js 🐘 fix: Preserve Authored Skills Across Approval Resumes (#17630) 2026-10-29 22:17:03 +01:00
steer.js 📬 feat: Move Agent Queued Turns Server-Side (#15370) 2026-08-30 21:53:58 -04:00
v1.js 🔗 feat: Link Langfuse Prompts as Agent Instructions (#17294) 2026-10-30 17:28:37 +01:00
v1.spec.js 🔗 feat: Link Langfuse Prompts as Agent Instructions (#17294) 2026-10-30 17:28:37 +01:00