📎 fix: Respect fileConfig.disabled for Agents Endpoint Upload Button#12238
Merged
Conversation
The isAgents check was OR'd without the !isUploadDisabled guard, bypassing the fileConfig.endpoints.agents.disabled setting and always rendering the attach file menu for agents.
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes the attach-file UI rendering logic so the agents endpoint no longer bypasses fileConfig’s disabled flag, ensuring uploads can be properly disabled per endpoint configuration.
Changes:
- Updates the conditional that decides whether to render
AttachFileMenuso!isUploadDisabledapplies to bothisAgentsandendpointSupportsFilescases.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
Cover the isUploadDisabled rendering gate for agents and assistants endpoints, preventing silent reintroduction of the bypass bug.
b677a03 to
475f521
Compare
3c30eba to
334d918
Compare
Verify agents-disabled propagates when no provider is set, when provider has no specific config (agents as fallback), and that provider-specific enabled overrides agents disabled.
334d918 to
8a60058
Compare
jcbartle
pushed a commit
to jcbartle/LibreChat
that referenced
this pull request
May 11, 2026
…anny-avila#12238) * fix: respect fileConfig.disabled for agents endpoint upload button The isAgents check was OR'd without the !isUploadDisabled guard, bypassing the fileConfig.endpoints.agents.disabled setting and always rendering the attach file menu for agents. * test: add regression tests for fileConfig.disabled upload guard Cover the isUploadDisabled rendering gate for agents and assistants endpoints, preventing silent reintroduction of the bypass bug. * test: cover disabled fallback chain in useAgentFileConfig Verify agents-disabled propagates when no provider is set, when provider has no specific config (agents as fallback), and that provider-specific enabled overrides agents disabled.
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.
Summary
Fixed a boolean operator precedence bug in
AttachFileChatthat causedfileConfig.endpoints.agents.disabledto have no effect, and added regression tests covering the upload guard for both the agents and assistants endpoints.else ifcondition inAttachFileChat.tsxfromisAgents || (endpointSupportsFiles && !isUploadDisabled)to(isAgents || endpointSupportsFiles) && !isUploadDisabled, ensuring the!isUploadDisabledguard applies to both branches.mockFileConfiginAttachFileChat.spec.tsxfrom aconstto a mutableletwith abeforeEachreset, matching the existing pattern used formockAgentsMapandmockAgentQueryData.upload disabled renderingdescribe block: agents endpoint withfileConfig.agents.disabled: truereturning null, agents endpoint withdisableInputs: truereturning null, assistants endpoint without disabled config renderingAttachFileas a positive control, and assistants endpoint withfileConfig.assistants.disabled: truereturning null.Change Type
Testing
Verified via the new unit tests in
AttachFileChat.spec.tsx. To reproduce the bug manually before this fix: configurefileConfig.endpoints.agents.disabled: trueinlibrechat.yaml, start the app, switch to an agents conversation, and confirm the attach file button no longer renders.Test Configuration:
Run from the
clientworkspace:All 20 tests in
AttachFileChat.spec.tsxshould pass, including the 4 new tests in theupload disabled renderingblock.Checklist