Webui bugfix for single-model mode usage#25738
Open
intel00000 wants to merge 2 commits into
Open
Conversation
In single-model (non-router) mode the server always has its model loaded and the /models/load endpoint does not exist. isModelLoaded only checks routerModels, which is empty outside router mode, so isActiveModelLoaded was always false there. When not in router mode, treat as loaded so the gauge hide the load prompt.
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes the context gauge behavior in WebUI when connected to a single-model (non-router) server, and improves UX by persisting whether “Token usage details” is expanded across page reloads.
Changes:
- Treat the active model as “loaded” when not in router mode, preventing the UI from showing a “Load model” action that calls a non-existent endpoint in single-model mode.
- Add a dedicated localStorage key for the context gauge details open/closed state.
- Persist the context gauge “Token usage details” open state via the existing
persisted()helper.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| tools/ui/src/lib/hooks/use-context-gauge.svelte.ts | Adjusts “active model loaded” logic to be correct in non-router (single-model) mode. |
| tools/ui/src/lib/constants/storage.ts | Adds a localStorage key constant for persisting the context gauge details open state. |
| tools/ui/src/lib/components/app/chat/ChatForm/ChatFormContextGauge/ContextGaugeDetails.svelte | Persists the collapsible details open state using localStorage for improved UX. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
intel00000
force-pushed
the
fix/webui-context-gauge
branch
from
July 16, 2026 08:18
9d5a82b to
d47ce06
Compare
intel00000
force-pushed
the
fix/webui-context-gauge
branch
from
July 27, 2026 07:56
d47ce06 to
5e5fbf5
Compare
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
Webui bugfix for single-model mode usage
Additional information
In single-model (non-router) mode the server always has its model loaded and the /models/load endpoint does not exist. Current context gauge report the model as unloaded and showed a "Load model" button that will hit /models/load and errored.
See below:
Cause: isModelLoaded only checks routerModels, which is empty when not in router mode, so isActiveModelLoaded always false there.
Fix: When not in router mode, treat as model loaded so the gauge hide the load prompt.
Second commit is to persist the context gauge "Token usage details" open state to browser local storage for better UX experience.

Requirements