Skip to content

Show Gemini's reasoning in the desktop app - #8

Closed
napo wants to merge 1 commit into
feature/document-extractionfrom
feature/desktop-streaming
Closed

napo wants to merge 1 commit into
feature/document-extractionfrom
feature/desktop-streaming

Conversation

@napo

@napo napo commented Oct 29, 2026

Copy link
Copy Markdown
Member

Summary

The desktop app now shows Gemini's reasoning while waiting, as the web version does.

  • Rust: new gemini_stream command. It posts the streamed interaction to the same fixed endpoint, reads the key from the keychain as gemini_request does, and passes the server-sent events to the web view line by line through a Tauri Channel. A lone "\n" marks the end. There is no total timeout, only a 90 s read timeout, which matches the idle limit of the web view. The key, URL and body still never reach the web view or error strings.
  • Lines are cut at newline bytes, so a chunk that splits an accented letter still decodes (Rust test).
  • TypeScript: the SSE parsing moves to serverSentEventParser in src/llm/gemini.ts. Both transports feed it, so the bare JSON error Google sends under load is handled the same way on desktop. tauriGeminiTransport.stream() makes the provider stream with reasoning summaries on desktop too.
  • Guide updated: reasoning on web and desktop, usually in English; local models keep the elapsed time.

Based on feature/document-extraction (#6). Merge it after #5 and #6.

Verification

  • npm test: 136 passed, including the new desktop transport tests (events in order, non-2xx answer, an error event cancels the request, abort, Rust errors). cargo test passed, cargo clippy is clean, and the assistant, guide, export, knowledge and local model smoke scripts passed.
  • Not run in the desktop app against the real API: that needs a display and a key with quota left. Check it once in npm run tauri dev.

License: AGPL-3.0-or-later.

🤖 Generated with Claude Code

- New Rust command gemini_stream: posts the streamed interaction to the
  same fixed endpoint, with the key read from the keychain as before, and
  passes the server-sent events to the web view line by line through a
  Tauri channel; a lone "\n" marks the end. No total timeout: a read
  timeout of 90 s, like the idle limit of the web view.
- Lines are cut at newline bytes, so a network chunk that splits an
  accented letter still decodes (Rust test).
- The SSE parsing moves to serverSentEventParser in gemini.ts, fed in
  pieces by both the browser and the desktop transports, so bare JSON
  errors under load are handled the same way.
- The desktop transport gains stream(); the provider therefore streams
  with reasoning summaries on desktop as well. Tests cover events, non-2xx
  answers, an error event that cancels the request, abort and Rust errors.
- Guide: reasoning on web and desktop, usually in English; local models
  keep the elapsed time and the 5 minute limit.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@napo
napo deleted the branch feature/document-extraction October 29, 2026 16:21
@napo napo closed this Oct 29, 2026
@napo
napo deleted the feature/desktop-streaming branch October 29, 2026 16:27
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.

1 participant