From 6024741356a9a75a4625162cb8f400882224de10 Mon Sep 17 00:00:00 2001 From: Ciphercat <78522797+0xrsydn@users.noreply.github.com> Date: Mon, 16 Mar 2026 01:21:10 +0000 Subject: [PATCH] test: add hermes-agent import check MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Verifies hermes-agent starts without ModuleNotFoundError. Exits cleanly with 'Failed to initialize OpenAI client' (expected — no API key in test). --- checks.nix | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/checks.nix b/checks.nix index 72645a7..6720e16 100644 --- a/checks.nix +++ b/checks.nix @@ -61,6 +61,28 @@ echo "ok" > $out/result ''; + # Verify hermes-agent doesn't crash on import (exit 124 = timeout, not import error) + hermes-agent-import = pkgs.runCommand "hermes-agent-import" { } '' + set -e + export HOME=$(mktemp -d) + + echo "=== Testing hermes-agent starts without import errors ===" + # hermes-agent is interactive (fire CLI), so it will hang waiting for input. + # Exit 124 (timeout) = OK. Any other exit = import/crash error. + timeout 3 ${hermes-agent}/bin/hermes-agent 2>&1 || CODE=$? + if [ "''${CODE:-0}" = "124" ]; then + echo "PASS: hermes-agent starts (timed out waiting for input, no import errors)" + elif [ "''${CODE:-0}" = "0" ]; then + echo "PASS: hermes-agent exited cleanly" + else + echo "FAIL: hermes-agent crashed with exit code $CODE" + exit 1 + fi + + mkdir -p $out + echo "ok" > $out/result + ''; + # Verify doctor runs without crashing doctor = pkgs.runCommand "hermes-doctor" { } '' set -e