An adopted engine's state is written without its command; engine-check finds the installed build

SetCompute on an engine adopted from an earlier agent called writeState,
which read the command line from sh.cmd - nil for a process this agent did
not start - and the agent crashed at every start on the PoC's nodes until
fixed. An adopted shard now keeps the command line its state file had.

engine-check looked for llama-server one directory too shallow; the agent
installs it under <version-variant>/llama-<build>/. It now looks at both,
preferring a CUDA build on a machine with NVIDIA GPUs. Run on cuda01: a
token computed on CUDA0, 25 of 25 layers offloaded.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Ilker ManapandClaude Opus 5.5 committed 2026-10-07 14:26:28 +02:00
1 parent b5d650af16
commit 2f595f5999
4 files changed
+85 -7

No files matched your search

+20
View File
@@ -64,3 +64,23 @@ func TestEngineCheckComputesATokenOnTheGPU(t *testing.T) {
t.Fatalf("a build that falls back to the CPU: %v %s", err, out.String())
}
}
func TestEngineCheckFindsTheBuildTheAgentInstalled(t *testing.T) {
old := llamaRoot
llamaRoot = t.TempDir()
t.Cleanup(func() { llamaRoot = old })
if got := installedLlama(); got != "" {
t.Fatalf("nothing installed, found %q", got)
}
for _, p := range []string{"b10991-cpu/llama-b10991/llama-server", "b10991-cuda-13.3/llama-b10991/llama-server"} {
full := filepath.Join(llamaRoot, p)
_ = os.MkdirAll(filepath.Dir(full), 0o755)
_ = os.WriteFile(full, []byte("x"), 0o755)
}
dir := t.TempDir()
_ = os.WriteFile(filepath.Join(dir, "nvidia-smi"), []byte("#!/bin/sh\n"), 0o755)
t.Setenv("PATH", dir)
if got := installedLlama(); !strings.Contains(got, "cuda-13.3/llama-b10991/llama-server") {
t.Errorf("with GPUs, not the CUDA build: %q", got)
}
}