Skip to content

fix(assistant): the web app doesn't list Ollama Cloud - #3396

Merged
giswqs merged 2 commits into
opengeos:mainfrom
elpidioassinaturas:fix/ollama-cloud-web
Nov 30, 2026
Merged

giswqs merged 2 commits into
opengeos:mainfrom
elpidioassinaturas:fix/ollama-cloud-web

Conversation

@elpidioassinaturas

@elpidioassinaturas elpidioassinaturas commented Nov 29, 2026 •

Copy link
Copy Markdown
Contributor

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_browser names 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 in assistantpane.rs uses it in place of its own p.login check. So does ensure_loaded, for the choice saved in the browser's storage or set in RUSTGIS_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 with ollama 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_browser leaves out ollama-cloud and chatgpt and keeps the others.
    • a_saved_choice_the_web_app_cannot_use_is_not_restored_there: usable_choice refuses ollama-cloud and chatgpt for the web app, accepts them on the desktop, accepts mistral and ollama on 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.
  • How the wasm32 side was checked: the rule is a pure function of the provider id and a web flag, so it is tested on the native target. The two call sites pass cfg!(target_arch = "wasm32") as that flag and contain no other logic. The web build itself isn't built locally, because zstd-sys needs clang, 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 (for zstd-sys), which isn't on this machine.

Related issue

Follow-up to #3384 (#3380)

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes
    • The browser provider picker now excludes providers unavailable in the web app, including Ollama Cloud and ChatGPT, while listing supported options such as Anthropic, OpenAI, Gemini, OpenRouter, Ollama, Custom, and Mistral.
    • Saved or environment-selected providers are now checked against the current runtime, so unavailable choices are not restored in the browser.
  • Documentation
    • Clarified that Ollama Cloud isn’t listed in the web app and explained how to access its models through a signed-in local Ollama server.

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>
@coderabbitai

coderabbitai Bot commented Nov 29, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The change adds browser provider eligibility checks, applies them to startup selection and the provider picker, and updates the guide with instructions for accessing Ollama Cloud models through a local Ollama server.

Changes: Browser provider filtering

Layer / File(s) Summary
Define provider eligibility
crates/assistant/src/provider.rs, crates/assistant/src/tests.rs
The new works_in_browser function excludes sign-in presets and ollama-cloud. The new usable_choice function checks that a provider exists and is available in the current runtime. Tests cover included, excluded, and retired providers.
Apply eligibility to startup and picker
crates/ui-egui/src/assistant.rs, crates/ui-egui/src/assistantpane.rs
Startup selection validates saved or environment-selected providers for the current runtime. The wasm provider picker filters presets with usable_choice.
Document Ollama Cloud access
docs/user-guide/assistant.md
The guide states that the web app does not list Ollama Cloud and describes using its models through a local Ollama server signed in with ollama signin.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Possibly related issues

Possibly related PRs

  • opengeos/RustGIS#3384: That PR adds the ollama-cloud preset, which this change excludes from the web provider picker.

Suggested reviewers: giswqs, mavrick-f, deniial00

Merge Risk: Minimal · up to b9e0a

The web app stops listing Ollama Cloud, and a saved Ollama Cloud choice falls back. Desktop and command-line behavior are unchanged. The guide points web users to a local Ollama server. No merge-blocking risk is evident.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title "fix(assistant): the web app doesn't list Ollama Cloud" states the main change. The PR removes Ollama Cloud from the web app's provider list because ollama.com rejects browser CORS preflight…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Description check Passed The description covers the Summary (what changed, why: ollama.com rejects CORS preflight with 405, and the new works_in_browser/usable_choice rule), a Testing section with specific commands, counts, a…
Full details: Title check

Explanation

The title "fix(assistant): the web app doesn't list Ollama Cloud" states the main change. The PR removes Ollama Cloud from the web app's provider list because ollama.com rejects browser CORS preflight requests. The title is specific, short, and matches the changeset.

Full details: Description check

Explanation

The description covers the Summary (what changed, why: ollama.com rejects CORS preflight with 405, and the new works_in_browser/usable_choice rule), a Testing section with specific commands, counts, and the two new tests, a UI evidence section that explains the web-only UI change and why no screenshot was captured, and a Related issue line (follow-up to #3384 and #3380). It follows the template structure. The gaps are minor: the UI evidence section does not contain the required before/after screenshots, and the template asks for a 'No visible UI change' line only when there is no visible change, which does not apply to the web app. The author gives a reason for not capturing evidence, so the section is only partly satisfied.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

A rabbit checks which providers show,
The browser list says which can go.
Cloud models take a local route,
With Ollama signed in, they’re reachable out.
The guide now points the way to start,
And saved choices get checked apart.

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 36fca608-5122-4793-977e-68c9380763b8
Commits

Reviewing files that changed from the base of the PR and between 8d9800a and b9e0a0f.

Files selected for processing: 4

  • crates/assistant/src/provider.rs
  • crates/assistant/src/tests.rs
  • crates/ui-egui/src/assistant.rs
  • crates/ui-egui/src/assistantpane.rs

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 4 remain after this review.

Comment thread crates/ui-egui/src/assistantpane.rs Resolved
@github-actions

Copy link
Copy Markdown
Contributor

Code review

PR #3396 is small: it adds provider::works_in_browser, uses it in the web provider list, adds a test, and updates the guide. The change is correct for the list itself. One gap lets web users keep selecting Ollama Cloud from a saved choice.

Bugs

  • Saved Ollama Cloud choice still works on the web (bug, confidence about 85%). ensure_loaded in crates/ui-egui/src/assistant.rs:297-303 restores the saved assistant_provider without checking it against works_in_browser. The web app persists that pref in localStorage, so a browser that had Ollama Cloud selected keeps it. The combo box shows the name with no matching entry, and requests fail on the CORS preflight. The inline comment on assistantpane.rs:148 suggests a one-line filter fix. I did not run the web build.

Security

  • None found.

Performance

  • None found.

Quality

  • Nit, not posted: the test checks only that the browser list excludes two providers and keeps others. It does not exercise the wasm32 branch that now calls the predicate, which the PR description already states.

AGENTS.md

  • No rule break found. The predicate is not cfg-gated and has no dead-code risk on native or wasm. No new strings need translating. The PR's surface notes are accurate: the desktop and CLI paths are unchanged.

Checked

  • PRESETS and the login flags in crates/assistant/src/provider.rs: works_in_browser equals the old !login check plus ollama-cloud.
  • first_keyed and choose already exclude Ollama Cloud, so the CLI and desktop are unaffected.
  • The web persistence path (apps/rustgis-web/src/web.rs) and choose_provider (assistant.rs:506), which together produce the restore issue above.
  • The other login readers: the ChatGPT path already has a missing() message on the web, so it doesn't have the same gap.
  • Prior review threads: none on this PR, so nothing was left out as already raised.

Change size

Compared with main (merge base 172b884 to PR head 8d9800a).

Measure Value
Files changed 4 (0 added, 4 modified, 0 removed, 0 renamed)
Size before 560.0 KB
Size after 560.8 KB
Total size change +849 B
Path Before After Change
crates/assistant/src/tests.rs 319.2 KB 319.7 KB +499 B
crates/assistant/src/provider.rs 86.9 KB 87.1 KB +250 B
crates/ui-egui/src/assistantpane.rs 116.6 KB 116.7 KB +80 B
docs/user-guide/assistant.md 37.3 KB 37.3 KB +20 B

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>
Comment thread crates/ui-egui/src/assistant.rs Resolved
Comment thread crates/assistant/src/provider.rs Resolved
@github-actions

Copy link
Copy Markdown
Contributor

Code review

I 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 usable_choice in ensure_loaded, so I did not re-raise it. I checked the web-facing twins and did not find a gap in them. I did not build or run the tests; I have no shell here.

Bugs

  • None found.

Security

  • None found.

Performance

  • None found.

Quality

  • crates/ui-egui/src/assistant.rs:299 (inline): the comment mentions only Ollama Cloud, but the filter also drops a saved ChatGPT sign-in on the web. The fallback is also silent: the provider box changes to the default with no note. Confidence: high on the comment, medium on whether the silence matters. (Inline comment posted.)
  • crates/assistant/src/provider.rs:362 (inline): the "ollama-cloud" rule is duplicated in first_keyed and works_in_browser. It could wait for the release quality pass. Confidence: medium. (Inline comment posted.)
  • Nit: assistantpane.rs:148 looks up the preset again inside usable_choice. This is trivial and not worth a change.

AGENTS.md

  • The PR changes visible web UI but has no screenshot. The rule asks for one on any visible change. The PR's stated reason is that the web build needs clang, which is a fair limit. Also, ui_shot renders the native build, so it may not show the web variant. Confidence: medium.
  • Twin check: the phone interface (crates/ui-touch/src/assistant.rs:612) still lists Ollama Cloud. That is correct, because rustgis-mobile is native and has no CORS limit. The CLI, MCP and the desktop choose/saved_provider paths are also correct without changes, since they aren't web paths.

Already raised (left alone)

  • 1 earlier concern (the thread on the saved-choice restore in ensure_loaded). It was answered by the author and the fix is in this diff, so I did not repeat it.

Change size

Compared: the whole PR against main (merge base 172b884 to PR head b9e0a0f).

Measure Value
Files changed 5 (0 added, 5 modified, 0 removed, 0 renamed)
Size before 618 KB
Size after 620 KB
Total size change +1.7 KB
Path Before After Change
crates/assistant/src/tests.rs 319 KB 320 KB +993 B
crates/assistant/src/provider.rs 86.9 KB 87.4 KB +550 B
crates/ui-egui/src/assistant.rs 58.0 KB 58.1 KB +120 B
crates/ui-egui/src/assistantpane.rs 116.6 KB 116.7 KB +78 B
docs/user-guide/assistant.md 37.3 KB 37.3 KB +20 B

@giswqs
giswqs enabled auto-merge November 29, 2026 23:33
@giswqs
giswqs added this pull request to the merge queue Nov 29, 2026
Merged via the queue into opengeos:main with commit 05b9a5d Nov 30, 2026
29 of 30 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants