fix(agents): demote Ollama empty-discovery log from warn to debug (#26379)

When Ollama responds successfully but returns zero models (e.g. on Linux
with the bundled `ollama-stub.service`), `discoverOllamaModels` was
logging at `warn` level:

  [agents/model-providers] No Ollama models found on local instance

This appeared on every agent invocation even when Ollama was not
intentionally configured, polluting production logs.  An empty model
list is a normal operational state — it warrants at most a debug
note, not a warning.

Fix: change `log.warn` → `log.debug` for the zero-models branch.
The error paths (HTTP failure, fetch exception) remain at `warn`
since those indicate genuine connectivity problems.

Closes #26354
This commit is contained in:
Byungsker
2026-02-27 14:12:10 +09:00
committed by GitHub
parent cb9374a2a1
commit d911b0254d

View File

@@ -252,7 +252,7 @@ async function discoverOllamaModels(baseUrl?: string): Promise<ModelDefinitionCo
}
const data = (await response.json()) as OllamaTagsResponse;
if (!data.models || data.models.length === 0) {
log.warn("No Ollama models found on local instance");
log.debug("No Ollama models found on local instance");
return [];
}
return data.models.map((model) => {