Repository navigation
Aegis v0.2.9 (macOS): LLM gateway crashes on startup (import_meta.url undefined), plus external-endpoint/VLM bugs #215
Description
Environment: SharpAI-Aegis v0.2.9 (Electron 40.2.1), macOS (Darwin 25.5.0). LLM and VLM both set to "OpenAI Compatible" pointing at a local Ollama (http://127.0.0.1:11434/v1, VLM qwen2.5vl:7b, LLM gemma4:e4b).
The LLM settings screen says "Connected", but the agent chat fails and clip analysis never works. I traced it through the app and found five separate problems (details and line numbers are from the unpacked app.asar).
1. LLM gateway crashes at startup, so port 5407 never opens (main blocker)
Startup log:
[TRACE] LLM Gateway failed to start: The argument 'filename' must be a file URL object, file URL string, or absolute path string. Received undefined
[LLM IPC] Gateway reload failed (may not be running): request to http://localhost:5407/api/config/reload failed
dist_electron_main/gateway.cjs ~line 2017: var import_meta = {}; followed by createRequire(import_meta.url). In the CJS bundle import_meta.url is undefined, so loading throws. Every agent/LLM call then fails with fetch failed.
Also: line ~2083 does esmRequire("../../../electron/config/cloud-providers.cjs"), and that file is not in the packaged build, so chat requests fail with Cannot find module once the first crash is patched.
2. LLM settings screen doesn't switch the active engine
Selecting "OpenAI Compatible" only writes ~/.aegis-ai/llm-config.json. ~/.aegis-ai/config/active-inference.json stayed on {"engineId": "llama-cpp", "port": 5411} and config/agent_config.json stayed on "llm": {"mode": "builtin"}, so the app still thinks the built-in server is the LLM.
3. VLM health checks ignore the external endpoint
video_analyze(and the background trigger insidevideo_search) probehttp://localhost:<vlm_server port 5405>/healtheven whenvlm.mode === "external". Nothing listens there, so the agent says "VLM unavailable" although the external VLM works.- The VLM monitor requests
<externalEndpoint>/health, which Ollama answers with 404 (it has no/health), so the VLM can look offline./v1/modelswould be a more portable check.
4. video_analyze / background analysis pass a null thumbnail
main.cjs ~30553: deepAnalyze(clipId, null, camera || "unknown", 0), and ~30396: bgAnalyze(clip.id, null, ...). analyzeClip then runs fs.existsSync(thumbnailPath) on null and returns Thumbnail not found: null, so these tool paths never reach the VLM. (The motion-event paths pass a real thumbnailPath and look fine.) After this the chat model tells the user the VLM is unavailable, which is misleading.
5. Thinking models return empty replies
With Gemma (thinking) models via Ollama, requests use max_tokens ~512, the model spends it on reasoning, and the reply has an empty content (reasoning is in a separate reasoning field):
[Agent] SSE stream ended with finish_reason=length — response was truncated (hit max_tokens limit)
[Agent] LLM response - has tool_calls: false, content length: 0
The user sees "I'm still warming up — try asking again in a moment." Sending reasoning_effort: "none" for local endpoints made replies reliable here (usable replies went from 2/4 to 5/5 in my test); raising the token limit or reading the reasoning field would also help.
Workarounds used
Ran a patched copy of the gateway outside the app (fix for #1 plus reasoning_effort: "none" for #5) and a tiny stub answering GET /health on 5405 (for #3).
Happy to test fixes.
Activity
solderzzc commentedon Oct 4, 2026
Hi,
Thanks for the detailed report.
The gateway crash (createRequire / import.meta.url) is fixed in later builds; v0.2.9 is the only public build that still has it. Could you try 0.2.15?
https://releases.sharpai.org/releases/SharpAI-Aegis-0.2.15-arm64.dmg
Notes:
Please tell us what you see on 0.2.15. We won't give a date for the next release yet.
viri2005 commentedon Oct 14, 2026
Hi,
I have the same issue with version 0.2.9 under window11. local VLM is working but local LLM chat is broken. Local OpenAI Endpoint is working properly.
Maybe I should also try 0.2.15. Do you have a release of 0.2.15 for windows ?
solderzzc commentedon Oct 14, 2026
@viri2005 , thanks for your feedback, we are preparing 0.3.0, we wrote engines with Rust and many other changes are on going.
Let me check how to replicate the issue on a Windows machine then prepare an 0.2.15 release.
viri2005 commentedon Oct 24, 2026
@solderzzc , thanks for your answer. Do you have some update on version 0.2.15 for windows 11?
solderzzc commentedon Oct 25, 2026
Thanks for following up. The Windows build of version 0.2.15 is now uploaded. It is the code-signed installer (publisher: SharpAI LLC). So far we have only smoke-tested it on Windows 11 (the app launches and its bundled daemon starts). We have not verified every feature, so your feedback on Windows 11 is very helpful.
We are now preparing 0.3.x. If you run into any problem with 0.2.15 on Windows 11, please tell us here and we will follow up quickly.
solderzzc commentedon Oct 25, 2026
Download link for the Windows 0.2.15 installer (code-signed, publisher SharpAI LLC):
https://releases.sharpai.org/releases/SharpAI-Aegis-Setup-0.2.15-win-x64.exe
viri2005 commentedon Oct 25, 2026
@solderzzc : thank you a lot for the link. I installed 0.2.15 under windows11.
2 problems come up at start-up of 0.2.15 when LLM, VLM and camera have to be configured:
1 - The issue with the LLM remains: Local LLM is connected, but the set-up in the "Hi I'm Aegis" start page is not done. Local OpenAI Endpoint is working properly, runs under llama-server.exe of llama.cpp. Local VLM is working and runs also under llama-server.exe of llama.cpp.
2 - Now i lost the camera and it is not possible to connect it as it was under version 0.2.9. I get the following error with 0.2.15:
"
Error
Failed to add camera: Error invoking remote method 'live-cameras:add': Error: Could not locate the bindings file. Tried: → C:\SharpAI-Aegis\resources\app.asar\node_modules\better-sqlite3\build\better_sqlite3.node → C:\SharpAI-Aegis\resources\app.asar\node_modules\better-sqlite3\build\Debug\better_sqlite3.node → C:\SharpAI-Aegis\resources\app.asar\node_modules\better-sqlite3\build\Release\better_sqlite3.node → C:\SharpAI-Aegis\resources\app.asar\node_modules\better-sqlite3\out\Debug\better_sqlite3.node → C:\SharpAI-Aegis\resources\app.asar\node_modules\better-sqlite3\Debug\better_sqlite3.node → C:\SharpAI-Aegis\resources\app.asar\node_modules\better-sqlite3\out\Release\better_sqlite3.node → C:\SharpAI-Aegis\resources\app.asar\node_modules\better-sqlite3\Release\better_sqlite3.node → C:\SharpAI-Aegis\resources\app.asar\node_modules\better-sqlite3\build\default\better_sqlite3.node → C:\SharpAI-Aegis\resources\app.asar\node_modules\better-sqlite3\compiled\24.11.1\win32\x64\better_sqlite3.node → C:\SharpAI-Aegis\resources\app.asar\node_modules\better-sqlite3\addon-build\release\install-root\better_sqlite3.node → C:\SharpAI-Aegis\resources\app.asar\node_modules\better-sqlite3\addon-build\debug\install-root\better_sqlite3.node → C:\SharpAI-Aegis\resources\app.asar\node_modules\better-sqlite3\addon-build\default\install-root\better_sqlite3.node → C:\SharpAI-Aegis\resources\app.asar\node_modules\better-sqlite3\lib\binding\node-v143-win32-x64\better_sqlite3.node
"
I hope you can use my feedback to solve the issues.
solderzzc commentedon Oct 25, 2026
Hi @viri2005, thanks for the detailed report and the logs. Both problems you hit on 0.2.15 are addressed in 0.2.16, which is now published for Windows (code-signed, publisher SharpAI LLC):
https://releases.sharpai.org/releases/SharpAI-Aegis-Setup-0.2.16-win-x64.exe
Camera add ("Could not locate the bindings file"): the 0.2.16 build now checks that the packaged app contains a Windows better-sqlite3 binding before anything is uploaded. In our isolated test of the packaged app, adding a camera succeeds.
Start page LLM setup not complete with a local llama-server endpoint: a local OpenAI-compatible endpoint that needs no API key is now checked for a model list, and the setup check counts it as configured when it answers. In our isolated test the start page showed 1 of 3 complete while the endpoint was running.
We have not run this on your machine, so your feedback is what matters. Could you install 0.2.16 over 0.2.15 and tell us:
If something is still wrong, please paste the exact error text here.
viri2005 commentedon Oct 26, 2026
Hi @solderzzc, thanks a lot for the version 0.2.16. It really helped solve almost all issues:
1 - Now i can add camera
2 - Now i can set up the LLM
3 - I can set up the VLM as it was working.
I tested it during 2 hours and it worked pretty well: When I go to the AI area, I can now chat with the user assistance Aegis.
Remaining issue: One thing that is still not working (it wasn't too with 0.2.9 and 0.2.15) is when I get into a video which was analysed by the VLM and I "Ask follow-up questions" then I get a "fetch error". That means that the chat in the video area is broken.
Tell me if you need some more input on the remaining issue.
solderzzc commentedon Oct 27, 2026
Thanks for the detailed report and for testing for two hours, @viri2005. Glad 0.2.16 got you most of the way.
We reproduced the remaining problem. In 0.2.9, 0.2.15 and 0.2.16, "Ask follow-up questions" on a video always sent the question to the local llama-server on port 5405, whatever VLM you had configured. Analysis follows your VLM settings, so it worked, but the follow-up chat failed with "fetch failed" whenever the VLM was an external endpoint, a cloud provider, or on another port.
0.2.17 fixes this: the video chat now uses the VLM you configured, and if the server cannot be reached it tells you which address failed instead of a bare fetch error.
Downloads (0.2.17):
On Linux, auto-update to 0.2.17 will be switched on shortly; the direct downloads work now.
We tested the fix end to end against the media server with an external OpenAI-compatible endpoint, a local server and a cloud provider without a thumbnail, but not on your exact setup. If it still fails for you, please tell us which VLM provider you use (external endpoint, cloud, or local) and the exact error text shown in the chat, and we will follow up.
viri2005 commentedon Oct 27, 2026
Thanks @solderzzc for the above windows version of v0.2.17 . It is NOT working at all neither if I update nor if I install it fresh after having deinstalled v0.2.16.
I get the following error after installation or update when I start it:
Hint: The installation file of v0.2.17 for windows is much smaller than the installation file for v0.2.16 ... maybe some packages are missing in the build of v0.2.17.
solderzzc commentedon Oct 28, 2026
0.2.18 is published for Windows and checked locally: https://releases.sharpai.org/download/windows
If you still see a problem on 0.2.18, reply here with the exact error text and your provider type.
viri2005 commentedon Oct 28, 2026
@solderzzc : v0.2.18 for windows has some new bugs:
*Bug Nr.1:
it is not possible to connect local VLM . local VLM is running with llama-server from llama.cpp and working. VLM Model is LFM2.5-VL-1.6B-F16.gguf.
when i set it up, it seems to work first:
but after 2 seconds it is not connected anymore, it means that "VLM switched to openai-compatible endpoint " disappears automatically:
*Bug Nr.2:
if I select "Settings -> AI Engine" it goes to "Settings -> Account"
What works in v0.2.18 for windows:
3 - local LLM is working with llama-server from llama.cpp
4 - Camera is working
What i can not test in v0.2.18 for windows:
5 - if the chat within a video analysed by VLM is working or not.
solderzzc commentedon Oct 28, 2026
Sorry about the back and forth. Our main effort is on a big rewriting of the core. Convert most of them into Rust.
We will still run agent to resolve the issues, thanks for your patience and participation.
solderzzc commentedon Oct 29, 2026
0.2.19 is published for Windows: https://releases.sharpai.org/releases/SharpAI-Aegis-Setup-0.2.19-win-x64.exe
It changes the two things you reported on 0.2.18: saving a local VLM endpoint under Settings -> VLM -> API Providers -> OpenAI Compatible, and the Settings -> AI Engine entry (with Power User Mode on). I checked both in the packaged build against a stand-in server, not your llama-server and model.
If you still see a problem on 0.2.19, reply here with the exact error text and your provider type.
solderzzc commentedon Oct 29, 2026
Update: I also tested 0.2.19 against a real llama-server (the llama-server.exe shipped in the package) running LFM2.5-VL-450M. In Settings -> VLM -> API Providers -> OpenAI Compatible, Load Models listed the model, Select saved it, and a chat went to that server and got a reply. Settings -> AI Engine opened AI Engine.
That was the 450M model, not your 1.6B-F16.