aboutsummaryrefslogtreecommitdiff
path: root/modules/core/ollama-manager.js
Commit message (Collapse)AuthorAgeFilesLines
* fix(newos4): connect to Ollama on first use, honest write_file, list_files ↵Agando2026-10-271-6/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | sees /sys Three defects, each re-probed first and covered by a test that is red on HEAD. - ollama-manager.js: nothing connects at boot; only the Ollama tab button called connect(), so a user's first message died with "Ollama not connected. Use ollamaconnect first." even when the endpoint was healthy. New _ensureConnected() runs from chat(), chatStream() and chatWithTools(): one attempt, shared by concurrent callers, a "Connecting…" hint, and only then the error — which now says the endpoint is unreachable instead of telling the user to run a command they already expected to work. - module-aiassist.js write_file tool: fs.writeFile()'s false return was dropped and the tool answered "File written: …" anyway, sending the model on to a read that found nothing (MAINT-012). It now returns "Write FAILED: … — parent directory missing or target is a directory; nothing was written". - module-aiassist.js list_files tool: the hand-rolled walk over root.content never resolved the virtual mounts, so /sys — a directory the UI and `ls` both show — answered "Directory not found" (MAINT-011). It now uses fs.readDir(), which resolves mounts and returns null for a genuinely missing path. Tests: modules/test/test-ai-fs-tools.js (7 asserts) and modules/test/test-ollama-autoconnect.js (11 asserts). RED on HEAD: ai tools 4 passed/3 FAILED (/sys → "Directory not found", write_file → "File written: …"), ollama 2 passed/9 FAILED ("Use ollamaconnect first"). GREEN now 7/7 and 11/11; maintain --fix reports "node tests 9/9 pass". Live on v4.6.105: connectedBefore=false, _ensureConnected()=true in 41 ms, 37 models.
* auto: 2026-07-09_06:00 changesAgando2026-07-091-1/+1
|
* auto: 2026-06-24_06:01 changesAgando2026-06-241-3/+140
|
* auto: 2026-06-18_06:00 changesAgando2026-06-181-1/+16
|
* auto: 2026-06-17_06:01 changesAgando2026-06-171-3/+38
|
* auto: 2026-06-10_06:00 changesAgando2026-06-101-2/+2
|
* auto: 2026-06-01_06:00 changesAgando2026-06-011-4/+68
|
* auto: 2026-05-31_06:00 changesAgando2026-05-311-107/+146
|
* auto: 2026-05-30_06:00 changesAgando2026-05-301-0/+22
|
* auto: 2026-05-29_18:01 changesAgando2026-05-291-0/+25
|
* auto: 2026-05-29_06:01 changesAgando2026-05-291-2/+81
|
* auto: 2026-05-25_18:02 changesAgando2026-05-251-0/+842