Describe the bug
When using the Ollama provider in the settings panel, the "Refresh Models" flow has several problems:
-
Stuck loading state: The requestOllamaModels handler in the extension only posts an ollamaModels message back to the webview when models are found (Object.keys(ollamaModels).length > 0). When no models are returned — or when the fetch throws an error — no response is ever sent, so the webview stays stuck in a perpetual "loading" state with no feedback to the user.
-
Silent failures on fetch errors: When the Ollama fetch fails (e.g. Ollama isn't running, wrong base URL, connection refused), the handler catches the error and silently logs it with console.debug. The user sees no error message and has no idea why the refresh produced no models.
-
Stale base URL used for refresh: The refresh always uses the saved ollamaBaseUrl / ollamaApiKey from extension state, ignoring any unsaved edits the user has made in the settings form. If a user types a new base URL and clicks refresh before saving, the refresh queries the old URL — producing confusing results.
-
No dedicated refresh button / status feedback: The Ollama settings panel has no visible refresh button with loading, success, or error status indicators, so users cannot tell whether a refresh is in progress, succeeded, or failed.
To Reproduce
Steps to reproduce the behavior:
- Open the Zoo Code settings panel and select the Ollama provider.
- Enter a base URL for an Ollama instance that is not running (or enter an incorrect URL).
- Trigger a model refresh (the panel refreshes models on mount / provider switch).
- Observe that no models appear and there is no error message or loading indicator — the panel gives no feedback at all.
- Edit the base URL to a correct value but click refresh before saving the setting.
- Observe that the refresh still queries the old (saved) URL, not the one currently typed in the form.
Expected behavior
- The refresh should always post a response back to the webview, even when no models are found or the fetch errors, so the UI can transition out of the loading state.
- Fetch errors should be logged to the output channel and the error message should be surfaced in the settings panel so the user understands why no models were returned.
- The refresh should use the base URL and API key currently entered in the form (unsaved edits), not the stale saved state, so the user can validate a URL before committing it.
- The Ollama panel should have a dedicated refresh button with visible loading / success / error status feedback.
Screenshots
N/A — the bug is about missing feedback and stale state, not a visual rendering issue.
Video
N/A
What version of zoo are you running
3.66.0
Additional context
The root cause is in the requestOllamaModels case of webviewMessageHandler.ts and the Ollama.tsx settings component. The handler silently swallows errors and conditionally suppresses empty responses, while the component relies on useEvent from react-use with no refresh status state machine.
Describe the bug
When using the Ollama provider in the settings panel, the "Refresh Models" flow has several problems:
Stuck loading state: The
requestOllamaModelshandler in the extension only posts anollamaModelsmessage back to the webview when models are found (Object.keys(ollamaModels).length > 0). When no models are returned — or when the fetch throws an error — no response is ever sent, so the webview stays stuck in a perpetual "loading" state with no feedback to the user.Silent failures on fetch errors: When the Ollama fetch fails (e.g. Ollama isn't running, wrong base URL, connection refused), the handler catches the error and silently logs it with
console.debug. The user sees no error message and has no idea why the refresh produced no models.Stale base URL used for refresh: The refresh always uses the saved
ollamaBaseUrl/ollamaApiKeyfrom extension state, ignoring any unsaved edits the user has made in the settings form. If a user types a new base URL and clicks refresh before saving, the refresh queries the old URL — producing confusing results.No dedicated refresh button / status feedback: The Ollama settings panel has no visible refresh button with loading, success, or error status indicators, so users cannot tell whether a refresh is in progress, succeeded, or failed.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Screenshots
N/A — the bug is about missing feedback and stale state, not a visual rendering issue.
Video
N/A
What version of zoo are you running
3.66.0
Additional context
The root cause is in the
requestOllamaModelscase ofwebviewMessageHandler.tsand theOllama.tsxsettings component. The handler silently swallows errors and conditionally suppresses empty responses, while the component relies onuseEventfromreact-usewith no refresh status state machine.