Repository navigation
fix(assistant): the web app doesn't list Ollama Cloud - #3396
Conversation
ollama.com refuses the browser's CORS preflight, so the preset could only fail there. works_in_browser names the providers a web page can reach (no sign-in, no Ollama Cloud) and the settings list uses it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
Code reviewPR #3396 is small: it adds Bugs
Security
Performance
Quality
AGENTS.md
Checked
Change sizeCompared with main (merge base 172b884 to PR head 8d9800a).
|
The web app saved its provider choice before it stopped listing Ollama Cloud, so the choice could come back with no entry in the list and requests that fail on CORS. usable_choice checks a saved or environment choice against what the web app can reach; the settings list uses the same rule. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Code reviewI found no bugs or crash paths. The change does what the PR says on the web, desktop and tests. Confidence is high for the reading below, since I checked it against the surrounding code. The one concern a prior thread raised (a saved Ollama Cloud choice restored in the web app) is fixed by Bugs
Security
Performance
Quality
AGENTS.md
Already raised (left alone)
Change sizeCompared: the whole PR against main (merge base 172b884 to PR head b9e0a0f).
|
Summary
The web app no longer lists Ollama Cloud among the assistant's providers. ollama.com refuses the browser's CORS preflight (
OPTIONS→ 405), so picking it there could only end in a failed request.provider::works_in_browsernames the providers a web page can reach: no sign-in (as before) and no Ollama Cloud.provider::usable_choice(id, web)applies it to a provider choice. The settings list inassistantpane.rsuses it in place of its ownp.logincheck. So doesensure_loaded, for the choice saved in the browser's storage or set inRUSTGIS_ASSISTANT_PROVIDER: a web app that had Ollama Cloud selected before this change falls back to the default instead of restoring it. The desktop and the command line are unchanged. The guide's web section now says the web app doesn't list it and points to a local Ollama server signed in withollama signin.I chose to hide the preset rather than show a note beside it: the list already hides the ChatGPT sign-in on the web the same way, and a note would add a new string to translate.
Testing
cargo test -p rustgis-assistant: 309 passed, 2 of them new. Both were written before the code they test and failed to compile without it:the_web_app_offers_only_providers_a_web_page_can_reach:works_in_browserleaves outollama-cloudandchatgptand keeps the others.a_saved_choice_the_web_app_cannot_use_is_not_restored_there:usable_choicerefusesollama-cloudandchatgptfor the web app, accepts them on the desktop, acceptsmistralandollamaon both, and refuses an unknown id.cargo clippy -p rustgis-ui-egui -- -D warnings(native): clean.RUSTGIS_LANGUAGE=en cargo test -p rustgis-ui-egui assistant: 59 passed.wasm32side was checked: the rule is a pure function of the provider id and awebflag, so it is tested on the native target. The two call sites passcfg!(target_arch = "wasm32")as that flag and contain no other logic. The web build itself isn't built locally, becausezstd-sysneedsclang, which isn't on this machine; the "Web app (wasm32)" CI job builds it.UI evidence
No visible change on the desktop. In the web app the provider list loses the Ollama Cloud entry. I didn't capture this, because the web build needs
clang(forzstd-sys), which isn't on this machine.Related issue
Follow-up to #3384 (#3380)
🤖 Generated with Claude Code
Summary by CodeRabbit