From e70ae7776cbe1aca7f8384a79cd9d4876e304613 Mon Sep 17 00:00:00 2001 From: damocles Date: Sat, 23 May 2026 00:41:15 +0200 Subject: [PATCH] harness-base: add assertions for common agent config mistakes (closes #318) --- nix/templates/harness-base.nix | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/nix/templates/harness-base.nix b/nix/templates/harness-base.nix index 64a8b02..efb3b37 100644 --- a/nix/templates/harness-base.nix +++ b/nix/templates/harness-base.nix @@ -329,8 +329,10 @@ # expected to set `_module.args.flakeInputs = builtins.removeAttrs inputs ["self"]`. # If `self` leaks into flakeInputs the agent gets a spurious attrset # entry that can shadow real inputs and is almost certainly a bug. + # Guard with `or {}` so standalone evaluation stays clean when + # flakeInputs is absent from _module.args. { - assertion = !(builtins.hasAttr "self" flakeInputs); + assertion = !(builtins.hasAttr "self" (config._module.args.flakeInputs or { })); message = '' hyperhive: `flakeInputs` must not contain "self". In your agent flake.nix, use: