Skip to content

Commit 52a1373

Browse files
[9.2] [Security Solution] [Bug] The schedule can not be created if any LLM model is selected as the default (#239049) (#239112) (#239164)
# Backport This will backport the following commits from `main` to `9.2`: - [[Security Solution] [Bug] The schedule can not be created if any LLM model is selected as the default (#239049) (#239112)](#239112) <!--- Backport version: 9.6.6 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"Ievgen Sorokopud","email":"[email protected]"},"sourceCommit":{"committedDate":"2025-10-15T14:24:48Z","message":"[Security Solution] [Bug] The schedule can not be created if any LLM model is selected as the default (#239049) (#239112)\n\n## Summary\n\nBUG: https://github.com/elastic/kibana/issues/239049\n\nThese changes fix the issue where user cannot create a new attack\ndiscovery schedule when the default LLM has been selected.\n\nThe issue happens because internally the connector selector implicitly\nsets the default connector without notifying parent controls. Also, the\nnature of the form that we use for the create and edit schedules flows\nis that we need to initialize it with the correct value or update it\nonce the form ha been mounted and rendered.\n\nAs a fix for the upcoming release, we would allow parent components to\nenforce user to select connector while creating the attack discovery\nschedule - even when the default LLM exists.\n\n### Recording of the fix\n\n\nhttps://github.com/user-attachments/assets/f05d4959-e218-4c99-81a6-02b657bcb39d","sha":"168f852cd6b3c5ed09178bdea466a6befa54422e","branchLabelMapping":{"^v9.3.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","Team: SecuritySolution","Team:Security Generative AI","backport:version","v9.2.0","v9.3.0"],"title":"[Security Solution] [Bug] The schedule can not be created if any LLM model is selected as the default (#239049)","number":239112,"url":"https://github.com/elastic/kibana/pull/239112","mergeCommit":{"message":"[Security Solution] [Bug] The schedule can not be created if any LLM model is selected as the default (#239049) (#239112)\n\n## Summary\n\nBUG: https://github.com/elastic/kibana/issues/239049\n\nThese changes fix the issue where user cannot create a new attack\ndiscovery schedule when the default LLM has been selected.\n\nThe issue happens because internally the connector selector implicitly\nsets the default connector without notifying parent controls. Also, the\nnature of the form that we use for the create and edit schedules flows\nis that we need to initialize it with the correct value or update it\nonce the form ha been mounted and rendered.\n\nAs a fix for the upcoming release, we would allow parent components to\nenforce user to select connector while creating the attack discovery\nschedule - even when the default LLM exists.\n\n### Recording of the fix\n\n\nhttps://github.com/user-attachments/assets/f05d4959-e218-4c99-81a6-02b657bcb39d","sha":"168f852cd6b3c5ed09178bdea466a6befa54422e"}},"sourceBranch":"main","suggestedTargetBranches":["9.2"],"targetPullRequestStates":[{"branch":"9.2","label":"v9.2.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v9.3.0","branchLabelMappingKey":"^v9.3.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/239112","number":239112,"mergeCommit":{"message":"[Security Solution] [Bug] The schedule can not be created if any LLM model is selected as the default (#239049) (#239112)\n\n## Summary\n\nBUG: https://github.com/elastic/kibana/issues/239049\n\nThese changes fix the issue where user cannot create a new attack\ndiscovery schedule when the default LLM has been selected.\n\nThe issue happens because internally the connector selector implicitly\nsets the default connector without notifying parent controls. Also, the\nnature of the form that we use for the create and edit schedules flows\nis that we need to initialize it with the correct value or update it\nonce the form ha been mounted and rendered.\n\nAs a fix for the upcoming release, we would allow parent components to\nenforce user to select connector while creating the attack discovery\nschedule - even when the default LLM exists.\n\n### Recording of the fix\n\n\nhttps://github.com/user-attachments/assets/f05d4959-e218-4c99-81a6-02b657bcb39d","sha":"168f852cd6b3c5ed09178bdea466a6befa54422e"}}]}] BACKPORT--> Co-authored-by: Ievgen Sorokopud <[email protected]>
1 parent 98285bf commit 52a1373

File tree

3 files changed

+19
-1
lines changed
  • x-pack
    • platform/packages/shared/kbn-elastic-assistant/impl/connectorland
    • solutions/security/plugins/security_solution/public/attack_discovery/pages/settings_flyout/schedule/form_fields/connector_selector_field

3 files changed

+19
-1
lines changed

x-pack/platform/packages/shared/kbn-elastic-assistant/impl/connectorland/connector_selector/index.tsx

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,12 @@ interface Props {
4242
displayFancy?: (label: string, aIConnector?: AIConnector) => React.ReactNode;
4343
setIsOpen?: (isOpen: boolean) => void;
4444
stats?: AttackDiscoveryStats | null;
45+
46+
/**
47+
* Allows parent components to control whether the default connector should be
48+
* automatically selected or the explicit user selection action required.
49+
*/
50+
explicitConnectorSelection?: boolean;
4551
}
4652

4753
export type AIConnector = ActionConnector & {
@@ -59,6 +65,7 @@ export const ConnectorSelector: React.FC<Props> = React.memo(
5965
onConnectorSelectionChange,
6066
setIsOpen,
6167
stats = null,
68+
explicitConnectorSelection,
6269
}) => {
6370
const {
6471
actionTypeRegistry,
@@ -129,7 +136,9 @@ export const ConnectorSelector: React.FC<Props> = React.memo(
129136
);
130137

131138
// Use effective value (optimistic or actual) or fall back to default
132-
const selectedOrDefaultConnectorId = effectiveSelectedConnectorId ?? defaultAIConnectorId;
139+
const selectedOrDefaultConnectorId =
140+
effectiveSelectedConnectorId ??
141+
(explicitConnectorSelection ? undefined : defaultAIConnectorId);
133142
const selectedOrDefaultConnector = aiConnectors?.find(
134143
(connector) => connector.id === selectedOrDefaultConnectorId
135144
);

x-pack/platform/packages/shared/kbn-elastic-assistant/impl/connectorland/connector_selector_inline/connector_selector_inline.tsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,12 @@ interface Props {
2727
onConnectorIdSelected?: (connectorId: string) => void;
2828
onConnectorSelected?: (conversation: Conversation, apiConfig?: ApiConfig) => void;
2929
stats?: AttackDiscoveryStats | null;
30+
31+
/**
32+
* Allows parent components to control whether the default connector should be
33+
* automatically selected or the explicit user selection action required.
34+
*/
35+
explicitConnectorSelection?: boolean;
3036
}
3137

3238
const inputContainerClassName = css`
@@ -77,6 +83,7 @@ export const ConnectorSelectorInline: React.FC<Props> = React.memo(
7783
onConnectorIdSelected,
7884
onConnectorSelected,
7985
stats = null,
86+
explicitConnectorSelection,
8087
}) => {
8188
const { euiTheme } = useEuiTheme();
8289
const [isOpen, setIsOpen] = useState<boolean>(false);
@@ -159,6 +166,7 @@ export const ConnectorSelectorInline: React.FC<Props> = React.memo(
159166
setIsOpen={setIsOpen}
160167
onConnectorSelectionChange={onChange}
161168
stats={stats}
169+
explicitConnectorSelection={explicitConnectorSelection}
162170
/>
163171
</EuiFlexItem>
164172
</EuiFlexGroup>

x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/settings_flyout/schedule/form_fields/connector_selector_field/index.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ export const ConnectorSelectorField: React.FC<Props> = React.memo(
3737
onConnectorSelected={noop}
3838
onConnectorIdSelected={onConnectorIdSelected}
3939
selectedConnectorId={connectorId}
40+
explicitConnectorSelection={true}
4041
/>
4142
</EuiFormRow>
4243
);

0 commit comments

Comments
 (0)