package agentsvc import ( "slices" "testing" llmgwv1 "gitea.mynodes.xyz/ilker/llmgw/api/gen/llmgw/v1" "gitea.mynodes.xyz/ilker/llmgw/internal/agent/provision" ) func TestANodeIsAskedOnlyForEnginesItCanInstall(t *testing.T) { // An agent older than the list says nothing, and could install llama.cpp // alone. Asked for vLLM, it showed as failing until it was upgraded. if got := installable(&llmgwv1.Register{}); !slices.Equal(got, []string{"llamacpp"}) { t.Errorf("an agent that said nothing: %v", got) } // This agent says what it can, and that is vLLM and SGLang besides. now := &llmgwv1.Register{InstallableEngines: provision.Installable()} for _, e := range []string{"llamacpp", "vllm", "sglang"} { if !slices.Contains(installable(now), e) { t.Errorf("this agent does not offer %s: %v", e, installable(now)) } } if slices.Contains(installable(now), "uv") { t.Error("uv, a tool for the others, is offered as an engine") } }