From e0e12946274832ce473c0f029a00d7b7644adc47 Mon Sep 17 00:00:00 2001 From: Bryan Van Deusen Date: Tue, 10 Feb 2026 19:21:18 -0500 Subject: [PATCH] Add non-blocking operations design principle to summary Co-Authored-By: Claude Opus 4.6 --- summary.md | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/summary.md b/summary.md index d3f8d1e..b7b2042 100644 --- a/summary.md +++ b/summary.md @@ -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`.