Skip to content

[Bug]: Code API file persistance issues #16664

Closed

Description

@nico525

What happened?

Hi,

I am running LibreChat with a custom written Code API in python. The API itself is working fine and I can flawlessly generate files and transfer them to LibreChat. However, i recognized that there are issues related to the file size which I can somehow reproduce.

Whenever I ask the chatbot to generate a binary fiel of size X it works roughly until 50-100kb. Bigger files do work well from Code API perspective, but the file doesn't get populated back into LibreChat. I can see the icon of the file, but the download doesn't work as the file transport got corrupted mit transfer.
The Code API responds with the correct headers, file body and status code 200. LibreChat however aborts mid stream. i did add like a lot of debugging logs around

const downloadCodeOutputBuffer = async ({
but couldn't really find it out

what's really suspicious is the fact of the fiel size. it works for smaller ones, I could imagine that some wrapper outside (e.g. agent loop?) kills the request

Version Information

librechat v0.8.8

Steps to Reproduce

  1. Add Code Execution to your modelspec
  2. ask it to generate a 10mb binary file
  3. see the file in teh response, but no data is stored in the db or container. HTTP Stream got aborted is aborted

What browsers are you seeing the problem on?

Firefox

Relevant log output

there are no signs in the log, but the browser request to api/files/code/download/... returns 200 with just parts of the file (e.g. 600kb instead of 5mb)
A download is not triggered in the browser

Screenshots

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct

Activity

  1. locked and limited conversation to collaborators on Oct 2, 2026
  2. converted this issue into a discussion #16667 on Oct 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    🐛 bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions