YC (S26) | Open Computer History | Continuously record your company computer work, map your workflows, help you find work worth automating, and power your agents' context
Rust agentsagiaiai-memoryaudio-recordingcomputer-visionhermeshermes-agentllmlocal-ailocal-firstmachine-learningmcpmultimodalopenclawprivacyrewindscreen-recordingspeech-to-textycombinator
fix(chat): explain unsupported Ollama tools (#6624)
Ezra Elletted6c4a52499d1
diff --git a/apps/screenpipe-app-tauri/lib/chat/__tests__/provider-errors.test.ts b/apps/screenpipe-app-tauri/lib/chat/__tests__/provider-errors.test.tsindex d43d8ecc9..1fe7cb3ac 100644--- a/apps/screenpipe-app-tauri/lib/chat/__tests__/provider-errors.test.ts+++ b/apps/screenpipe-app-tauri/lib/chat/__tests__/provider-errors.test.ts@@ -84,6 +84,30 @@ describe("provider error copy", () => {expect(msg).toContain("ollama pull llama3.2");});+ it("maps native Ollama tool-capability errors to actionable, non-retryable copy", () => {+ const raw =+ 'Error: 400: {"message":"registry.ollama.ai/library/qwen2.5vl:3b does not support tools","type":"invalid_request_error","param":null,"code":null,"detail":"untrusted upstream suffix"}';++ const presentation = buildProviderErrorPresentation(raw, {+ provider: "native-ollama",+ model: "qwen2.5vl:3b",+ });++ expect(presentation).toEqual({+ kind: "provider",+ message:+ 'Ollama model "qwen2.5vl:3b" does not support tools. Switch your AI preset to an Ollama model that supports tools.',+ retryable: false,+ });+ expect(presentation?.message).not.toContain("untrusted upstream suffix");+ expect(+ buildProviderErrorPresentation(raw, {+ provider: "custom",+ model: "qwen2.5vl:3b",+ }),+ ).toBeNull();+ });+it("maps screenpipe cloud connection errors to a transient-outage message", () => {const msg = buildProviderErrorMessage("Connection error.", {provider: "screenpipe-cloud",diff --git a/apps/screenpipe-app-tauri/lib/chat/provider-errors.ts b/apps/screenpipe-app-tauri/lib/chat/provider-errors.tsindex b2f1d0bf3..dbbe6d8c6 100644--- a/apps/screenpipe-app-tauri/lib/chat/provider-errors.ts+++ b/apps/screenpipe-app-tauri/lib/chat/provider-errors.ts@@ -371,7 +371,21 @@ export function buildProviderErrorPresentation(}const message = buildGenericProviderErrorMessage(errorStr, preset);- return message ? { kind: "provider", message, retryable: true } : null;+ if (message) return { kind: "provider", message, retryable: true };++ if (+ isNativeOllamaProvider(preset?.provider) &&+ errorStr.toLowerCase().includes("does not support tools")+ ) {+ const model = preset?.model?.trim() || "the selected model";+ return {+ kind: "provider",+ message: `Ollama model "${model}" does not support tools. Switch your AI preset to an Ollama model that supports tools.`,+ retryable: false,+ };+ }++ return null;}export function buildProviderErrorMessage(