Repository navigation
fix(desktop): send chat, model lists, and voice management through the Tauri HTTP plugin - #333
Merged
Merged
Conversation
…e Tauri HTTP plugin Finishes what #317 started: direct chat streaming and JSON calls, model discovery and its vision probes, ElevenLabs, and OmniVoice voice management now use providerFetch, so a provider's CORS policy no longer decides whether it works on desktop. Fish Audio reuses the helper.
…Ollama works The HTTP plugin stamps the webview origin on every request, and on Windows that is http://tauri.localhost, which Ollama's default allowlist rejects. providerFetch now sends an empty Origin, which the plugin drops when its unsafe-headers feature is on. Connection hints skip origin and CORS advice on desktop, and the docs no longer tell desktop users to set OLLAMA_ORIGINS.
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.
Fixes #311. Replaces #312, whose local-speech half already landed in #317.
What changed
On desktop, every direct provider call now goes through
providerFetch(the Tauri HTTP plugin, which runs in Rust), so a provider's CORS policy no longer decides whether it works:llm/transport.ts: direct chat streaming andcompleteJsonproviders/client-models.ts: every model list plus the vision probestts/elevenlabs.ts,tts/omnivoice-client.ts(health, clone list, clone upload, synthesize, delete)tts/fish-audio.tsreuses the helper instead of its own plugin importDesktop requests also drop the
Originheader (withoutOrigin, pluginunsafe-headersfeature). The plugin stamped the webview origin on every request, and on Windows that ishttp://tauri.localhost, which a default Ollama install rejects with 403. Connection hints skip origin/CORS advice on desktop (browserOrigin()replaces three copies ofgetCurrentSiteOrigin). Docs:local-llm-setup.mdandtroubleshooting.mdno longer tell desktop users to setOLLAMA_ORIGINS;SECURITY.mdcovers the plugin path andunsafe-headers;architecture.mdnamesproviderFetch.Web is unchanged:
providerFetchis the browser'sfetchthere.Verification
pnpm test1320/1320 (new:withoutOrigin, desktop hints without origin advice; both watched failing first).pnpm checkclean.A throwaway probe page (branch
test/phttp-desktop-probe, not part of this PR) runs the real app functions inside the desktop webview against a mock provider with no CORS headers and 404 preflights, plus real providers.macOS before/after (
tauri dev): main fails 10 of 16 mock checks (model lists, streaming chat, Stop, in-stream errors, 401 body,completeJson, ElevenLabs, OmniVoice) and LM Studio; this branch passes 29/29:AbortErrorand the server sees the close after 0.4 s, real error messages, STT multipart, local TTS, OmniVoice clone upload, raw UTF-8 response header, public-host TLSOriginheaderWindows (WebView2), Ubuntu 22.04 and 24.04 (WebKitGTK), CI debug builds: all 21 checks pass on each, including a real Ollama install. Windows Ollama with default settings fails on main and works here.
Small local models sometimes skip a tool call. Measured directly against Ollama with no app involved: qwen2.5:0.5b returns an empty answer in 35% (Ubuntu 22.04), 45% (24.04), 65% (Windows), 35% (macOS) of 20 calls; 1.5b in 25%. Main and this branch miss at the same rate over 20 app-level runs, so the probe allows up to 5 attempts.
Installers from a release dry run of this branch (run 42389528199):
.debinstalled and AppImage run, both still running after 30 s.dmg(x86_64 + arm64): launched from the mounted image, still running after 25 sNot covered with real keys: OpenAI, Anthropic, Google, Together, ElevenLabs, Fish Audio. They share the same code path as the DeepSeek and mock checks; the Anthropic request/response path was checked with an invalid key (real
invalid x-api-keybody comes back).