[9.1] [GenAi] Clean up default LLM setting feature flag. (#242543)#243241
Open
KDKHD wants to merge 8 commits intoelastic:9.1from
Open
[9.1] [GenAi] Clean up default LLM setting feature flag. (#242543)#243241KDKHD wants to merge 8 commits intoelastic:9.1from
KDKHD wants to merge 8 commits intoelastic:9.1from
Conversation
## 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
10 tasks
Contributor
There was a problem hiding this comment.
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, | ||
| }; | ||
| }); |
There was a problem hiding this comment.
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.
Contributor
🤖 GitHub commentsExpand to view the GitHub comments
Just comment with:
|
Contributor
⏳ Build in-progress, with failures
Failed CI StepsTest Failures
History
|
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.
Backport
This will backport the following commits from
mainto9.1:Questions ?
Please refer to the Backport tool documentation