Skip to content

🚪 fix: Gate Artifacts Toggle on Agent Capability Flag#13665

Merged
danny-avila merged 3 commits into
danny-avila:devfrom
serhiizghama:fix/artifacts-respect-capability-disabled
Jun 20, 2026
Merged

🚪 fix: Gate Artifacts Toggle on Agent Capability Flag#13665
danny-avila merged 3 commits into
danny-avila:devfrom
serhiizghama:fix/artifacts-respect-capability-disabled

Conversation

@serhiizghama

Copy link
Copy Markdown
Contributor

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.tsx never checks the agent capabilities config, so it keeps rendering regardless of whether the capability is on.

Steps to reproduce:

  1. Enable the artifacts capability.
  2. Pin Artifacts in the chat input.
  3. Disable the artifacts capability.
  4. The artifacts toggle remains pinned.

Solution

Gate the component on artifactsEnabled from useAgentCapabilities, exactly how the sibling capability toggles already work:

  • Skills.tsxskillsEnabled
  • FileSearch.tsxcanUseFileSearch
  • CodeInterpreter.tsxcanRunCode
const { artifactsEnabled } = useAgentCapabilities(
  context?.agentsConfig?.capabilities ?? defaultAgentCapabilities,
);

if (!artifactsEnabled) {
  return null;
}

The fallback to defaultAgentCapabilities (which includes artifacts) preserves current behavior when no config is present.

Note: the issue suggested gating on PermissionTypes.ARTIFACTS / useHasAccess, but there is no ARTIFACTS permission in the permission system — artifacts is controlled as an agent capability, not a granular permission. Matching Skills.tsx's capability check is the correct mechanism here.

Testing

  1. With artifacts in the agent capabilities, the toggle renders and can be pinned as before.
  2. Remove artifacts from the capabilities (or disable it in the admin config) — the toggle no longer renders, even when previously pinned.
  3. With no agentsConfig, the default capabilities still include artifacts, so the toggle behaves as it does today.

serhiizghama and others added 2 commits June 11, 2026 08:40
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.
@danny-avila danny-avila changed the base branch from main to dev June 20, 2026 14:29
@danny-avila danny-avila changed the title fix: hide artifacts toggle when capability is disabled 🚪 fix: Gate Artifacts Toggle on Agent Capability Flag Jun 20, 2026
@danny-avila danny-avila merged commit 8824e8f into danny-avila:dev Jun 20, 2026
32 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Artifacts remain pinned if capability is disabled

2 participants