-
Notifications
You must be signed in to change notification settings - Fork 8.5k
[Obs AI Assistant] knowledge base UI works offline #229874
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
Conversation
|
Pinging @elastic/obs-ai-assistant (Team:Obs AI Assistant) |
🤖 GitHub commentsExpand to view the GitHub comments
Just comment with:
|
💚 Build Succeeded
Metrics [docs]Async chunks
History
|
I don't see any harm in this change but I don't believe it's strictly necessary. Afaiu an air-gapped user still looks online to the browser because their network interface is up in order to reach Kibana over a local network - they just can’t reach the public internet. |
|
@sorenlouv I agree, though this change does make things a lot easier for us to test in dev |
|
Starting backport for target branches: 8.17, 8.18, 8.19, 9.0, 9.1 https://github.com/elastic/kibana/actions/runs/16680513891 |
## 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)
## 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)
💔 Some backports could not be created
Note: Successful backport PRs will be merged automatically after passing CI. Manual backportTo create the backport manually run: Questions ?Please refer to the Backport tool documentation |
…230280) # Backport This will backport the following commits from `main` to `8.19`: - [[Obs AI Assistant] knowledge base UI works offline (#229874)](#229874) <!--- Backport version: 9.6.6 --> ### 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:all-open","Team:Obs AI Assistant","ci:project-deploy-observability","v9.2.0"],"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"}}]}] BACKPORT--> Co-authored-by: Sandra G <neptunian@users.noreply.github.com>
|
Looks like this PR has backport PRs but they still haven't been merged. Please merge them ASAP to keep the branches relatively in sync. |
## 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.
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
## 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) # Conflicts: # x-pack/platform/plugins/private/observability_ai_assistant_management/public/hooks/use_get_product_doc.ts
|
Looks like this PR has backport PRs but they still haven't been merged. Please merge them ASAP to keep the branches relatively in sync. |
## 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.
…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-->
## 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.
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. 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.onLineremains true. In those cases, the UI works as expected. https://developer.mozilla.org/en-US/docs/Web/API/Navigator/onLineThis brings management in line with other kibana endpoints which do not use
react-queryand do not have the issue, includingobservability_ai_assistant/kb/statusTest