webui: stop re-probing disabled /tools endpoint on every message - #28646
Open
geckguy wants to merge 1 commit into
Open
webui: stop re-probing disabled /tools endpoint on every message#28646geckguy wants to merge 1 commit into
geckguy wants to merge 1 commit into
Conversation
When /tools returns 403 (server started without tools), the web UI refetched the tool list before every chat message and on every tools panel open, since the guard treated an empty tool list as "not yet fetched". Each retry returned 403 and could trip fail2ban. Skip the refetch once the store flags the endpoint as disabled, and detect that state via the response status code instead of string- matching the error message. Fixes ggml-org#28299
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
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.
Overview
Fixes #28299.
When llama-server is started without tools, the web UI sends a
GET /toolsbefore every chat message. Each request returns 403 ("this feature is disabled"), and on exposed servers these repeated failed requests get the client banned by fail2ban.Root cause: both refetch sites (
runAgenticFlowand the tools panel'shandleOpen) guard onserverTools.length === 0 && !loading. When the endpoint is disabled, that condition never becomes false, so the UI retries on every message / panel open. The store already tracks the disabled state (isToolsEndpointUnreachable) but the guards never consulted it.Changes:
agentic/index.svelte.ts,use-tools-panel.svelte.ts: add!toolsStore.isToolsEndpointUnreachableto the refetch guardstools.svelte.ts: detect the disabled endpoint via the error status (403) instead of string-matching the error message, resolving the existing TODOOne harmless 403 remains at UI startup; after that the UI never touches
/toolsagain until a server restart gives it a fresh session.Additional information
Verified end to end against a local llama-server without
--tools(serving the built UI), withfetchinstrumented in the page:GET /tools(403)/toolsrequestssvelte-checkreports 0 errors/0 warnings, eslint+prettier clean, and the unit test suite passes (649/649).Requirements