Files
hermes-agent/apps/desktop/electron/feature-flags.test.ts
emozilla 361963828d feat(pm): llama.cpp CUDA on Linux arm64; bundle libgomp for Linux engines
b11146 ships ubuntu-cuda-13.4-arm64 (+ cudart), so llamacpp-cuda gains
linux-arm64, auto resolves NVIDIA arm64 Linux to CUDA, and the desktop's
localModels flag ships on Linux arm64 too.

Every upstream Linux llama.cpp build (CPU included) links the system
libgomp, which minimal hosts (WSL, containers) lack, and a normal install
never touches the system package manager. Each Linux engine now pins
Ubuntu 24.04's libgomp1 .deb (glibc 2.38, the floor upstream already sets)
and stages libgomp.so.1 beside llama-server, where the $ORIGIN RUNPATH
finds it; the artifact mirror covers the pool URL after 24.04's EOL.
DebPackage's ar+tar unpack becomes pm.package.unpack_deb and reads zstd
data.tar (Ubuntu's default) with the stdlib codec PM's 3.14 runtime has.

Pre-PM engines on Linux carry only llama.cpp's own archives, so adoption
maps their manifests to those and records them as outdated (usable now,
update offered) instead of failing to match.

Verified on an RTX Spark N1X (WSL, Ubuntu 26.04, no system libgomp):
ensure_engine() for cuda, cpu and vulkan through PM's real download/stage/
verify path; ldd resolves libgomp from the entry; llama-server serves
completions (CUDA0 at 445 tok/s). linux-x64 cpu/vulkan staged through the
same path with no NEEDED library missing beyond glibc/libstdc++/OpenSSL 3.
2026-10-03 22:32:13 -04:00

37 lines
1.6 KiB
TypeScript

// feature-flags.ts is the single resolver for which gated surfaces are on in
// this artifact. These tests pin the flag table: local models ship on Windows,
// macOS and Linux x64/arm64 on every channel; elsewhere the launch argv opts in with
// --local.
import assert from 'node:assert/strict'
import { test } from 'vitest'
import { isCanaryTag, resolveFeatureFlags } from './feature-flags'
const shipsLocalModels: boolean =
process.platform === 'win32' ||
process.platform === 'darwin' ||
(process.platform === 'linux' && (process.arch === 'x64' || process.arch === 'arm64'))
test('without --local, local models follow the platform on every channel', () => {
for (const canary of [false, true]) {
assert.deepEqual(resolveFeatureFlags({ argv: [], canary }), { localModels: shipsLocalModels })
assert.deepEqual(resolveFeatureFlags({ argv: ['Hermes.exe'], canary }), { localModels: shipsLocalModels })
}
})
test('--local in argv opts into local models on any channel and platform', () => {
assert.deepEqual(resolveFeatureFlags({ argv: ['Hermes.exe', '--local'], canary: false }), { localModels: true })
assert.deepEqual(resolveFeatureFlags({ argv: ['--local'], canary: true }), { localModels: true })
})
test('isCanaryTag recognizes canary stamps and rejects stable/dev tags', () => {
assert.equal(isCanaryTag('v0.28.0+canary.20260818T123456Z'), true)
assert.equal(isCanaryTag('v0.28.0-canary.20260818'), false)
assert.equal(isCanaryTag('v0.28.0+canary.20260818123456'), false)
assert.equal(isCanaryTag('v0.28.0'), false)
assert.equal(isCanaryTag(''), false)
assert.equal(isCanaryTag(null), false)
assert.equal(isCanaryTag(undefined), false)
})