Skip to content

Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS

address copilot review: Windows-safe basename, projector-exists guard, honest install toast

Adam Eivy844a3cf8c740
diff --git a/client/src/components/settings/LocalLlmTab.jsx b/client/src/components/settings/LocalLlmTab.jsx
index 0d14a65a1e..f7c17d5afb 100644
--- a/client/src/components/settings/LocalLlmTab.jsx
+++ b/client/src/components/settings/LocalLlmTab.jsx
@@ -181,7 +181,10 @@ export function LocalLlmTab() {
const selectedData = status?.[selected];
const installedModels = selectedData?.models || [];
- const install = (modelId) => runAction(`install-${modelId}`, () => installLocalLlmModel(selected, modelId), `${modelId} installed`);
+ // LM Studio's REST fallback returns { pending: true } — the download was only
+ // queued, not finished — so don't claim "installed" in that case.
+ const install = (modelId) => runAction(`install-${modelId}`, () => installLocalLlmModel(selected, modelId),
+ (r) => r?.pending ? `${modelId} download started` : `${modelId} installed`);
const remove = (modelId) => runAction(`delete-${modelId}`, () => deleteLocalLlmModel(selected, modelId), `${modelId} deleted`);
return (
diff --git a/server/services/lmStudioManager.js b/server/services/lmStudioManager.js
index b31dbee8b8..1125cc426d 100644
--- a/server/services/lmStudioManager.js
+++ b/server/services/lmStudioManager.js
@@ -6,7 +6,7 @@
*/
import { homedir } from 'os'
-import { join } from 'path'
+import { join, basename } from 'path'
import { readdir, stat, mkdir, copyFile } from 'fs/promises'
import { cosEvents } from './cosEvents.js'
import { fetchWithTimeout } from '../lib/fetchWithTimeout.js'
@@ -494,11 +494,11 @@ async function importModelFromGguf({ lmstudioId, ggufPath, projectorPath }) {
const destDir = join(modelsDir, publisher, repo)
const r = await mkdir(destDir, { recursive: true })
.then(async () => {
- const base = ggufPath.split('/').pop()
+ const base = basename(ggufPath)
const destName = /\.gguf$/i.test(base) ? base : `${repo}.gguf`
await copyFile(ggufPath, join(destDir, destName))
if (projectorPath) {
- const projBase = projectorPath.split('/').pop()
+ const projBase = basename(projectorPath)
await copyFile(projectorPath, join(destDir, /\.gguf$/i.test(projBase) ? projBase : `${repo}-mmproj.gguf`))
}
})
diff --git a/server/services/ollamaManager.js b/server/services/ollamaManager.js
index cdef804259..7a05a70f00 100644
--- a/server/services/ollamaManager.js
+++ b/server/services/ollamaManager.js
@@ -267,12 +267,12 @@ async function resolveLocalModel(modelId) {
if (!modelDigest) return null
const ggufPath = join(modelsDir, 'blobs', digestToBlobFilename(modelDigest))
if (!(await fileExists(ggufPath))) return null
- return {
- ggufPath,
- projectorPath: projectorDigest ? join(modelsDir, 'blobs', digestToBlobFilename(projectorDigest)) : null,
- isMlx: false,
- isSharded: false
- }
+ // Only report a projector the manifest references AND that's actually on disk
+ // — a missing/corrupt projector blob shouldn't flag the model multimodal (and
+ // block the fast path) or fail an LM Studio copy mid-way.
+ let projectorPath = projectorDigest ? join(modelsDir, 'blobs', digestToBlobFilename(projectorDigest)) : null
+ if (projectorPath && !(await fileExists(projectorPath))) projectorPath = null
+ return { ggufPath, projectorPath, isMlx: false, isSharded: false }
}
/**