diff --git a/internal/router/discovery.go b/internal/router/discovery.go index 6f1a740..afd05fe 100644 --- a/internal/router/discovery.go +++ b/internal/router/discovery.go @@ -93,16 +93,27 @@ func DiscoverOllama(ctx context.Context, baseURL string, probeCache map[string]O Size: m.Size, } + // Always probe; the cache is optional. Previously nil-cache was + // treated as "skip probing entirely", which left SupportsTools + // at its zero value (false) for every model — every ollama- + // discovered arm then got marked as tool-unsupported and + // rejected by filterFeasible for any tool-requiring task. main.go + // passes nil from the synchronous discovery path; we still want + // real probe data there. + var result OllamaProbeResult if probeCache != nil { - result, ok := probeCache[m.Name] - if !ok { + if cached, ok := probeCache[m.Name]; ok { + result = cached + } else { result = probeOllamaModel(ctx, baseURL, m.Name) probeCache[m.Name] = result } - dm.SupportsTools = result.SupportsTools - dm.SupportsVision = result.SupportsVision - dm.ContextSize = result.ContextSize + } else { + result = probeOllamaModel(ctx, baseURL, m.Name) } + dm.SupportsTools = result.SupportsTools + dm.SupportsVision = result.SupportsVision + dm.ContextSize = result.ContextSize if dm.ContextSize == 0 { dm.ContextSize = defaultOllamaContextSize