Skip to content

Conversation

@stephmilovic
Copy link
Contributor

@stephmilovic stephmilovic commented Sep 11, 2025

Fix: Enable repeated System Prompt navigation from Conversations tab

Problem

Users could navigate from Conversations > System Prompts > Add System Prompt successfully the first time, but subsequent attempts would fail. The issue was that the selectedSettingsTab context state wasn't being properly cleared after navigation, preventing users from accessing the System Prompts tab again when editing conversations.

Steps to Reproduce (Previous Behavior)

  1. Go to the Conversations settings tab
  2. Edit any conversation entry
  3. Click "Add System Prompt" - ✅ Works first time
  4. Navigate back to the Conversations tab
  5. Edit the same or different conversation entry

Previous behavior

  1. Click "Add System Prompt" again - ❌ Fails - user cannot navigate to System Prompts tab

Expected Behavior (After Fix)

  1. Click "Add System Prompt" again - ✅ Works - user can navigate to System Prompts tab repeatedly

Solution

Added missing setSelectedSettingsTab(null) call in the useEffect hook within AssistantSettingsManagement component to properly clear the context settings tab state after navigation, enabling repeated navigation attempts.

  • Unit tests added to cover the useEffect behavior
  • Verified System Prompt navigation works correctly on repeated attempts from Conversations tab
  • Confirmed navigation between tabs functions as expected on multiple attempts

Fixes #197962

@stephmilovic stephmilovic requested a review from a team as a code owner September 11, 2025 19:01
@stephmilovic stephmilovic added release_note:fix Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. Team:Security Generative AI Security Generative AI backport:version Backport to applied version labels v9.2.0 v8.19.5 v9.1.5 labels Sep 11, 2025
@elasticmachine
Copy link
Contributor

Pinging @elastic/security-solution (Team: SecuritySolution)

@elasticmachine
Copy link
Contributor

💛 Build succeeded, but was flaky

Failed CI Steps

Test Failures

  • [job] [logs] Jest Tests #7 / should render mitre attack information (in array form)

Metrics [docs]

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
securitySolution 10.5MB 10.5MB +8.0B

@stephmilovic stephmilovic merged commit 540e69f into elastic:main Sep 12, 2025
28 checks passed
@kibanamachine
Copy link
Contributor

Starting backport for target branches: 8.19, 9.1

https://github.com/elastic/kibana/actions/runs/17677313090

@kibanamachine
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
8.19
9.1

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

kibanamachine added a commit that referenced this pull request Sep 12, 2025
…ons tab (#234812) (#234926)

# Backport

This will backport the following commits from `main` to `8.19`:
- [[Security assistant] Fix System Prompt updates from Conversations tab
(#234812)](#234812)

<!--- Backport version: 9.6.6 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sorenlouv/backport)

<!--BACKPORT [{"author":{"name":"Steph
Milovic","email":"[email protected]"},"sourceCommit":{"committedDate":"2025-09-12T14:23:10Z","message":"[Security
assistant] Fix System Prompt updates from Conversations tab
(#234812)","sha":"540e69f494bb36fd269f418d4dd03d29c13b8eb1","branchLabelMapping":{"^v9.2.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","Team:
SecuritySolution","Team:Security Generative
AI","backport:version","v9.2.0","v8.19.5","v9.1.5"],"title":"[Security
assistant] Fix System Prompt updates from Conversations
tab","number":234812,"url":"https://github.com/elastic/kibana/pull/234812","mergeCommit":{"message":"[Security
assistant] Fix System Prompt updates from Conversations tab
(#234812)","sha":"540e69f494bb36fd269f418d4dd03d29c13b8eb1"}},"sourceBranch":"main","suggestedTargetBranches":["8.19","9.1"],"targetPullRequestStates":[{"branch":"main","label":"v9.2.0","branchLabelMappingKey":"^v9.2.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/234812","number":234812,"mergeCommit":{"message":"[Security
assistant] Fix System Prompt updates from Conversations tab
(#234812)","sha":"540e69f494bb36fd269f418d4dd03d29c13b8eb1"}},{"branch":"8.19","label":"v8.19.5","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"9.1","label":"v9.1.5","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Steph Milovic <[email protected]>
kibanamachine added a commit that referenced this pull request Sep 12, 2025
…ns tab (#234812) (#234927)

# Backport

This will backport the following commits from `main` to `9.1`:
- [[Security assistant] Fix System Prompt updates from Conversations tab
(#234812)](#234812)

<!--- Backport version: 9.6.6 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sorenlouv/backport)

<!--BACKPORT [{"author":{"name":"Steph
Milovic","email":"[email protected]"},"sourceCommit":{"committedDate":"2025-09-12T14:23:10Z","message":"[Security
assistant] Fix System Prompt updates from Conversations tab
(#234812)","sha":"540e69f494bb36fd269f418d4dd03d29c13b8eb1","branchLabelMapping":{"^v9.2.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","Team:
SecuritySolution","Team:Security Generative
AI","backport:version","v9.2.0","v8.19.5","v9.1.5"],"title":"[Security
assistant] Fix System Prompt updates from Conversations
tab","number":234812,"url":"https://github.com/elastic/kibana/pull/234812","mergeCommit":{"message":"[Security
assistant] Fix System Prompt updates from Conversations tab
(#234812)","sha":"540e69f494bb36fd269f418d4dd03d29c13b8eb1"}},"sourceBranch":"main","suggestedTargetBranches":["8.19","9.1"],"targetPullRequestStates":[{"branch":"main","label":"v9.2.0","branchLabelMappingKey":"^v9.2.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/234812","number":234812,"mergeCommit":{"message":"[Security
assistant] Fix System Prompt updates from Conversations tab
(#234812)","sha":"540e69f494bb36fd269f418d4dd03d29c13b8eb1"}},{"branch":"8.19","label":"v8.19.5","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"9.1","label":"v9.1.5","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Steph Milovic <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:version Backport to applied version labels release_note:fix Team:Security Generative AI Security Generative AI Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. v8.19.4 v8.19.5 v9.1.4 v9.1.5 v9.2.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Security Solution] [Bug] Not able to update 'System Prompt' from the conversations tab under Security AI settings

4 participants