fix(local-ai): fix false-negative Ollama diagnostics (binary + model detection)#1327
Conversation
…odels - Add /Applications/Ollama.app/Contents/Resources/ollama and ~/Applications/... to find_system_ollama_binary() so macOS drag-install is detected correctly - Unify resolve_binary_path() with bootstrap's broader detection: now checks OLLAMA_BIN env and all workspace binary candidates, not just a single path - Honor OLLAMA_HOST env var as fallback in ollama_base_url() (priority: OPENHUMAN_OLLAMA_BASE_URL > OLLAMA_HOST > default localhost:11434) - Include ollama_base_url and repair_actions in diagnostics JSON so the UI can show which endpoint is checked and surface one-click fixes - Update LocalAiDiagnostics TS interface with new fields - Show "Running via external process" instead of "Not found" when binary path is unknown but server is reachable - Render fine-grained repair action buttons (install / start / pull model) in ModelStatusSection diagnostics panel - Add 20+ Rust unit tests and 13 Vitest tests covering all changed paths Closes tinyhumansai#1293
|
ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (7)
📝 WalkthroughWalkthroughThis PR adds intelligent repair actions to local AI diagnostics. The backend now detects Ollama configuration via environment variables ( ChangesOllama Diagnostics with Repair Actions
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Comment |
Summary
/Applications/Ollama.app/Contents/Resources/ollama)resolve_binary_pathwith bootstrap's broader detection (addsOLLAMA_BINenv + all workspace candidates)OLLAMA_HOSTenv var as URL fallback inollama_base_url()so health checks hit the correct endpointollama_base_url+repair_actionsfor actionable one-click fixes in the UIProblem
.appbundle was never found byfind_system_ollama_binary()— it only checked/usr/local/binand/opt/homebrew/bin, not the standard/Applications/Ollama.app/Contents/Resources/ollamapath.OLLAMA_HOSTwas set (Ollama's own env var), health checks hit the wrong port and reported the server as down, cascading into all models showing as missing.Solution
find_system_ollama_binary()ininstall.rs.resolve_binary_path()to mirror bootstrap's priority order: configured path →OLLAMA_BIN→ workspace candidates → PATH scan → platform paths.OLLAMA_HOSTfallback inollama_base_url()with scheme normalization.diagnostics()to always emitollama_base_urland arepair_actionsarray (install_ollama/start_server/pull_modelper missing model).LocalAiDiagnosticsTS interface andModelStatusSection.tsxto surface these fields.Submission Checklist
docs/TESTING-STRATEGY.mdcargo testandpnpm test:unitpass locally.Closes #1293in Related section.Impact
Related
Closes #1293
ollama pullinvocation via bootstrap pipeline.AI Authored PR Metadata (required for Codex/Linear PRs)
Linear Issue
Commit & Branch
Validation Run
pnpm --filter openhuman-app format:checkpnpm typecheckpnpm debug unit local-model(13 passed),cargo test --lib local_ai(181 passed)Validation Blocked
Behavior Changes
Parity Contract
OPENHUMAN_OLLAMA_BASE_URLstill takes priority overOLLAMA_HOSTand the default.Duplicate / Superseded PR Handling
Summary by CodeRabbit
New Features
Tests