🚪 fix: Gate Artifacts Toggle on Agent Capability Flag#13665
Merged
danny-avila merged 3 commits intoJun 20, 2026
Merged
Conversation
The artifacts badge ignored the agent capabilities config, so a pinned toggle stayed visible after the artifacts capability was turned off. Gate the component on artifactsEnabled via useAgentCapabilities, matching how Skills, FileSearch and CodeInterpreter already handle their capability.
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.
Problem
Fixes #13659.
When the artifacts capability is enabled, pinned in the chat input, and then disabled again, the artifacts toggle stays pinned and visible. Unlike the other capability toggles,
Artifacts.tsxnever checks the agent capabilities config, so it keeps rendering regardless of whether the capability is on.Steps to reproduce:
artifactscapability.artifactscapability.Solution
Gate the component on
artifactsEnabledfromuseAgentCapabilities, exactly how the sibling capability toggles already work:Skills.tsx→skillsEnabledFileSearch.tsx→canUseFileSearchCodeInterpreter.tsx→canRunCodeThe fallback to
defaultAgentCapabilities(which includesartifacts) preserves current behavior when no config is present.Testing
artifactsin the agent capabilities, the toggle renders and can be pinned as before.artifactsfrom the capabilities (or disable it in the admin config) — the toggle no longer renders, even when previously pinned.agentsConfig, the default capabilities still includeartifacts, so the toggle behaves as it does today.