Skip to content

[AI Infra] View Chat Experience setting and documentation section requires all privileges#246311

Merged
KodeRad merged 5 commits intoelastic:mainfrom
KodeRad:ml-ai-agent-chat-experience-improve-rbac
Dec 16, 2025
Merged

[AI Infra] View Chat Experience setting and documentation section requires all privileges#246311
KodeRad merged 5 commits intoelastic:mainfrom
KodeRad:ml-ai-agent-chat-experience-improve-rbac

Conversation

@KodeRad
Copy link
Copy Markdown
Contributor

@KodeRad KodeRad commented Dec 15, 2025

Summary

Implements: https://github.com/elastic/ml-team/issues/1755
Follow up to: #244532

The goal of this PR is to make Chat Experience visible only for users who have all privileges. This is Agent and at least one Classic Assistant.

  • AI Agent card in Selection modal is now disabled based on user's capabilities to manage agents, not only view them
  • DocumentationSection is now displayed only if Chat Experience is present and Agent is chosen

To test it you have to activate feature flag in kibana.dev.yml

feature_flags.overrides:
  aiAssistant.aiAgents.enabled: true

Checklist

Check the PR satisfies following conditions.

Reviewers should verify this PR satisfies this list as well.

  • Any text added follows EUI's writing guidelines, uses sentence case text and includes i18n support
  • Documentation was added for features that require explanation or tutorials
  • Unit or functional tests were updated or added to match the most common scenarios
  • If a plugin configuration key changed, check if it needs to be allowlisted in the cloud and added to the docker list
  • This was checked for breaking HTTP API changes, and any breaking changes have been approved by the breaking-change committee. The release_note:breaking label should be applied in these situations.
  • Flaky Test Runner was used on any tests changed
  • The PR description includes the appropriate Release Notes section, and the correct release_note:* label is applied per the guidelines
  • Review the backport guidelines and apply applicable backport:* labels.

Identify risks

Does this PR introduce any risks? For example, consider risks like hard to test bugs, performance regression, potential of data loss.

Describe the risk, its severity, and mitigation for each identified risk. Invite stakeholders and evaluate how to proceed before merging.

@KodeRad KodeRad self-assigned this Dec 15, 2025
@KodeRad KodeRad added release_note:enhancement :ml backport:skip This PR does not require backporting Team:ML Team label for ML (also use :ml) t// Team:AI Infra Platform AppEx AI Infrastructure Team t// labels Dec 15, 2025
@KodeRad KodeRad marked this pull request as ready for review December 15, 2025 09:13
@KodeRad KodeRad requested a review from a team as a code owner December 15, 2025 09:13
@elasticmachine
Copy link
Copy Markdown
Contributor

Pinging @elastic/ml-ui (:ml)

@elasticmachine
Copy link
Copy Markdown
Contributor

Pinging @elastic/appex-ai-infra (Team:AI Infra)

@KodeRad KodeRad added the v9.3.0 label Dec 15, 2025
config.showAiAssistantsVisibilitySetting === false ? false : !isSolutionView;

const hasObservabilityAssistant =
services.application.capabilities.observabilityAIAssistant?.show === true;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit, capabilities could be extracted on line 40. just to make this code a bit more readable.

  const {
    services: {
      spaces,
      application: { capabilities },
    },
  } = useKibana();

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good thought! Improved here c43c070

@botelastic botelastic Bot added the ci:project-deploy-observability Create an Observability project label Dec 15, 2025
@github-actions
Copy link
Copy Markdown
Contributor

🤖 GitHub comments

Expand to view the GitHub comments

Just comment with:

  • /oblt-deploy : Deploy a Kibana instance using the Observability test environments.
  • run docs-build : Re-trigger the docs validation. (use unformatted text in the comment!)

Copy link
Copy Markdown
Member

@jgowdyelastic jgowdyelastic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code LGTM
I added one code clean up comment

</EuiSplitPanel.Inner>
</EuiSplitPanel.Outer>

{isAgentExperience && (
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this fix @KodeRad! This fixes the corner case where the user enables the FF, then the Agent experience, then removes the feature flag, at which point the app would return to the default chat experience but this UI would still show.

Copy link
Copy Markdown
Member

@spong spong left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Docs visibility permissions update LGTM -- thanks @KodeRad!

@elasticmachine
Copy link
Copy Markdown
Contributor

elasticmachine commented Dec 15, 2025

💛 Build succeeded, but was flaky

  • Buildkite Build
  • Commit: b1434f6
  • Kibana Serverless Image: docker.elastic.co/kibana-ci/kibana-serverless:pr-246311-b1434f66ce1a

Failed CI Steps

Test Failures

  • [job] [logs] FTR Configs #59 / EPM Endpoints installs and uninstalls all assets installs all assets when installing a package for the first time should have created the correct saved object

Metrics [docs]

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
aiAssistantManagementSelection 89.5KB 89.5KB +8.0B
genAiSettings 55.7KB 55.9KB +240.0B
total +248.0B

History

cc @KodeRad

@KodeRad KodeRad merged commit cbf82ca into elastic:main Dec 16, 2025
13 checks passed
@peteharverson peteharverson added release_note:skip Skip the PR/issue when compiling release notes and removed release_note:enhancement labels Dec 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:skip This PR does not require backporting ci:project-deploy-observability Create an Observability project :ml release_note:skip Skip the PR/issue when compiling release notes Team:AI Infra Platform AppEx AI Infrastructure Team t// Team:ML Team label for ML (also use :ml) t// v9.3.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants