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

fix: preserve Ollama status diagnostics (#6702)

[._.]/ Adam Eivyff22d7340e2a
diff --git a/server/services/localLlm.js b/server/services/localLlm.js
index 28095402e4..2a464f7e08 100644
--- a/server/services/localLlm.js
+++ b/server/services/localLlm.js
@@ -715,6 +715,8 @@ export async function getStatus() {
baseUrl: ollamaStatus.baseUrl,
modelCount: ollamaStatus.modelCount,
models: ollamaModels,
+ contextLength: ollamaStatus.contextLength,
+ modelsError: ollamaManager.getLastInstalledModelsError(),
// Best installed model for editorial review/editing, surfaced so the
// manuscript editor can suggest it (and warn against the embedding model).
recommendations: { editorial: recommendEditorialModel(ollamaModels, { measured: measuredOllama }) },
diff --git a/server/services/localLlm.test.js b/server/services/localLlm.test.js
index a327b8b64d..448c86865d 100644
--- a/server/services/localLlm.test.js
+++ b/server/services/localLlm.test.js
@@ -938,6 +938,46 @@ describe('localLlm', () => {
});
});
+ describe('getStatus Ollama diagnostics', () => {
+ it('preserves the manager context-window diagnostics', async () => {
+ const contextLength = { runtime: 32768, applied: 65536, agentMinimum: 65536 };
+ mocks.ollama.getStatus.mockResolvedValueOnce({
+ available: true,
+ baseUrl: 'x',
+ version: '0.5.7',
+ modelCount: 0,
+ models: [],
+ contextLength,
+ });
+
+ const status = await svc.getStatus();
+
+ expect(status.ollama.contextLength).toEqual(contextLength);
+ });
+
+ it('keeps a null runtime and separates a failed model read from an empty list', async () => {
+ mocks.ollama.getStatus.mockResolvedValueOnce({
+ available: true,
+ baseUrl: 'x',
+ version: '0.5.7',
+ modelCount: 0,
+ models: [],
+ contextLength: { runtime: null, applied: 65536, agentMinimum: 65536 },
+ });
+ mocks.ollama.getLastInstalledModelsError.mockReturnValueOnce('Ollama model list failed');
+
+ const failedStatus = await svc.getStatus();
+
+ expect(failedStatus.ollama.contextLength.runtime).toBeNull();
+ expect(failedStatus.ollama.models).toEqual([]);
+ expect(failedStatus.ollama.modelsError).toBe('Ollama model list failed');
+
+ const emptyStatus = await svc.getStatus();
+ expect(emptyStatus.ollama.models).toEqual([]);
+ expect(emptyStatus.ollama.modelsError).toBeNull();
+ });
+ });
+
describe('getStatus editorial recommendation with measured evidence', () => {
const installed = [
{ id: 'qwen3.6:35b', name: 'qwen3.6:35b', params: '35B' },