Skip to content

Conversation

@neptunian
Copy link
Contributor

@neptunian neptunian commented Jul 29, 2025

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.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.

@neptunian neptunian added release_note:fix backport:all-open Backport to all branches that could still receive a release labels Jul 29, 2025
@neptunian neptunian requested a review from a team as a code owner July 29, 2025 18:40
@neptunian neptunian added the Team:Obs AI Assistant Observability AI Assistant label Jul 29, 2025
@elasticmachine
Copy link
Contributor

Pinging @elastic/obs-ai-assistant (Team:Obs AI Assistant)

@botelastic botelastic bot added the ci:project-deploy-observability Create an Observability project label Jul 29, 2025
@github-actions
Copy link
Contributor

🤖 GitHub comments

Expand to view the GitHub comments

Just comment with:

  • /oblt-deploy : Deploy a Kibana instance using the Observability test environments.
  • run docs-build : Re-trigger the docs validation. (use unformatted text in the comment!)

@elasticmachine
Copy link
Contributor

elasticmachine commented Jul 31, 2025

💚 Build Succeeded

  • Buildkite Build
  • Commit: b0d87a8
  • Kibana Serverless Image: docker.elastic.co/kibana-ci/kibana-serverless:pr-229874-b0d87a802735

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
observabilityAiAssistantManagement 98.4KB 98.6KB +189.0B

History

@sorenlouv
Copy link
Member

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.

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.

@neptunian
Copy link
Contributor Author

@sorenlouv I agree, though this change does make things a lot easier for us to test in dev

@neptunian neptunian merged commit 0b1864a into elastic:main Aug 1, 2025
12 checks passed
@kibanamachine
Copy link
Contributor

Starting backport for target branches: 8.17, 8.18, 8.19, 9.0, 9.1

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

kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Aug 1, 2025
## 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)
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Aug 1, 2025
## 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)
@kibanamachine
Copy link
Contributor

💔 Some backports could not be created

Status Branch Result
8.17 Backport failed because of merge conflicts
8.18 Backport failed because of merge conflicts
8.19
9.0 Backport failed because of merge conflicts
9.1

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

Manual backport

To create the backport manually run:

node scripts/backport --pr 229874

Questions ?

Please refer to the Backport tool documentation

kibanamachine added a commit that referenced this pull request Aug 1, 2025
…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>
@kibanamachine kibanamachine added the backport missing Added to PRs automatically when the are determined to be missing a backport. label Aug 4, 2025
@kibanamachine
Copy link
Contributor

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.
cc: @neptunian

szaffarano pushed a commit to szaffarano/kibana that referenced this pull request Aug 5, 2025
## 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.
@neptunian
Copy link
Contributor Author

💚 All backports created successfully

Status Branch Result
9.1

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

Questions ?

Please refer to the Backport tool documentation

neptunian added a commit to neptunian/kibana that referenced this pull request Aug 5, 2025
## 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
@kibanamachine
Copy link
Contributor

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.
cc: @neptunian

delanni pushed a commit to delanni/kibana that referenced this pull request Aug 5, 2025
## 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.
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-->
@kibanamachine kibanamachine added v9.1.1 and removed backport missing Added to PRs automatically when the are determined to be missing a backport. labels Aug 5, 2025
@wildemat wildemat mentioned this pull request Aug 7, 2025
10 tasks
@mistic mistic added v9.1.2 and removed v9.1.1 labels Aug 7, 2025
NicholasPeretti pushed a commit to NicholasPeretti/kibana that referenced this pull request Aug 18, 2025
## 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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:all-open Backport to all branches that could still receive a release ci:project-deploy-observability Create an Observability project release_note:fix Team:Obs AI Assistant Observability AI Assistant v8.19.1 v9.1.2 v9.2.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants