Skip to content

Commit 589df18

Browse files
committed
test(local-ai): derive runtime fixture from catalog
Co-authored-by: Copilot App <[email protected]> Copilot-Session: b3afd332-87dd-45cb-8841-9eeb6a8b0e6a
1 parent 87b594c commit 589df18

1 file changed

Lines changed: 34 additions & 36 deletions

File tree

‎tests/OpenClaw.Connection.Tests/LocalAiPortLifecycleTests.cs‎

Lines changed: 34 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -340,46 +340,44 @@ private static string ArgumentAfter(IReadOnlyList<string> arguments, string name
340340
return arguments[index + 1];
341341
}
342342

343-
private static LocalAiInstallManifest ValidManifest() => new()
343+
private static LocalAiInstallManifest ValidManifest()
344344
{
345-
EngineVersion = "b10488",
346-
Architecture = "arm64",
347-
RuntimeId = "b10488-cuda13-arm64",
348-
ModelCatalogId = "qwen3.6-35b-a3b-mtp-q4-k-m",
349-
SelectedGpuId = "GPU-01234567-89ab-cdef-0123-456789abcdef",
350-
ExecutablePath = Path.Combine("engines", "llama-b10488", "llama-server.exe"),
351-
RuntimeAssets =
352-
[
353-
new LocalAiAssetReceipt
345+
LlamaRuntimeVariant runtime = LlamaRuntimeCatalog.Find(
346+
System.Runtime.InteropServices.Architecture.Arm64)!;
347+
return new LocalAiInstallManifest
348+
{
349+
EngineVersion = LlamaRuntimeCatalog.ReleaseTag,
350+
Architecture = "arm64",
351+
RuntimeId = runtime.Id,
352+
ModelCatalogId = "qwen3.6-35b-a3b-mtp-q4-k-m",
353+
SelectedGpuId = "GPU-01234567-89ab-cdef-0123-456789abcdef",
354+
ExecutablePath = Path.Combine(
355+
"engines",
356+
$"llama-{LlamaRuntimeCatalog.ReleaseTag}",
357+
LlamaRuntimeCatalog.ServerExecutableName),
358+
RuntimeAssets = runtime.Artifacts.Select(artifact => new LocalAiAssetReceipt
354359
{
355-
FileName = "llama-b10488-bin-win-cuda-13.4-arm64.zip",
356-
SourceUrl = "https://github.com/ggml-org/llama.cpp/releases/download/b10488/llama-b10488-bin-win-cuda-13.4-arm64.zip",
357-
SizeBytes = 140_379_054,
358-
Sha256 = "75554d62f4af8f4150d3b4b0cca7df62d44105e98fb7cd92ab2d177e382b441d",
359-
},
360-
new LocalAiAssetReceipt
360+
FileName = Path.GetFileName(artifact.RelativePath),
361+
SourceUrl = artifact.DownloadUri.AbsoluteUri,
362+
SizeBytes = artifact.SizeBytes,
363+
Sha256 = artifact.Sha256.Value,
364+
}).ToImmutableArray(),
365+
ModelPath = Path.Combine("models", "Qwen3.6-35B-A3B-UD-Q4_K_M.gguf"),
366+
ModelId = "unsloth/Qwen3.6-35B-A3B-MTP-GGUF@5bc3e238d916f48a861bac2f8a1990a0e9b7e98d",
367+
ModelAlias = "qwen3.6-35b-a3b-mtp-q4-k-m",
368+
ModelAsset = new LocalAiAssetReceipt
361369
{
362-
FileName = "cudart-llama-bin-win-cuda-13.4-arm64.zip",
363-
SourceUrl = "https://github.com/ggml-org/llama.cpp/releases/download/b10488/cudart-llama-bin-win-cuda-13.4-arm64.zip",
364-
SizeBytes = 153_318_797,
365-
Sha256 = "5a40dc7c5fa3d0a80ceeba4f16f9e8d25d87bcf1399c9233588953c43436c33c",
370+
FileName = "Qwen3.6-35B-A3B-UD-Q4_K_M.gguf",
371+
SourceUrl = "https://huggingface.co/unsloth/Qwen3.6-35B-A3B-MTP-GGUF/resolve/5bc3e238d916f48a861bac2f8a1990a0e9b7e98d/Qwen3.6-35B-A3B-UD-Q4_K_M.gguf?download=true",
372+
SizeBytes = 22_663_387_424,
373+
Sha256 = "0b21525e972670ed59e1812e170b27c26355381f0656ecc4e25617ece7dac58b",
366374
},
367-
],
368-
ModelPath = Path.Combine("models", "Qwen3.6-35B-A3B-UD-Q4_K_M.gguf"),
369-
ModelId = "unsloth/Qwen3.6-35B-A3B-MTP-GGUF@5bc3e238d916f48a861bac2f8a1990a0e9b7e98d",
370-
ModelAlias = "qwen3.6-35b-a3b-mtp-q4-k-m",
371-
ModelAsset = new LocalAiAssetReceipt
372-
{
373-
FileName = "Qwen3.6-35B-A3B-UD-Q4_K_M.gguf",
374-
SourceUrl = "https://huggingface.co/unsloth/Qwen3.6-35B-A3B-MTP-GGUF/resolve/5bc3e238d916f48a861bac2f8a1990a0e9b7e98d/Qwen3.6-35B-A3B-UD-Q4_K_M.gguf?download=true",
375-
SizeBytes = 22_663_387_424,
376-
Sha256 = "0b21525e972670ed59e1812e170b27c26355381f0656ecc4e25617ece7dac58b",
377-
},
378-
RequestedPort = 0,
379-
Endpoint = null,
380-
ContextLength = 262_144,
381-
InstalledAtUtc = DateTimeOffset.Parse("2026-08-18T12:00:00Z"),
382-
};
375+
RequestedPort = 0,
376+
Endpoint = null,
377+
ContextLength = 262_144,
378+
InstalledAtUtc = DateTimeOffset.Parse("2026-08-18T12:00:00Z"),
379+
};
380+
}
383381

384382
private sealed class FakePlatform : ILlamaServerRuntimePlatform
385383
{

0 commit comments

Comments
 (0)