LibreChat/api/app
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
..
clients fix(agents): keep file context in the message that carries the file 2026-11-02 10:32:23 +03:00