feat(core): add ollama lifecycle management for cron sync

Add src/core/ollama_mgmt.rs module that handles Ollama detection, startup,
and health checking. This enables cron-based sync to automatically start
Ollama when it's installed but not running, ensuring embeddings are always
available during unattended sync runs.

Integration points:
- sync handler (--lock mode): calls ensure_ollama() before embedding phase
- cron status: displays Ollama health (installed/running/not-installed)
- robot JSON: includes OllamaStatusBrief in cron status response

The module handles local vs remote Ollama URLs, IPv6, process detection
via lsof, and graceful startup with configurable wait timeouts.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
teernisse
2026-03-12 17:06:57 -04:00
parent 75469af514
commit 16bd33e8c0
4 changed files with 569 additions and 1 deletions

View File

@@ -9,6 +9,7 @@ pub mod file_history;
pub mod lock;
pub mod logging;
pub mod metrics;
pub mod ollama_mgmt;
pub mod path_resolver;
pub mod paths;
pub mod project;