Repository navigation
Conversation
Contributor
|
👋 Thanks for the contribution! LibreChat merges all changes into Nothing is needed from you; your commits, reviews and discussion are unchanged. If the diff now shows files you did not touch, rebase onto git remote add upstream https://github.com/LibreChat-AI/LibreChat.git
git fetch upstream dev
git rebase upstream/dev
git push --force-with-leaseMaintainers: apply the |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request
Summary
Remote Agent responses can include generated image or file attachments, but their URLs currently point to resources protected by browser-session authentication. A headless client authenticated with a Remote Agent Bearer credential can receive the attachment metadata but cannot download its content.
This PR adds an authenticated file-content endpoint under the Remote Agents API and emits its URL in
librechat:attachmentevents. Remote Agent clients can download authorized generated files using the same Bearer credential as the Responses request, without maintaining a browser session or exposing storage paths.Fixes #18705
How it works
The endpoint reuses the existing Remote Agent authentication boundary,
fileAccessauthorization and storage strategy functions. Responses useCache-Control: no-storeandX-Content-Type-Options: nosniff, and file contents are streamed rather than buffered.Type of change
Testing
librechat:attachmentcontains/api/agents/v1/files/:file_id/content.Tested environments/configuration:
devat407b35307a47b43bb79dcfd902ae9d94c13f6243devbranch requires Node.js 24, so full TypeScript validation is deferred to GitHub CIAutomated tests:
npx jest --ci --runInBand --coverage=false src/files/remote.spec.ts src/app/metrics.spec.ts— 72 tests passednpm run test:ci --workspace=api -- --runInBand server/routes/agents/__tests__/files.spec.js server/controllers/agents/__tests__/callbacks.spec.js— 58 tests passedpackage.jsonvalidation passednpm run build:packagespassed after synchronizing dependencies with the currentdevlockfileScreenshots / recordings
No user-facing change.
Risk / compatibility
This adds a new authenticated API route and changes the attachment URL emitted to Remote Agent clients. It does not make files public and does not weaken
secureImageLinks; requests still pass through Remote Agent authentication, tenant resolution, feature checks and the existing file ACL middleware.The endpoint supports existing storage strategies through their download-stream implementation. A strategy without download-stream support returns
501 Not Implemented. Stream-open failures return an error without exposing the underlying storage path.There are no database migrations, schema changes, configuration changes or new runtime dependencies.
Checklist