Add non-blocking operations design principle to summary

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-10 19:21:18 -05:00
parent f4c7deba66
commit e0e1294627
+7 -2
View File
@@ -63,8 +63,13 @@ for AI-assisted features.
- **Context building server-side:** Backend fetches URL content and searches notes —
frontend just sends the message text + optional note ID. Keyword extraction uses
simple word splitting with stopword filtering (no embeddings).
- **Auto-pull model on startup:** Non-blocking, logs warning on failure so the app
still starts even if Ollama isn't ready.
- **No blocking long-running operations:** Any potentially slow operation (model
pulls, LLM calls, URL fetching, etc.) must never block app startup or freeze the
UI. Backend uses `asyncio.create_task()` for fire-and-forget work and SSE streaming
for incremental responses. Frontend keeps the UI responsive during async operations
(loading states, streaming indicators). This applies to all future features as well.
- **Auto-pull model on startup:** Non-blocking background task, logs warning on
failure so the app still starts even if Ollama isn't ready.
- **Backlinks:** `GET /api/notes/:id/backlinks` searches all note bodies for
`[[Title]]` patterns referencing the given note. Results include `type: "note"` or
`type: "task"` based on whether the linking note has `status IS NOT NULL`.