Pull requests / #680

#680 Add persistent chat history, local model selection, and a Windows desktop client

closed · @0924haruto12 · 0 commentaires · Sur GitHub

BenchmarksSetup & installServer & APIModels & quantsSecurityDocumentationWindowsLinux

Description

## Problem and resulting behavior

The Chat page needs a durable way to reopen conversations and continue long chats without loading every saved transcript into the browser or sending it all to the model. This adds compressed, on-demand chat history, bounded conversation compaction and optional keyword recall. It also separates native Strata configurations from additional local models and provides an optional Windows desktop client for the same page.

## Changes

- Save gzip-compressed messages and chat state in SQLite, with a metadata-only catalog, paged message loading, incremental writes, revision checks and idempotent save receipts. Migrate browser history only after a checksummed backup and read-back verification; retain drafts and recover conflicting edits as separate chats. Support JSON/JSON.GZ import and export.
- Show token usage, summarize older text manually or near the context limit, preserve original messages on disk, and optionally retrieve up to four keyword-matched excerpts instead of loading whole past conversations into the prompt.
- Separate native presets from additional localhost OpenAI-compatible profiles. Keep native switching opt-in and manager-owned, refuse changes while busy, attempt restoration after a failed native start, and retain strict localhost/provider URL validation. Additional providers support streaming, cancellation and explicit backend release where supported.
- Add a Windows x64 WinForms/WebView2 client with backend startup/reuse, a tray control, a single window per project and shortcut installation. Authentication stays in the host and is restricted to the local origin; optional credentials come from a private file, environment or installed configuration. Native-only installations work without Ollama or a forced model preset.
- Add English README instructions and detailed history, model-selection and desktop documentation. Preserve the upstream engine and its current Host, Origin and API-authentication checks.

## Privacy and scope

The contribution contains source, synthetic tests and documentation. Actual API keys, machine-specific configurations, owner-specific remote deployment, chat databases/backups, downloaded models, executables and crash dumps are excluded. API-key authentication support remains available. Closing the desktop client leaves the model server running.

History is shared by clients of the same server; this does not add per-user accounts. Disk compression is lossless but summaries can omit details. Additional-provider token counts are estimates. The desktop wrapper does not claim an inference-speed improvement.

## Validation

Tested on Windows with Python 3.13.5 and Node 24.19.0:

- `python -m unittest discover -s serve -p 'test_*.py'`: 257 tests, successful with 7 optional tokenizer/jsonschema dependency skips.
- `python tools/test_start_models.py`: 13 tests passed.
- `node --test serve/web/test_context.cjs serve/web/test_history.cjs serve/web/test_disk_history.cjs serve/web/test_model_selectors.cjs serve/web/test_desktop_auth.cjs`: 31 tests passed.
- Windows x64 self-contained .NET 10 publish succeeded; compiled `Strata.exe --policy-test` exited successfully. Policy checks use synthetic credentials and temporary configurations.
- Direct production-handler regressions cover the upstream Host/Origin/authentication guards, provider admission cleanup after rejected native loads, and bounded draining of incomplete unauthenticated POST bodies.
- `git diff --check` and publication scans passed, including comparison against the local credential values without logging them.

These are fixture-based server/browser checks and a Windows build/policy check. A fresh model installation, GPU inference benchmark and Linux/macOS desktop execution were not part of this validation. Setup still supplies model weights and the Python environment; the Windows app also requires the WebView2 Runtime.

Sur le site

Liens install, modèles, releases.