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.