Skip to content

The all-in-one local AI studio for your desktop: chat, image and video generation and a coding agent in one free, open source app. Windows and Linux. No Docker, no terminal, no cloud required.

fix(agent): auch der Werkzeugweg nennt Ollama beim Namen

purple6aafa6c97b87
diff --git a/src/api/__tests__/fremde-lokale-server-heissen-beim-namen.test.ts b/src/api/__tests__/fremde-lokale-server-heissen-beim-namen.test.ts
index acda52c0..381d0944 100644
--- a/src/api/__tests__/fremde-lokale-server-heissen-beim-namen.test.ts
+++ b/src/api/__tests__/fremde-lokale-server-heissen-beim-namen.test.ts
@@ -85,6 +85,20 @@ describe('ein fremder lokaler Server, der nicht laeuft', () => {
})
})
+describe('der Agentenweg redet dieselbe Sprache', () => {
+ it('nennt Ollama beim Namen, statt HTTP 503 mit Rust-Zeile zu werfen', async () => {
+ stream.mockResolvedValue(abgelehnt('http://127.0.0.1:11434/api/chat'))
+ const { streamOllamaChatWithTools } = await import('../../lib/ollama-stream-tools')
+ const e = await streamOllamaChatWithTools(
+ 'llama3', [], [], {}, () => {}, () => {},
+ ).then(() => null, (x: unknown) => x as Error)
+ expect(e).toBeInstanceOf(Error)
+ expect(e!.message).toContain('Ollama')
+ expect(e!.message).toContain('127.0.0.1:11434')
+ expect(e!.message).not.toContain('proxy_localhost_stream_chunked')
+ })
+})
+
describe('was NICHT uebersetzt werden darf', () => {
it('ein echter Serverfehler behaelt die Worte des Servers', async () => {
stream.mockResolvedValue(new Response(
diff --git a/src/lib/ollama-stream-tools.ts b/src/lib/ollama-stream-tools.ts
index 4fa29c36..f5ae171f 100644
--- a/src/lib/ollama-stream-tools.ts
+++ b/src/lib/ollama-stream-tools.ts
@@ -1,5 +1,6 @@
import type { ChatMessage, ToolCall, ToolDefinition } from '../api/providers/types'
import { ollamaUrl, localFetchStream } from '../api/backend'
+import { isLocalTransportFailure, localBackendUnreachableMessage } from './local-backend-transport'
import { repairToolCallArgs } from './tool-call-repair'
import { applyTemplateContract } from '../api/providers/normalize-system'
import { parseOllamaChatChunk, type OllamaWireToolCall } from '../api/providers/wire'
@@ -119,7 +120,13 @@ export async function streamOllamaChatWithTools(
if (!response.ok) {
const text = await response.text()
- const err: HttpStatusError = Object.assign(new Error(`HTTP ${response.status}: ${text}`), {
+ // Ollama laeuft nicht: der Proxy gibt seine eigene Zeile zurueck, mit dem
+ // Rust-Befehlsnamen darin. Die gehoert in kein Fenster, auch nicht in das
+ // eines Agentenlaufs (04.09.2026, dieselbe Runde wie proxy.rs).
+ const nachricht = isLocalTransportFailure(text, url)
+ ? localBackendUnreachableMessage('Ollama', url)
+ : `HTTP ${response.status}: ${text}`
+ const err: HttpStatusError = Object.assign(new Error(nachricht), {
statusCode: response.status,
})
throw err