Skip to content

webui: stop re-probing disabled /tools endpoint on every message - #28646

Open
geckguy wants to merge 1 commit into
ggml-org:masterfrom
geckguy:fix/ui-tools-403-spam
Open

webui: stop re-probing disabled /tools endpoint on every message#28646
geckguy wants to merge 1 commit into
ggml-org:masterfrom
geckguy:fix/ui-tools-403-spam

Conversation

@geckguy

@geckguy geckguy commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Overview

Fixes #28299.

When llama-server is started without tools, the web UI sends a GET /tools before 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 (runAgenticFlow and the tools panel's handleOpen) guard on serverTools.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.isToolsEndpointUnreachable to the refetch guards
  • tools.svelte.ts: detect the disabled endpoint via the error status (403) instead of string-matching the error message, resolving the existing TODO

One harmless 403 remains at UI startup; after that the UI never touches /tools again 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), with fetch instrumented in the page:

  • before: every chat message produced one GET /tools (403)
  • after: two full chat generations plus opening the tools panel produced zero /tools requests

svelte-check reports 0 errors/0 warnings, eslint+prettier clean, and the unit test suite passes (649/649).

Requirements

  • I have read and agree with the contributing guidelines
  • AI usage disclosure: YES — light usage (AI-assisted code analysis and formatting). I understand the changes fully and verified them locally end-to-end.

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
@geckguy
geckguy requested a review from a team as a code owner September 9, 2026 11:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Misc. bug: llama-server web UI keeps sending GET /tools requests that return 403, tripping fail2ban

1 participant