-
Notifications
You must be signed in to change notification settings - Fork 8.5k
[8.19] [Obs AI Assistant] knowledge base UI works offline (#229874) #230280
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
kibanamachine
merged 1 commit into
elastic:8.19
from
kibanamachine:backport/8.19/pr-229874
Aug 1, 2025
Merged
[8.19] [Obs AI Assistant] knowledge base UI works offline (#229874) #230280
kibanamachine
merged 1 commit into
elastic:8.19
from
kibanamachine:backport/8.19/pr-229874
Aug 1, 2025
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Summary When using kibana without an network connection, as is potentially the case in airgapped environments, most requests in observability ai assistant management UI will not fire. This results in the inability to use the knowledge base UI, though the api endpoints still work. By default, [TanStack Query (used by useQuery) disables all network requests when the browser reports offline status](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode). This isn't necessary for kb endpoints that operate entirely against the local Elasticsearch cluster and do not require internet access. This change updates all useQuery calls in the Observability AI Assistant Management to use `networkMode: 'always'`. This ensures that queries are executed even when the browser is offline (`navigator.onLine === false`). Not all air-gapped environments would be affected. In many real-world deployments machines still have network interfaces configured, and `navigator.onLine` remains true. In those cases, the UI works as expected. https://developer.mozilla.org/en-US/docs/Web/API/Navigator/onLine This brings management in line with other kibana endpoints which do not use `react-query` and do not have the issue, including `observability_ai_assistant/kb/status` ### Test - Run es and kibana offline - Visit knowledge tab in settings and interact with the app - the network tab should have requests (they will fail unless you have elser running locally, but that is ok), eg New Entry should make the request to save when trying to save. (cherry picked from commit 0b1864a)
neptunian
added a commit
that referenced
this pull request
Aug 5, 2025
…230651) # Backport This will backport the following commits from `main` to `9.1`: - [[Obs AI Assistant] knowledge base UI works offline (#229874)](#229874) <!--- Backport version: 10.0.1 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"Sandra G","email":"neptunian@users.noreply.github.com"},"sourceCommit":{"committedDate":"2025-08-01T16:46:51Z","message":"[Obs AI Assistant] knowledge base UI works offline (#229874)\n\n## Summary\n\nWhen using kibana without an network connection, as is potentially the\ncase in airgapped environments, most requests in observability ai\nassistant management UI will not fire. This results in the inability to\nuse the knowledge base UI, though the api endpoints still work. By\ndefault, [TanStack Query (used by useQuery) disables all network\nrequests when the browser reports offline\nstatus](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode).\nThis isn't necessary for kb endpoints that operate entirely against the\nlocal Elasticsearch cluster and do not require internet access.\n\nThis change updates all useQuery calls in the Observability AI Assistant\nManagement to use `networkMode: 'always'`. This ensures that queries are\nexecuted even when the browser is offline (`navigator.onLine ===\nfalse`).\n\nNot all air-gapped environments would be affected. In many real-world\ndeployments machines still have network interfaces configured, and\n`navigator.onLine` remains true. In those cases, the UI works as\nexpected.\nhttps://developer.mozilla.org/en-US/docs/Web/API/Navigator/onLine\n\nThis brings management in line with other kibana endpoints which do not\nuse `react-query` and do not have the issue, including\n`observability_ai_assistant/kb/status`\n\n### Test\n- Run es and kibana offline\n- Visit knowledge tab in settings and interact with the app \n- the network tab should have requests (they will fail unless you have\nelser running locally, but that is ok), eg New Entry should make the\nrequest to save when trying to save.","sha":"0b1864ae8b9a7fb6952d2579b206cd63619bff8d","branchLabelMapping":{"^v9.2.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","backport missing","backport:all-open","Team:Obs AI Assistant","ci:project-deploy-observability","v9.2.0","v8.19.1"],"title":"[Obs AI Assistant] knowledge base UI works offline","number":229874,"url":"https://github.com/elastic/kibana/pull/229874","mergeCommit":{"message":"[Obs AI Assistant] knowledge base UI works offline (#229874)\n\n## Summary\n\nWhen using kibana without an network connection, as is potentially the\ncase in airgapped environments, most requests in observability ai\nassistant management UI will not fire. This results in the inability to\nuse the knowledge base UI, though the api endpoints still work. By\ndefault, [TanStack Query (used by useQuery) disables all network\nrequests when the browser reports offline\nstatus](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode).\nThis isn't necessary for kb endpoints that operate entirely against the\nlocal Elasticsearch cluster and do not require internet access.\n\nThis change updates all useQuery calls in the Observability AI Assistant\nManagement to use `networkMode: 'always'`. This ensures that queries are\nexecuted even when the browser is offline (`navigator.onLine ===\nfalse`).\n\nNot all air-gapped environments would be affected. In many real-world\ndeployments machines still have network interfaces configured, and\n`navigator.onLine` remains true. In those cases, the UI works as\nexpected.\nhttps://developer.mozilla.org/en-US/docs/Web/API/Navigator/onLine\n\nThis brings management in line with other kibana endpoints which do not\nuse `react-query` and do not have the issue, including\n`observability_ai_assistant/kb/status`\n\n### Test\n- Run es and kibana offline\n- Visit knowledge tab in settings and interact with the app \n- the network tab should have requests (they will fail unless you have\nelser running locally, but that is ok), eg New Entry should make the\nrequest to save when trying to save.","sha":"0b1864ae8b9a7fb6952d2579b206cd63619bff8d"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.2.0","branchLabelMappingKey":"^v9.2.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/229874","number":229874,"mergeCommit":{"message":"[Obs AI Assistant] knowledge base UI works offline (#229874)\n\n## Summary\n\nWhen using kibana without an network connection, as is potentially the\ncase in airgapped environments, most requests in observability ai\nassistant management UI will not fire. This results in the inability to\nuse the knowledge base UI, though the api endpoints still work. By\ndefault, [TanStack Query (used by useQuery) disables all network\nrequests when the browser reports offline\nstatus](https://tanstack.com/query/latest/docs/framework/react/guides/network-mode).\nThis isn't necessary for kb endpoints that operate entirely against the\nlocal Elasticsearch cluster and do not require internet access.\n\nThis change updates all useQuery calls in the Observability AI Assistant\nManagement to use `networkMode: 'always'`. This ensures that queries are\nexecuted even when the browser is offline (`navigator.onLine ===\nfalse`).\n\nNot all air-gapped environments would be affected. In many real-world\ndeployments machines still have network interfaces configured, and\n`navigator.onLine` remains true. In those cases, the UI works as\nexpected.\nhttps://developer.mozilla.org/en-US/docs/Web/API/Navigator/onLine\n\nThis brings management in line with other kibana endpoints which do not\nuse `react-query` and do not have the issue, including\n`observability_ai_assistant/kb/status`\n\n### Test\n- Run es and kibana offline\n- Visit knowledge tab in settings and interact with the app \n- the network tab should have requests (they will fail unless you have\nelser running locally, but that is ok), eg New Entry should make the\nrequest to save when trying to save.","sha":"0b1864ae8b9a7fb6952d2579b206cd63619bff8d"}},{"branch":"8.19","label":"v8.19.1","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"url":"https://github.com/elastic/kibana/pull/230280","number":230280,"state":"MERGED","mergeCommit":{"sha":"44ed100ae8190550af4382a7359626c50ab70173","message":"[8.19] [Obs AI Assistant] knowledge base UI works offline (#229874) (#230280)\n\n# Backport\n\nThis will backport the following commits from `main` to `8.19`:\n- [[Obs AI Assistant] knowledge base UI works offline\n(#229874)](https://github.com/elastic/kibana/pull/229874)\n\n\n\n### Questions ?\nPlease refer to the [Backport tool\ndocumentation](https://github.com/sorenlouv/backport)\n\n\n\nCo-authored-by: Sandra G <neptunian@users.noreply.github.com>"}},{"url":"https://github.com/elastic/kibana/pull/230281","number":230281,"branch":"9.1","state":"OPEN"}]}] BACKPORT-->
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Backport
This will backport the following commits from
mainto8.19:Questions ?
Please refer to the Backport tool documentation