feat(m2): LLM chat via Ollama — streaming responses with migration context #3

Open
pyr0ball wants to merge 6 commits from feat/m2-llm-chat into feat/m1-system-presence

6 commits

Author SHA1 Message Date
cba4175260 feat(m2): wire ChatPanel to stream LLM responses — thinking state, token accumulation, error display 2026-05-19 07:28:04 -07:00
0e3bfd24f1 feat(m2): register llm module and chat command in lib.rs 2026-05-19 07:26:31 -07:00
9175b7a247 feat(m2): add chat Tauri command — spawns Ollama stream, emits chat-token/done/error 2026-05-19 07:25:34 -07:00
369216b354 fix(m2): log emit errors, use Vec<u8> buffer for UTF-8 safety, improve error context
- Replace `let _ = app.emit(...)` with logged warnings so dropped chat-done/chat-token events surface in logs instead of silently hanging the frontend
- Switch streaming buffer from String to Vec<u8> so multi-byte UTF-8 sequences split across TCP chunks are accumulated correctly before converting to str
- Use `.context("stream read error")` (anyhow) instead of manual anyhow::anyhow! for the chunk read error path
- Rename test parse_empty_token_is_handled -> parse_empty_content_chunk_deserializes (more precise)
- Add malformed_json_fails_to_parse test
2026-05-19 07:24:23 -07:00
c149c598ae feat(m2): add llm module — build_system_prompt and Ollama streaming client 2026-05-19 07:21:27 -07:00
9c45015052 chore(m2): add reqwest to Cargo dependencies 2026-05-19 07:19:37 -07:00