Skip to content

[Inference UI] Changing default model will not require a hard page refresh#262679

Merged
saikatsarkar056 merged 16 commits intoelastic:mainfrom
saikatsarkar056:fix/default-model-stale-state
Apr 21, 2026
Merged

[Inference UI] Changing default model will not require a hard page refresh#262679
saikatsarkar056 merged 16 commits intoelastic:mainfrom
saikatsarkar056:fix/default-model-stale-state

Conversation

@saikatsarkar056
Copy link
Copy Markdown
Contributor

@saikatsarkar056 saikatsarkar056 commented Apr 12, 2026

Previously, changing the default AI connector in settings required a hard page refresh for the change to take effect across the UI. This PR makes the connector list and default connector selection reactive by subscribing to UI settings change streams, so updates propagate instantly.

Summary

Summarize your PR. If it involves visual changes include a screenshot or gif.

Stateful

Screen.Recording.2026-04-20.at.6.38.23.PM.mov

Serverless

Screen.Recording.2026-04-20.at.10.50.05.PM.mov

Checklist

Check the PR satisfies following conditions.

Reviewers should verify this PR satisfies this list as well.

  • Any text added follows EUI's writing guidelines, uses sentence case text and includes i18n support
  • Documentation was added for features that require explanation or tutorials
  • Unit or functional tests were updated or added to match the most common scenarios
  • If a plugin configuration key changed, check if it needs to be allowlisted in the cloud and added to the docker list
  • This was checked for breaking HTTP API changes, and any breaking changes have been approved by the breaking-change committee. The release_note:breaking label should be applied in these situations.
  • Flaky Test Runner was used on any tests changed
  • The PR description includes the appropriate Release Notes section, and the correct release_note:* label is applied per the guidelines
  • Review the backport guidelines and apply applicable backport:* labels.

Identify risks

Does this PR introduce any risks? For example, consider risks like hard to test bugs, performance regression, potential of data loss.

Describe the risk, its severity, and mitigation for each identified risk. Invite stakeholders and evaluate how to proceed before merging.

Release note

Fixes an issue where changing the default AI connector in settings did not take effect until the page was refreshed. The connector list and default selection now update automatically when settings are changed.

@saikatsarkar056 saikatsarkar056 requested review from a team as code owners April 12, 2026 16:41
@saikatsarkar056 saikatsarkar056 marked this pull request as draft April 12, 2026 16:41
@saikatsarkar056 saikatsarkar056 self-assigned this Apr 14, 2026
@saikatsarkar056 saikatsarkar056 marked this pull request as ready for review April 14, 2026 15:57
@saikatsarkar056 saikatsarkar056 requested review from a team as code owners April 14, 2026 15:57
@saikatsarkar056 saikatsarkar056 changed the title Changing default model will not require a hard page refresh [Inference UI] Changing default model will not require a hard page refresh Apr 14, 2026
@macroscopeapp
Copy link
Copy Markdown
Contributor

macroscopeapp Bot commented Apr 14, 2026

Approvability

Verdict: Needs human review

This PR introduces runtime behavior changes to how default model settings propagate across multiple plugins (reactive observables instead of static reads). The author does not own any of the 11 modified files, which span 5 different team ownerships. The designated code owners should review these changes to their respective components.

You can customize Macroscope's approvability policy. Learn more.

Copy link
Copy Markdown
Contributor

@chrisbmar chrisbmar left a comment

Choose a reason for hiding this comment

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

agent builder changes LGTM

@elastic elastic deleted a comment from elasticmachine Apr 14, 2026
Copy link
Copy Markdown
Contributor

@PhilippeOberti PhilippeOberti left a comment

Choose a reason for hiding this comment

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

Code review only, LGTM for the @elastic/security-threat-hunting-investigations team

@saikatsarkar056 saikatsarkar056 enabled auto-merge (squash) April 16, 2026 13:17
Copy link
Copy Markdown
Member

@KDKHD KDKHD left a comment

Choose a reason for hiding this comment

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

secgenai files look good

@saikatsarkar056
Copy link
Copy Markdown
Contributor Author

@elasticmachine merge upstream

@elasticmachine
Copy link
Copy Markdown
Contributor

elasticmachine commented Apr 20, 2026

💔 Build Failed

Failed CI Steps

Metrics [docs]

‼️ ERROR: no builds found for mergeBase sha [08413c7]

History

cc @saikatsarkar056

@saikatsarkar056
Copy link
Copy Markdown
Contributor Author

saikatsarkar056 commented Apr 20, 2026

Heads-up: I restructured this PR after your approvals, so I'm re-requesting review.

Why I changed it

After #263843 ("Move model resolution entirely to backend") merged to main, pulling main into this branch quietly broke use_load_connectors.ts.

My original approach no longer fit the architecture. #263843 explicitly moved default-connector resolution to the server so the client wouldn't need to read these settings. Adding a subscription in the shared hook put that logic back in two places, which is exactly what #263843 was cleaning up.

@saikatsarkar056
Copy link
Copy Markdown
Contributor Author

saikatsarkar056 commented Apr 21, 2026

Thank you, @chrisbmar and @PhilippeOberti for reviewing the new changes.

@saikatsarkar056 saikatsarkar056 merged commit 79536dd into elastic:main Apr 21, 2026
20 checks passed
@kibanamachine
Copy link
Copy Markdown
Contributor

Starting backport for target branches: 9.4

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

@kibanamachine
Copy link
Copy Markdown
Contributor

💚 All backports created successfully

Status Branch Result
9.4

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 Apr 21, 2026
…age refresh (#262679) (#264697)

# Backport

This will backport the following commits from `main` to `9.4`:
- [[Inference UI] Changing default model will not require a hard page
refresh (#262679)](#262679)

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

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

<!--BACKPORT [{"author":{"name":"Saikat
Sarkar","email":"132922331+saikatsarkar056@users.noreply.github.com"},"sourceCommit":{"committedDate":"2026-04-21T12:43:24Z","message":"[Inference
UI] Changing default model will not require a hard page refresh
(#262679)\n\nPreviously, changing the default AI connector in settings
required a\nhard page refresh for the change to take effect across the
UI. This PR\nmakes the connector list and default connector selection
reactive by\nsubscribing to UI settings change streams, so updates
propagate\ninstantly.\n\n## Summary\n\nSummarize your PR. If it involves
visual changes include a screenshot or\ngif.\n\n###
Stateful\n\nhttps://github.com/user-attachments/assets/c52449db-6248-4627-9872-5fa6e3dcbbf5\n\n###
Serverless\n\n\nhttps://github.com/user-attachments/assets/13a3353e-2706-484f-b868-3a305c1e2362\n\n\n\n###
Checklist\n\nCheck the PR satisfies following conditions. \n\nReviewers
should verify this PR satisfies this list as well.\n\n- [ ] Any text
added follows [EUI's
writing\nguidelines](https://elastic.github.io/eui/#/guidelines/writing),
uses\nsentence case text and includes
[i18n\nsupport](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)\n-
[
]\n[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)\nwas
added for features that require explanation or tutorials\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- [ ] If a plugin
configuration key changed, check if it needs to be\nallowlisted in the
cloud and added to the
[docker\nlist](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)\n-
[ ] This was checked for breaking HTTP API changes, and any
breaking\nchanges have been approved by the breaking-change committee.
The\n`release_note:breaking` label should be applied in these
situations.\n- [ ] [Flaky
Test\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1)
was\nused on any tests changed\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.\n\n### Identify risks\n\nDoes this
PR introduce any risks? For example, consider risks like hard\nto test
bugs, performance regression, potential of data loss.\n\nDescribe the
risk, its severity, and mitigation for each identified\nrisk. Invite
stakeholders and evaluate how to proceed before merging.\n\n- [ ] [See
some
risk\nexamples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx)\n-
[ ] ...\n\n\n## Release note\nFixes an issue where changing the default
AI connector in settings did\nnot take effect until the page was
refreshed. The connector list and\ndefault selection now update
automatically when settings are changed.\n\n---------\n\nCo-authored-by:
Elastic Machine
<elasticmachine@users.noreply.github.com>","sha":"79536dd06970e4f8027ed95f41d834bef9077be4","branchLabelMapping":{"^v9.5.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","Team:Search","backport:version","v9.4.0","v9.5.0"],"title":"[Inference
UI] Changing default model will not require a hard page
refresh","number":262679,"url":"https://github.com/elastic/kibana/pull/262679","mergeCommit":{"message":"[Inference
UI] Changing default model will not require a hard page refresh
(#262679)\n\nPreviously, changing the default AI connector in settings
required a\nhard page refresh for the change to take effect across the
UI. This PR\nmakes the connector list and default connector selection
reactive by\nsubscribing to UI settings change streams, so updates
propagate\ninstantly.\n\n## Summary\n\nSummarize your PR. If it involves
visual changes include a screenshot or\ngif.\n\n###
Stateful\n\nhttps://github.com/user-attachments/assets/c52449db-6248-4627-9872-5fa6e3dcbbf5\n\n###
Serverless\n\n\nhttps://github.com/user-attachments/assets/13a3353e-2706-484f-b868-3a305c1e2362\n\n\n\n###
Checklist\n\nCheck the PR satisfies following conditions. \n\nReviewers
should verify this PR satisfies this list as well.\n\n- [ ] Any text
added follows [EUI's
writing\nguidelines](https://elastic.github.io/eui/#/guidelines/writing),
uses\nsentence case text and includes
[i18n\nsupport](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)\n-
[
]\n[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)\nwas
added for features that require explanation or tutorials\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- [ ] If a plugin
configuration key changed, check if it needs to be\nallowlisted in the
cloud and added to the
[docker\nlist](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)\n-
[ ] This was checked for breaking HTTP API changes, and any
breaking\nchanges have been approved by the breaking-change committee.
The\n`release_note:breaking` label should be applied in these
situations.\n- [ ] [Flaky
Test\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1)
was\nused on any tests changed\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.\n\n### Identify risks\n\nDoes this
PR introduce any risks? For example, consider risks like hard\nto test
bugs, performance regression, potential of data loss.\n\nDescribe the
risk, its severity, and mitigation for each identified\nrisk. Invite
stakeholders and evaluate how to proceed before merging.\n\n- [ ] [See
some
risk\nexamples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx)\n-
[ ] ...\n\n\n## Release note\nFixes an issue where changing the default
AI connector in settings did\nnot take effect until the page was
refreshed. The connector list and\ndefault selection now update
automatically when settings are changed.\n\n---------\n\nCo-authored-by:
Elastic Machine
<elasticmachine@users.noreply.github.com>","sha":"79536dd06970e4f8027ed95f41d834bef9077be4"}},"sourceBranch":"main","suggestedTargetBranches":["9.4"],"targetPullRequestStates":[{"branch":"9.4","label":"v9.4.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v9.5.0","branchLabelMappingKey":"^v9.5.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/262679","number":262679,"mergeCommit":{"message":"[Inference
UI] Changing default model will not require a hard page refresh
(#262679)\n\nPreviously, changing the default AI connector in settings
required a\nhard page refresh for the change to take effect across the
UI. This PR\nmakes the connector list and default connector selection
reactive by\nsubscribing to UI settings change streams, so updates
propagate\ninstantly.\n\n## Summary\n\nSummarize your PR. If it involves
visual changes include a screenshot or\ngif.\n\n###
Stateful\n\nhttps://github.com/user-attachments/assets/c52449db-6248-4627-9872-5fa6e3dcbbf5\n\n###
Serverless\n\n\nhttps://github.com/user-attachments/assets/13a3353e-2706-484f-b868-3a305c1e2362\n\n\n\n###
Checklist\n\nCheck the PR satisfies following conditions. \n\nReviewers
should verify this PR satisfies this list as well.\n\n- [ ] Any text
added follows [EUI's
writing\nguidelines](https://elastic.github.io/eui/#/guidelines/writing),
uses\nsentence case text and includes
[i18n\nsupport](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)\n-
[
]\n[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)\nwas
added for features that require explanation or tutorials\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- [ ] If a plugin
configuration key changed, check if it needs to be\nallowlisted in the
cloud and added to the
[docker\nlist](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)\n-
[ ] This was checked for breaking HTTP API changes, and any
breaking\nchanges have been approved by the breaking-change committee.
The\n`release_note:breaking` label should be applied in these
situations.\n- [ ] [Flaky
Test\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1)
was\nused on any tests changed\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.\n\n### Identify risks\n\nDoes this
PR introduce any risks? For example, consider risks like hard\nto test
bugs, performance regression, potential of data loss.\n\nDescribe the
risk, its severity, and mitigation for each identified\nrisk. Invite
stakeholders and evaluate how to proceed before merging.\n\n- [ ] [See
some
risk\nexamples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx)\n-
[ ] ...\n\n\n## Release note\nFixes an issue where changing the default
AI connector in settings did\nnot take effect until the page was
refreshed. The connector list and\ndefault selection now update
automatically when settings are changed.\n\n---------\n\nCo-authored-by:
Elastic Machine
<elasticmachine@users.noreply.github.com>","sha":"79536dd06970e4f8027ed95f41d834bef9077be4"}}]}]
BACKPORT-->

Co-authored-by: Saikat Sarkar <132922331+saikatsarkar056@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants