[SigEvents] Add model setting tab#257678
Conversation
78c79bb to
628adad
Compare
ruflin
left a comment
There was a problem hiding this comment.
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?
📝 WalkthroughWalkthroughIntroduces 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
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Suggested labels
Suggested reviewers
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
📝 Coding Plan
Warning Tools execution failed with the following error: Failed to run tools: 13 INTERNAL: Received RST_STREAM with code 2 (Internal server error) Comment Tip CodeRabbit can approve the review once all CodeRabbit's comments are resolved.Enable the |
✨ Finishing Touches🧪 Generate unit tests (beta)
📝 Coding Plan
Warning Tools execution failed with the following error: Failed to run tools: 13 INTERNAL: Received RST_STREAM with code 2 (Internal server error) Comment |
...m/plugins/shared/streams/server/routes/internal/streams/significant_events_settings/route.ts
Outdated
Show resolved
Hide resolved
⏳ Build in-progress, with failures
Failed CI StepsTest Failures
History
|
## 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>
Merge timing conflict between elastic#257678 and elastic#254211
## 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>
Merge timing conflict between elastic#257678 and elastic#254211
## 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>
Merge timing conflict between elastic#257678 and elastic#254211
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.
Changes
Settings tab (UI)
Settings API and saved object
/internal/streams/_significant_events/settingsreturns raw saved settings only (no default resolution). Each property isundefinedwhen not set or stored as empty.connectorIdKnowledgeIndicatorExtraction,connectorIdRuleGeneration, andconnectorIdDiscoveryare all optional. Omitted fields are unchanged; empty string means "use default" for that setting.ModelSettingsConfigClientTasks
uiSettingsClientto get the connector ID (fallback to GenAI default; error if none).PR assisted by Cursor.
Summary by CodeRabbit
New Features
Refactor
Style