Skip to content

[9.1] [GenAi] Clean up default LLM setting feature flag. (#242543)#243241

Open
KDKHD wants to merge 8 commits intoelastic:9.1from
KDKHD:backport/9.1/pr-242543
Open

[9.1] [GenAi] Clean up default LLM setting feature flag. (#242543)#243241
KDKHD wants to merge 8 commits intoelastic:9.1from
KDKHD:backport/9.1/pr-242543

Conversation

@KDKHD
Copy link
Copy Markdown
Member

@KDKHD KDKHD commented Nov 17, 2025

Backport

This will backport the following commits from main to 9.1:

Questions ?

Please refer to the Backport tool documentation

## Summary

Summarize your PR. If it involves visual changes include a screenshot or
gif.

Removes the `aiAssistant.defaultLlmSettingEnabled` feature flag and
associated cleanup.

### Changes

- **Removed feature flag**: Deleted
`AI_ASSISTANT_DEFAULT_LLM_SETTING_ENABLED` and
`AI_ASSISTANT_DEFAULT_LLM_SETTING_ENABLED_VALUE` constants from both
`gen_ai_settings` and `security_solution` plugins
- **Simplified code**: Removed all feature flag checks - now always uses
the new default connector behavior
- **Centralized constants**: Moved `DEFAULT_VALUE_REPORT_*` settings to
`@kbn/management-settings-ids` package to avoid duplication
- **Fixed serverless**: Added value report settings to
`SECURITY_PROJECT_SETTINGS` whitelist and removed unnecessary async
wrapper in `security_solution_serverless` plugin
- Serverless settings properly whitelisted for value report features

### Checklist

Check the PR satisfies following conditions.

Reviewers should verify this PR satisfies this list as well.

- [X] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)
- [X]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [X] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [X] If a plugin configuration key changed, check if it needs to be
allowlisted in the cloud and added to the [docker
list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)
- [X] 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.
- [X] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
- [X] The PR description includes the appropriate Release Notes section,
and the correct `release_note:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
- [X] Review the [backport
guidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)
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.

- [ ] [See some risk
examples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx)
- [ ] ...

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
(cherry picked from commit 2c75d4f)

# Conflicts:
#	src/platform/packages/shared/kbn-management/settings/setting_ids/index.ts
#	src/platform/packages/shared/serverless/settings/security_project/index.ts
#	x-pack/platform/plugins/private/gen_ai_settings/public/components/gen_ai_settings_app.test.tsx
#	x-pack/platform/plugins/private/gen_ai_settings/public/components/gen_ai_settings_app.tsx
#	x-pack/solutions/security/plugins/security_solution/common/constants.ts
#	x-pack/solutions/security/plugins/security_solution/public/common/hooks/use_default_ai_connector_id.test.ts
#	x-pack/solutions/security/plugins/security_solution/public/reports/components/ai_value/executive_summary.tsx
#	x-pack/solutions/security/plugins/security_solution/public/reports/components/ai_value/index.test.tsx
#	x-pack/solutions/security/plugins/security_solution/public/reports/components/ai_value/index.tsx
#	x-pack/solutions/security/plugins/security_solution/server/ui_settings.ts
#	x-pack/solutions/security/plugins/security_solution/tsconfig.json
#	x-pack/solutions/security/plugins/security_solution_serverless/server/plugin.ts
#	x-pack/solutions/security/plugins/security_solution_serverless/tsconfig.json
@KDKHD KDKHD requested a review from kibanamachine as a code owner November 17, 2025 16:31
@KDKHD KDKHD added the backport This PR is a backport of another PR label Nov 17, 2025
@KDKHD KDKHD enabled auto-merge (squash) November 17, 2025 16:31
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This backport to the 9.1 branch removes the aiAssistant.defaultLlmSettingEnabled feature flag from the Security Solution plugin, completing the transition to always using the new default connector behavior for AI features.

Key Changes

  • Removed feature flag constants and related conditional logic across security_solution and security_solution_serverless plugins
  • Simplified the default AI connector resolution to always use the new centralized approach via getDefaultConnector
  • Cleaned up serverless plugin setup by removing async connector registration logic that was gated by the feature flag

Reviewed Changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
x-pack/solutions/security/plugins/security_solution_serverless/tsconfig.json Removed unused @kbn/inference-common dependency reference
x-pack/solutions/security/plugins/security_solution_serverless/server/plugin.ts Removed entire async setup block for default AI connector registration that was gated by feature flag, including related imports
x-pack/solutions/security/plugins/security_solution/tsconfig.json Removed unused @kbn/core-ui-settings-common dependency reference
x-pack/solutions/security/plugins/security_solution/server/ui_settings.ts Removed getDefaultAIConnectorSetting helper function and its unused type imports
x-pack/solutions/security/plugins/security_solution/public/flyout/ai_for_soc/components/connector_missing_callout.tsx Simplified navigation to always use /ai/genAiSettings path, removing feature flag conditional logic
x-pack/solutions/security/plugins/security_solution/public/flyout/ai_for_soc/components/connector_missing_callout.test.tsx Updated tests to remove feature flag-related test cases and mocks
x-pack/solutions/security/plugins/security_solution/public/common/hooks/use_default_ai_connector_id.ts Simplified hook to always use getDefaultConnector instead of conditionally choosing between legacy and new approaches
x-pack/solutions/security/plugins/security_solution/public/common/hooks/use_default_ai_connector_id.test.ts Updated tests to remove feature flag-related test cases and simplified assertions
x-pack/solutions/security/plugins/security_solution/common/constants.ts Removed feature flag constants AI_ASSISTANT_DEFAULT_LLM_SETTING_ENABLED and AI_ASSISTANT_DEFAULT_LLM_SETTING_ENABLED_VALUE

Comment on lines 18 to 22
jest.mock('../../../common/lib/kibana', () => {
return {
...jest.requireActual('../../../common/lib/kibana'),
useKibana: () => mockedUseKibana,
};
});
Copy link

Copilot AI Nov 19, 2025

Choose a reason for hiding this comment

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

The mock for useKibana is now unnecessary since the component no longer imports or uses useKibana. This empty mock can be removed to clean up the test file.

Copilot uses AI. Check for mistakes.
@botelastic botelastic bot added the ci:project-deploy-observability Create an Observability project label Nov 19, 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!)

@elasticmachine
Copy link
Copy Markdown
Contributor

elasticmachine commented Dec 1, 2025

⏳ Build in-progress, with failures

  • Buildkite Build
  • Commit: 7e9ae30
  • Kibana Serverless Image: docker.elastic.co/kibana-ci/kibana-serverless:pr-243241-7e9ae30aad56

Failed CI Steps

Test Failures

  • [job] [logs] Jest Tests #19 / DefaultAIConnector rendering does not render when feature flag is off
  • [job] [logs] Jest Tests #19 / DefaultAIConnector rendering does not render when feature flag is off

History

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport This PR is a backport of another PR ci:project-deploy-observability Create an Observability project

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants