Skip to content

[SigEvents] Add model setting tab#257678

Merged
miltonhultgren merged 6 commits intoelastic:mainfrom
miltonhultgren:sigevents-model-settings-tab
Mar 16, 2026
Merged

[SigEvents] Add model setting tab#257678
miltonhultgren merged 6 commits intoelastic:mainfrom
miltonhultgren:sigevents-model-settings-tab

Conversation

@miltonhultgren
Copy link
Copy Markdown
Contributor

@miltonhultgren miltonhultgren commented Mar 13, 2026

Summary

Adds a Model selection settings tab for Significant Events Discovery so users can choose which LLM connector is used for knowledge indicator extraction, rule generation, and discovery. Each setting can use a specific connector or fallback to the default (if configured). Settings are independent and can be set partially.

Screenshot 2026-03-13 at 18 06 45

Changes

Settings tab (UI)

  • New Model selection tab with three dropdowns: Knowledge indicator extraction, Rule generation, Discovery.
  • Each dropdown offers Use default (genAiSettings:defaultAIConnector) plus the list of available connectors.
  • When any setting is "Use default" and a default connector exists, the page shows Default connector: {name}.
  • When any setting is "Use default" and no default connector is configured, a warning callout is shown with a link to GenAI Settings to configure one. The callout is shown only if at least one dropdown is set to "Use default".
  • Save sends the current form state to the API (all three fields; API supports partial updates).

Settings API and saved object

  • GET /internal/streams/_significant_events/settings returns raw saved settings only (no default resolution). Each property is undefined when not set or stored as empty.
  • PUT accepts an optional body: connectorIdKnowledgeIndicatorExtraction, connectorIdRuleGeneration, and connectorIdDiscovery are all optional. Omitted fields are unchanged; empty string means "use default" for that setting.
  • Saved object attributes are optional so one or more settings can be stored.
  • The settings API does not resolve or depend on the GenAI default; it only reads and writes the saved object.
  • All of this is backed by the ModelSettingsConfigClient

Tasks

  • Insights discovery, features identification, significant events queries generation, and onboarding use modelSettingsClient.getSettings() for the relevant setting, then resolveConnectorId() with uiSettingsClient to get the connector ID (fallback to GenAI default; error if none).

PR assisted by Cursor.

Summary by CodeRabbit

  • New Features

    • Added a Settings tab to configure Significant Events connectors and new endpoints to view/update those settings.
  • Refactor

    • Connector selection centralized to settings; task scheduling and discovery flows no longer accept connector IDs directly.
    • Hooks and UI updated to operate without per-action connector parameters.
  • Style

    • Simplified action buttons across the Significant Events UI (native button replacement).

@github-actions github-actions bot added the author:actionable-obs PRs authored by the actionable obs team label Mar 13, 2026
@miltonhultgren miltonhultgren force-pushed the sigevents-model-settings-tab branch from 78c79bb to 628adad Compare March 13, 2026 17:18
@miltonhultgren miltonhultgren marked this pull request as ready for review March 13, 2026 17:23
@miltonhultgren miltonhultgren requested review from a team as code owners March 13, 2026 17:23
@miltonhultgren miltonhultgren added release_note:skip Skip the PR/issue when compiling release notes backport:skip This PR does not require backporting v9.4.0 Feature:SigEvents Significant events feature, related to streams and rules/alerts (RnA) labels Mar 13, 2026
@elastic-vault-github-plugin-prod elastic-vault-github-plugin-prod bot requested a review from a team as a code owner March 13, 2026 17:40
Copy link
Copy Markdown
Contributor

@ruflin ruflin left a comment

Choose a reason for hiding this comment

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

Approving to get this in so we can quickly iterate on it.

Follow ups

  • Rule generation is not fully accurate. Is is the generation of KI with type query. The rule generation is just persistence (no LLM needed)
  • Discovery: This is interesting, we might use multiple LLM here but eventually that is Significant Events generation.
  • Default: Should we have an overall default for our process?

@ruflin ruflin added the Team:SigEvents Project team working on Significant Events label Mar 16, 2026
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 16, 2026

Caution

Review failed

The head commit changed during the review from daa5634 to 4c221cd.

📝 Walkthrough

Walkthrough

Introduces a new saved objects model for streams significant events settings, enabling dynamic connector ID configuration stored as a singleton. Removes connector IDs from task parameters, resolving them at runtime from settings. Adds new API routes for fetching and updating settings. Updates task definitions to resolve connectors dynamically. Simplifies frontend components by removing AI features dependency and connector selection flow.

Changes

Cohort / File(s) Summary
Manifest Updates
packages/kbn-check-saved-objects-cli/current_fields.json, packages/kbn-check-saved-objects-cli/current_mappings.json
Added new "streams-significant-events-settings" saved object type to field registry and Elasticsearch mappings.
Saved Objects Model
x-pack/platform/plugins/shared/streams/server/lib/saved_objects/significant_events/model_settings_config.ts, x-pack/platform/plugins/shared/streams/server/lib/saved_objects/significant_events/model_settings_config_client.ts, x-pack/platform/plugins/shared/streams/server/lib/saved_objects/significant_events/model_settings_config_service.ts
Implements new saved objects model for connector ID settings with client and service layers for retrieving and updating model configuration attributes.
Task Definition Updates
x-pack/platform/plugins/shared/streams/server/lib/tasks/task_definitions/features_identification.ts, x-pack/platform/plugins/shared/streams/server/lib/tasks/task_definitions/insights_discovery.ts, x-pack/platform/plugins/shared/streams/server/lib/tasks/task_definitions/onboarding.ts, x-pack/platform/plugins/shared/streams/server/lib/tasks/task_definitions/significant_events_queries_generation.ts
Removed connectorId from task parameters; connector IDs now resolved at runtime via modelSettingsClient from stored settings.
Saved Objects Registration
x-pack/platform/plugins/shared/streams/server/lib/saved_objects/register_saved_objects.ts
Registered new significant events settings saved object type.
Plugin Setup & Route Configuration
x-pack/platform/plugins/shared/streams/server/plugin.ts, x-pack/platform/plugins/shared/streams/server/routes/index.ts, x-pack/platform/plugins/shared/streams/server/routes/types.ts
Instantiated ModelSettingsConfigService, added modelSettingsClient to scoped clients, and registered new internal routes for settings management.
Route Handler Updates
x-pack/platform/plugins/shared/streams/server/routes/internal/streams/features/route.ts, x-pack/platform/plugins/shared/streams/server/routes/internal/streams/insights/route.ts, x-pack/platform/plugins/shared/streams/server/routes/internal/streams/onboarding/route.ts, x-pack/platform/plugins/shared/streams/server/routes/internal/streams/significant_events/route.ts
Removed connectorId from request body schemas and task parameter construction; connectors now resolved server-side from settings.
New Settings Routes
x-pack/platform/plugins/shared/streams/server/routes/internal/streams/significant_events_settings/route.ts
Added GET and PUT endpoints for managing significant events model settings with access control and validation.
Frontend Components
x-pack/platform/plugins/shared/streams_app/public/components/significant_events_discovery/components/insights/summary.tsx, x-pack/platform/plugins/shared/streams_app/public/components/significant_events_discovery/components/settings/tab.tsx, x-pack/platform/plugins/shared/streams_app/public/components/significant_events_discovery/components/streams_view/streams_view.tsx, x-pack/platform/plugins/shared/streams_app/public/components/significant_events_discovery/page.tsx, x-pack/platform/plugins/shared/streams_app/public/components/stream_detail_significant_events_view/.../*
Removed aiFeatures and connectorId dependencies from discovery and significant events components; added new SettingsTab for connector configuration; simplified buttons and API calls.
Frontend API Hooks
x-pack/platform/plugins/shared/streams_app/public/hooks/use_insights_discovery_api.ts, x-pack/platform/plugins/shared/streams_app/public/hooks/use_onboarding_api.ts, x-pack/platform/plugins/shared/streams_app/public/hooks/use_stream_features_api.ts, x-pack/platform/plugins/shared/streams_app/public/components/significant_events_discovery/hooks/use_onboarding_status_update_queue.ts
Removed connectorId parameter from API hooks; connectors now resolved server-side from settings instead of being passed by client.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Suggested labels

Feature:Streams, Team:obs-onboarding

Suggested reviewers

  • flash1293
  • gsoldevila
  • ElenaStoeva
🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title '[SigEvents] Add model setting tab' is clear and directly related to the main changeset, which introduces a new settings tab UI component for model selection in Significant Events Discovery.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
📝 Coding Plan
  • Generate coding plan for human review comments

Warning

Tools execution failed with the following error:

Failed to run tools: 13 INTERNAL: Received RST_STREAM with code 2 (Internal server error)


Comment @coderabbitai help to get the list of available commands and usage tips.

Tip

CodeRabbit can approve the review once all CodeRabbit's comments are resolved.

Enable the reviews.request_changes_workflow setting to automatically approve the review once all CodeRabbit's comments are resolved.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 16, 2026

Caution

Review failed

The head commit changed during the review from 00f32e3 to daa5634.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
📝 Coding Plan
  • Generate coding plan for human review comments

Warning

Tools execution failed with the following error:

Failed to run tools: 13 INTERNAL: Received RST_STREAM with code 2 (Internal server error)


Comment @coderabbitai help to get the list of available commands and usage tips.

@miltonhultgren miltonhultgren enabled auto-merge (squash) March 16, 2026 15:30
@elasticmachine
Copy link
Copy Markdown
Contributor

elasticmachine commented Mar 16, 2026

⏳ Build in-progress, with failures

Failed CI Steps

Test Failures

  • [job] [logs] Scout: [ platform / lens ] plugin / local-stateful-classic - Lens Convert to ES|QL - should display ES|QL conversion modal for inline visualizations

History

@miltonhultgren miltonhultgren merged commit 86ae43b into elastic:main Mar 16, 2026
17 of 18 checks passed
sorenlouv pushed a commit that referenced this pull request Mar 17, 2026
## Summary

Adds a **Model selection** settings tab for Significant Events Discovery
so users can choose which LLM connector is used for knowledge indicator
extraction, rule generation, and discovery. Each setting can use a
specific connector or fallback to the default (if configured). Settings
are independent and can be set partially.

<img width="982" height="714" alt="Screenshot 2026-03-13 at 18 06 45"
src="https://github.com/user-attachments/assets/8fa8af47-9ab8-4156-a4b1-81e68db0fc63"
/>

## Changes

### Settings tab (UI)
- New **Model selection** tab with three dropdowns: **Knowledge
indicator extraction**, **Rule generation**, **Discovery**.
- Each dropdown offers **Use default
(genAiSettings:defaultAIConnector)** plus the list of available
connectors.
- When any setting is "Use default" and a default connector exists, the
page shows **Default connector: {name}**.
- When any setting is "Use default" and no default connector is
configured, a warning callout is shown with a link to **GenAI Settings**
to configure one. The callout is shown only if at least one dropdown is
set to "Use default".
- Save sends the current form state to the API (all three fields; API
supports partial updates).

### Settings API and saved object
- **GET** `/internal/streams/_significant_events/settings` returns raw
saved settings only (no default resolution). Each property is
`undefined` when not set or stored as empty.
- **PUT** accepts an optional body:
`connectorIdKnowledgeIndicatorExtraction`, `connectorIdRuleGeneration`,
and `connectorIdDiscovery` are all optional. Omitted fields are
unchanged; empty string means "use default" for that setting.
- Saved object attributes are optional so one or more settings can be
stored.
- The settings API does not resolve or depend on the GenAI default; it
only reads and writes the saved object.
- All of this is backed by the `ModelSettingsConfigClient`

### Tasks
- Insights discovery, features identification, significant events
queries generation, and onboarding use
**modelSettingsClient.getSettings()** for the relevant setting, then
**resolveConnectorId()** with `uiSettingsClient` to get the connector ID
(fallback to GenAI default; error if none).

PR assisted by Cursor.

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **New Features**
* Added Settings tab for significant events discovery to configure AI
connectors for knowledge extraction, rule generation, and discovery
tasks.

* **Refactor**
* Simplified API flows by centralizing connector configuration in
settings; removed connector parameters from event identification and
insights discovery operations.

* **Style**
  * Updated event generation controls with simplified button styling.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
jbudz added a commit that referenced this pull request Mar 18, 2026
Merge timing conflict between
#257678 and
#254211
szwarckonrad pushed a commit to szwarckonrad/kibana that referenced this pull request Mar 18, 2026
qn895 pushed a commit to qn895/kibana that referenced this pull request Mar 18, 2026
## Summary

Adds a **Model selection** settings tab for Significant Events Discovery
so users can choose which LLM connector is used for knowledge indicator
extraction, rule generation, and discovery. Each setting can use a
specific connector or fallback to the default (if configured). Settings
are independent and can be set partially.

<img width="982" height="714" alt="Screenshot 2026-03-13 at 18 06 45"
src="https://github.com/user-attachments/assets/8fa8af47-9ab8-4156-a4b1-81e68db0fc63"
/>

## Changes

### Settings tab (UI)
- New **Model selection** tab with three dropdowns: **Knowledge
indicator extraction**, **Rule generation**, **Discovery**.
- Each dropdown offers **Use default
(genAiSettings:defaultAIConnector)** plus the list of available
connectors.
- When any setting is "Use default" and a default connector exists, the
page shows **Default connector: {name}**.
- When any setting is "Use default" and no default connector is
configured, a warning callout is shown with a link to **GenAI Settings**
to configure one. The callout is shown only if at least one dropdown is
set to "Use default".
- Save sends the current form state to the API (all three fields; API
supports partial updates).

### Settings API and saved object
- **GET** `/internal/streams/_significant_events/settings` returns raw
saved settings only (no default resolution). Each property is
`undefined` when not set or stored as empty.
- **PUT** accepts an optional body:
`connectorIdKnowledgeIndicatorExtraction`, `connectorIdRuleGeneration`,
and `connectorIdDiscovery` are all optional. Omitted fields are
unchanged; empty string means "use default" for that setting.
- Saved object attributes are optional so one or more settings can be
stored.
- The settings API does not resolve or depend on the GenAI default; it
only reads and writes the saved object.
- All of this is backed by the `ModelSettingsConfigClient`

### Tasks
- Insights discovery, features identification, significant events
queries generation, and onboarding use
**modelSettingsClient.getSettings()** for the relevant setting, then
**resolveConnectorId()** with `uiSettingsClient` to get the connector ID
(fallback to GenAI default; error if none).

PR assisted by Cursor.

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **New Features**
* Added Settings tab for significant events discovery to configure AI
connectors for knowledge extraction, rule generation, and discovery
tasks.

* **Refactor**
* Simplified API flows by centralizing connector configuration in
settings; removed connector parameters from event identification and
insights discovery operations.

* **Style**
  * Updated event generation controls with simplified button styling.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
qn895 pushed a commit to qn895/kibana that referenced this pull request Mar 18, 2026
jeramysoucy pushed a commit to jeramysoucy/kibana that referenced this pull request Mar 26, 2026
## Summary

Adds a **Model selection** settings tab for Significant Events Discovery
so users can choose which LLM connector is used for knowledge indicator
extraction, rule generation, and discovery. Each setting can use a
specific connector or fallback to the default (if configured). Settings
are independent and can be set partially.

<img width="982" height="714" alt="Screenshot 2026-03-13 at 18 06 45"
src="https://github.com/user-attachments/assets/8fa8af47-9ab8-4156-a4b1-81e68db0fc63"
/>

## Changes

### Settings tab (UI)
- New **Model selection** tab with three dropdowns: **Knowledge
indicator extraction**, **Rule generation**, **Discovery**.
- Each dropdown offers **Use default
(genAiSettings:defaultAIConnector)** plus the list of available
connectors.
- When any setting is "Use default" and a default connector exists, the
page shows **Default connector: {name}**.
- When any setting is "Use default" and no default connector is
configured, a warning callout is shown with a link to **GenAI Settings**
to configure one. The callout is shown only if at least one dropdown is
set to "Use default".
- Save sends the current form state to the API (all three fields; API
supports partial updates).

### Settings API and saved object
- **GET** `/internal/streams/_significant_events/settings` returns raw
saved settings only (no default resolution). Each property is
`undefined` when not set or stored as empty.
- **PUT** accepts an optional body:
`connectorIdKnowledgeIndicatorExtraction`, `connectorIdRuleGeneration`,
and `connectorIdDiscovery` are all optional. Omitted fields are
unchanged; empty string means "use default" for that setting.
- Saved object attributes are optional so one or more settings can be
stored.
- The settings API does not resolve or depend on the GenAI default; it
only reads and writes the saved object.
- All of this is backed by the `ModelSettingsConfigClient`

### Tasks
- Insights discovery, features identification, significant events
queries generation, and onboarding use
**modelSettingsClient.getSettings()** for the relevant setting, then
**resolveConnectorId()** with `uiSettingsClient` to get the connector ID
(fallback to GenAI default; error if none).

PR assisted by Cursor.

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **New Features**
* Added Settings tab for significant events discovery to configure AI
connectors for knowledge extraction, rule generation, and discovery
tasks.

* **Refactor**
* Simplified API flows by centralizing connector configuration in
settings; removed connector parameters from event identification and
insights discovery operations.

* **Style**
  * Updated event generation controls with simplified button styling.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
jeramysoucy pushed a commit to jeramysoucy/kibana that referenced this pull request Mar 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author:actionable-obs PRs authored by the actionable obs team backport:skip This PR does not require backporting Feature:SigEvents Significant events feature, related to streams and rules/alerts (RnA) release_note:skip Skip the PR/issue when compiling release notes Team:SigEvents Project team working on Significant Events v9.4.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants