Commit b61e3a2
# Backport
This will backport the following commits from `main` to `9.2`:
- [[Security Assistant] Prioritize connector defaultModel over stored
conversation model
(#237947)](#237947)
<!--- Backport version: 9.6.6 -->
### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sorenlouv/backport)
<!--BACKPORT [{"author":{"name":"Garrett
Spong","email":"[email protected]"},"sourceCommit":{"committedDate":"2025-10-15T20:35:58Z","message":"[Security
Assistant] Prioritize connector defaultModel over stored conversation
model (#237947)\n\n### Summary\nWhen a connector's `defaultModel` is
updated, existing conversations now\nuse the updated model instead of
the stale model stored in the\nconversation's
`apiConfig`.\n\nChanges:\n- Modified `assistant/api/index.tsx` to no
longer send `model` from the\nconversation\n- Modified
`default_assistant_graph/index.ts` to send the connector's\ndefault
model if `undefined`. This is for ActionsClient only, as\nInferenceChat
falls back to the connector default appropriately.\n- Modified
`getConversationApiConfig` to prioritize connectorModel over\nstored
model\n- Added tests to verify connector model takes precedence\n- Added
fallback test when connector has no model\n\n\nThis ensures
conversations always use the latest connector\nconfiguration, fixing the
issue where OpenAI connectors with 'Other'\nprovider would not pick up
modelId changes for existing conversations.\n\n### Testing Instructions
for PR\n1. Create OpenAI connector with modelId \"model-v1\"\n2. Create
conversation and send message\n3. Update connector modelId to
\"model-v2\"\n4. Return to conversation and send another message\n5.
Verify request is fulfilled with new model\n\nCreated with Cursor and
Claude 4.5 Sonnet\n\n### Release Notes\nPrioritize connector
defaultModel over stored conversation model\n\n### Checklist\n\n- [X]
[Unit or
functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere
updated or added to match the most common scenarios\n- [X] The PR
description includes the appropriate Release Notes section,\nand the
correct `release_note:*` label is applied per
the\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\n-
[X] Review the
[backport\nguidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)\nand
apply applicable `backport:*`
labels.","sha":"e5ec416caaa3c33219c05eaf28854098852fc870","branchLabelMapping":{"^v9.3.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["bug","release_note:fix","sdh-linked","Feature:Security
Assistant","Team:Security Generative
AI","backport:version","v9.1.0","v8.19.0","v9.2.0","v9.3.0"],"title":"[Security
Assistant] Prioritize connector defaultModel over stored conversation
model","number":237947,"url":"https://github.com/elastic/kibana/pull/237947","mergeCommit":{"message":"[Security
Assistant] Prioritize connector defaultModel over stored conversation
model (#237947)\n\n### Summary\nWhen a connector's `defaultModel` is
updated, existing conversations now\nuse the updated model instead of
the stale model stored in the\nconversation's
`apiConfig`.\n\nChanges:\n- Modified `assistant/api/index.tsx` to no
longer send `model` from the\nconversation\n- Modified
`default_assistant_graph/index.ts` to send the connector's\ndefault
model if `undefined`. This is for ActionsClient only, as\nInferenceChat
falls back to the connector default appropriately.\n- Modified
`getConversationApiConfig` to prioritize connectorModel over\nstored
model\n- Added tests to verify connector model takes precedence\n- Added
fallback test when connector has no model\n\n\nThis ensures
conversations always use the latest connector\nconfiguration, fixing the
issue where OpenAI connectors with 'Other'\nprovider would not pick up
modelId changes for existing conversations.\n\n### Testing Instructions
for PR\n1. Create OpenAI connector with modelId \"model-v1\"\n2. Create
conversation and send message\n3. Update connector modelId to
\"model-v2\"\n4. Return to conversation and send another message\n5.
Verify request is fulfilled with new model\n\nCreated with Cursor and
Claude 4.5 Sonnet\n\n### Release Notes\nPrioritize connector
defaultModel over stored conversation model\n\n### Checklist\n\n- [X]
[Unit or
functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere
updated or added to match the most common scenarios\n- [X] The PR
description includes the appropriate Release Notes section,\nand the
correct `release_note:*` label is applied per
the\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\n-
[X] Review the
[backport\nguidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)\nand
apply applicable `backport:*`
labels.","sha":"e5ec416caaa3c33219c05eaf28854098852fc870"}},"sourceBranch":"main","suggestedTargetBranches":["9.1","8.19","9.2"],"targetPullRequestStates":[{"branch":"9.1","label":"v9.1.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.19","label":"v8.19.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"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/237947","number":237947,"mergeCommit":{"message":"[Security
Assistant] Prioritize connector defaultModel over stored conversation
model (#237947)\n\n### Summary\nWhen a connector's `defaultModel` is
updated, existing conversations now\nuse the updated model instead of
the stale model stored in the\nconversation's
`apiConfig`.\n\nChanges:\n- Modified `assistant/api/index.tsx` to no
longer send `model` from the\nconversation\n- Modified
`default_assistant_graph/index.ts` to send the connector's\ndefault
model if `undefined`. This is for ActionsClient only, as\nInferenceChat
falls back to the connector default appropriately.\n- Modified
`getConversationApiConfig` to prioritize connectorModel over\nstored
model\n- Added tests to verify connector model takes precedence\n- Added
fallback test when connector has no model\n\n\nThis ensures
conversations always use the latest connector\nconfiguration, fixing the
issue where OpenAI connectors with 'Other'\nprovider would not pick up
modelId changes for existing conversations.\n\n### Testing Instructions
for PR\n1. Create OpenAI connector with modelId \"model-v1\"\n2. Create
conversation and send message\n3. Update connector modelId to
\"model-v2\"\n4. Return to conversation and send another message\n5.
Verify request is fulfilled with new model\n\nCreated with Cursor and
Claude 4.5 Sonnet\n\n### Release Notes\nPrioritize connector
defaultModel over stored conversation model\n\n### Checklist\n\n- [X]
[Unit or
functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere
updated or added to match the most common scenarios\n- [X] The PR
description includes the appropriate Release Notes section,\nand the
correct `release_note:*` label is applied per
the\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\n-
[X] Review the
[backport\nguidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)\nand
apply applicable `backport:*`
labels.","sha":"e5ec416caaa3c33219c05eaf28854098852fc870"}}]}]
BACKPORT-->
Co-authored-by: Garrett Spong <[email protected]>
1 parent 45cb0af commit b61e3a2
File tree
5 files changed
+60
-8
lines changed- x-pack
- solutions/security/plugins/elastic_assistant/server/lib/langchain/graphs/default_assistant_graph
5 files changed
+60
-8
lines changedLines changed: 3 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
79 | 79 | | |
80 | 80 | | |
81 | 81 | | |
82 | | - | |
| 82 | + | |
83 | 83 | | |
84 | 84 | | |
85 | 85 | | |
| |||
91 | 91 | | |
92 | 92 | | |
93 | 93 | | |
94 | | - | |
| 94 | + | |
95 | 95 | | |
96 | 96 | | |
97 | 97 | | |
| |||
164 | 164 | | |
165 | 165 | | |
166 | 166 | | |
167 | | - | |
| 167 | + | |
168 | 168 | | |
169 | 169 | | |
170 | 170 | | |
| |||
Lines changed: 0 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
71 | | - | |
72 | 71 | | |
73 | 72 | | |
74 | 73 | | |
| |||
Lines changed: 50 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
347 | 347 | | |
348 | 348 | | |
349 | 349 | | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
350 | 400 | | |
351 | 401 | | |
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
133 | 133 | | |
134 | 134 | | |
135 | 135 | | |
136 | | - | |
| 136 | + | |
137 | 137 | | |
138 | 138 | | |
139 | 139 | | |
| |||
Lines changed: 6 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
76 | 76 | | |
77 | 77 | | |
78 | 78 | | |
79 | | - | |
80 | | - | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
81 | 83 | | |
82 | 84 | | |
83 | 85 | | |
| |||
102 | 104 | | |
103 | 105 | | |
104 | 106 | | |
105 | | - | |
| 107 | + | |
106 | 108 | | |
107 | 109 | | |
108 | 110 | | |
| |||
117 | 119 | | |
118 | 120 | | |
119 | 121 | | |
| 122 | + | |
120 | 123 | | |
121 | 124 | | |
122 | 125 | | |
| |||
0 commit comments