4a2501c fix(tool-server): add AbortController timeout to openapi.json fetch
📊 Changes
1 file changed (+17 additions, -5 deletions)
View changed files
📝src/lib/apis/index.ts (+17 -5)
📄 Description
Summary
Fixes#22543 — infinite UI hang when an external OpenAPI tool server is unreachable.
The fetch() call in getToolServerData (src/lib/apis/index.ts) had no timeout or abort signal, causing the browser to keep the request Pending forever and blocking page load when a configured tool server is unreachable.
Added an AbortController with a 10-second default timeout (timeout parameter, configurable). The signal is passed to fetch().
On AbortError, a descriptive "Connection timed out after 10s" error is thrown instead of hanging.
Existing error handling in getToolServersData propagates this as { error, url }, which setToolServers (in src/routes/(app)/+layout.svelte) already converts into a non-blocking toast.error() warning — so page load continues and the user sees a clear message.
Behaviour change
Before
After
Unreachable tool server causes page to spin indefinitely
Fetch aborts after 10 s; toast shows "Failed to connect to <URL> OpenAPI tool server"; rest of the page loads normally
Test plan
Add an OpenAPI tool server pointing to an unreachable URL (e.g. http://localhost:2022)
Enable the connection and save
Reload Open WebUI — page should load within ~10 s and show a toast error for the unreachable server
Verify that reachable tool servers still work correctly
Confirm the timeout can be overridden by callers via the optional timeout parameter
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.
## 📋 Pull Request Information
**Original PR:** https://github.com/open-webui/open-webui/pull/22618
**Author:** [@gambletan](https://github.com/gambletan)
**Created:** 3/12/2026
**Status:** ❌ Closed
**Base:** `main` ← **Head:** `fix/openapi-fetch-timeout`
---
### 📝 Commits (1)
- [`4a2501c`](https://github.com/open-webui/open-webui/commit/4a2501c2e1a1308a05fc070edce80731c5306d48) fix(tool-server): add AbortController timeout to openapi.json fetch
### 📊 Changes
**1 file changed** (+17 additions, -5 deletions)
<details>
<summary>View changed files</summary>
📝 `src/lib/apis/index.ts` (+17 -5)
</details>
### 📄 Description
## Summary
Fixes #22543 — infinite UI hang when an external OpenAPI tool server is unreachable.
- The `fetch()` call in `getToolServerData` (`src/lib/apis/index.ts`) had no timeout or abort signal, causing the browser to keep the request `Pending` forever and blocking page load when a configured tool server is unreachable.
- Added an `AbortController` with a **10-second default timeout** (`timeout` parameter, configurable). The `signal` is passed to `fetch()`.
- On `AbortError`, a descriptive `"Connection timed out after 10s"` error is thrown instead of hanging.
- Existing error handling in `getToolServersData` propagates this as `{ error, url }`, which `setToolServers` (in `src/routes/(app)/+layout.svelte`) already converts into a non-blocking `toast.error()` warning — so page load continues and the user sees a clear message.
## Behaviour change
| Before | After |
|---|---|
| Unreachable tool server causes page to spin indefinitely | Fetch aborts after 10 s; toast shows "Failed to connect to \<URL\> OpenAPI tool server"; rest of the page loads normally |
## Test plan
- [ ] Add an OpenAPI tool server pointing to an unreachable URL (e.g. `http://localhost:2022`)
- [ ] Enable the connection and save
- [ ] Reload Open WebUI — page should load within ~10 s and show a toast error for the unreachable server
- [ ] Verify that reachable tool servers still work correctly
- [ ] Confirm the timeout can be overridden by callers via the optional `timeout` parameter
🤖 Generated with [Claude Code](https://claude.com/claude-code)
---
<sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
📋 Pull Request Information
Original PR: https://github.com/open-webui/open-webui/pull/22618
Author: @gambletan
Created: 3/12/2026
Status: ❌ Closed
Base:
main← Head:fix/openapi-fetch-timeout📝 Commits (1)
4a2501cfix(tool-server): add AbortController timeout to openapi.json fetch📊 Changes
1 file changed (+17 additions, -5 deletions)
View changed files
📝
src/lib/apis/index.ts(+17 -5)📄 Description
Summary
Fixes #22543 — infinite UI hang when an external OpenAPI tool server is unreachable.
fetch()call ingetToolServerData(src/lib/apis/index.ts) had no timeout or abort signal, causing the browser to keep the requestPendingforever and blocking page load when a configured tool server is unreachable.AbortControllerwith a 10-second default timeout (timeoutparameter, configurable). Thesignalis passed tofetch().AbortError, a descriptive"Connection timed out after 10s"error is thrown instead of hanging.getToolServersDatapropagates this as{ error, url }, whichsetToolServers(insrc/routes/(app)/+layout.svelte) already converts into a non-blockingtoast.error()warning — so page load continues and the user sees a clear message.Behaviour change
Test plan
http://localhost:2022)timeoutparameter🤖 Generated with Claude Code
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.