[🐞 BUG] AI Enhancements fail when provider defaults to streaming (stream flag omitted from request body)
Describe the bug
The AI Enhancements feature (transcription post-processing, Edit/Rewrite, Command mode) calls LLM providers via /chat/completions. Today the request body only sets "stream": true when streaming is enabled in the LLMClient.Config; when the caller wants non-streaming, the key is omitted entirely.
Some providers — notably Ollama and several self-hosted OpenAI-compatible endpoints — default stream to true when the key is absent. In that case the server returns SSE-encoded chunks, but the client takes the non-streaming code path and fails to parse the response as JSON. The enhancement silently fails (LLMError.invalidResponse), and the user sees no improved output.
Explicitly sending "stream": false in the body makes affected providers respect the caller's choice and the feature works.
To Reproduce
- Configure an Ollama provider in AI Setup (e.g.
http://localhost:11434/v1with a model likellama3). - Record a short dictation with Dictate set to
Defaultor a custom prompt (so AI Enhancement runs). - Observe that the enhancement step fails or returns no content;
DebugLoggershows SSE parsing errors /LLMError.invalidResponse.
Expected behavior
- When the app requests non-streaming, the request body should include
"stream": falseexplicitly so servers do not fall back to their streaming default. - Users should have a visible toggle in AI Enhancement settings to switch between streaming and non-streaming responses.
Relevant code (at main HEAD 6631dc0)
Sources/Fluid/Services/LLMClient.swift:224-227— only setsbody["stream"] = trueinsideif config.streaming;falseis never sent.Sources/Fluid/ContentView.swift:1651— transcription hardcodeslet enableStreaming = false, but the flag never reaches the wire.Sources/Fluid/Persistence/SettingsStore.swift:1253-1262—enableAIStreamingBool already exists but is only read by Command Mode (CommandModeService.swift:842) and has no UI surface.
Environment
- macOS Version: Tahoe 26.x
- App Version:
main(post-6631dc0) - Architecture: Apple Silicon
Additional context
The fix is two-part: send "stream" explicitly in every request, and expose the existing enableAIStreaming setting as a toggle in the AI Setup card so users whose provider defaults to streaming can force non-streaming (or vice versa). PR follows.
Hi, AI Enhancement, imo, does not really need streaming as it's usually very fast. So decided to turn it off by default to avoid issues with inputting word by word into the text field. It would cause other issues and there's a lot more that's needed to make sure it works smoothly.