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

self-review: keep the Ollama env latch null when nothing is recorded, and name only the subcommand in lms errors

[._.]/ Adam Eivy9c60984f7e28
diff --git a/server/services/lmStudioManager.js b/server/services/lmStudioManager.js
index 0e91b43668..706b985b67 100644
--- a/server/services/lmStudioManager.js
+++ b/server/services/lmStudioManager.js
@@ -569,10 +569,14 @@ async function runLms(args, { timeoutMs }) {
if (!binary) {
return {
success: false,
- error: "LM Studio's \`lms\` CLI is not on PortOS's PATH. Open LM Studio once and run \`lms bootstrap\`, or use the app's Developer tab."
+ error: "LM Studio's `lms` CLI is not on PortOS's PATH. Open LM Studio once and run `lms bootstrap`, or use the app's Developer tab."
}
}
- const label = `\`lms ${args.filter((a) => !a.startsWith('-')).join(' ')}\``
+ // Name the SUBCOMMAND in the error, not the whole argv — a flag's value
+ // ("8192") is not a flag and would otherwise land in the message as if it were
+ // part of the command the user should run.
+ const flagAt = args.findIndex((a) => a.startsWith('-'))
+ const label = `\`lms ${args.slice(0, flagAt === -1 ? args.length : flagAt).join(' ')}\``
const result = await bufferedSpawn(binary, args, { timeoutMs, shell: false })
resetCache()
if (result.timedOut) return { success: false, error: `${label} timed out after ${Math.round(timeoutMs / 1000)}s` }
diff --git a/server/services/ollamaManager.js b/server/services/ollamaManager.js
index 7cad9dcdb1..abd9c59200 100644
--- a/server/services/ollamaManager.js
+++ b/server/services/ollamaManager.js
@@ -140,7 +140,10 @@ const envSignature = (env) => Object.entries(env || {})
* describe two different daemons.
*/
function rememberAppliedEnv(env, identity) {
- appliedLaunchEnv = envSignature(env)
+ // `null` (nothing recorded), never `''` — the latch below tests
+ // `appliedLaunchEnv !== null` to mean "we know what this daemon holds", and an
+ // empty-string stand-in for "unknown" would claim knowledge we do not have.
+ appliedLaunchEnv = env ? envSignature(env) : null
// A restart that named no window leaves Ollama on its VRAM-based auto-pick,
// which is not a window PortOS can claim — so the context latch is cleared
// rather than crediting the new process with the old one's window.