agent: pull in and allow claude-code only for the claude runtime
This commit is contained in:
parent
adaabe6f51
commit
1ce5996c49
1 changed files with 30 additions and 6 deletions
|
|
@ -83,6 +83,9 @@ let
|
|||
};
|
||||
};
|
||||
|
||||
hasClaude = machine: lib.any (p: (p.name or "") == "claude") machine.environment.systemPackages;
|
||||
allowsClaudeCode = machine: machine.nixpkgs.config.allowUnfreePredicate { pname = "claude-code"; };
|
||||
|
||||
subagent = machine: machine.systemd.services.hive-subagent-daemon;
|
||||
harness = machine: machine.systemd.services.hive-agent;
|
||||
runtimeVars = [
|
||||
|
|
@ -234,6 +237,21 @@ let
|
|||
&& !(lib.hasInfix "rm -f \"$earlier\"" s)
|
||||
&& !(lib.hasInfix "mv -f \"$staged\" \"$earlier\"" s);
|
||||
}
|
||||
{
|
||||
name = "an ACP agent has no claude on PATH and no unfree allowance for claude-code";
|
||||
ok = !(hasClaude acp) && !(allowsClaudeCode acp) && !(allowsClaudeCode opencode);
|
||||
}
|
||||
{
|
||||
# Presence control for the case above: the same lookups find both on a
|
||||
# claude agent, and the allowance is for claude-code alone.
|
||||
name = "a claude agent has claude on PATH and an unfree allowance for claude-code only";
|
||||
ok =
|
||||
hasClaude claude
|
||||
&& hasClaude claudeApiKey
|
||||
&& allowsClaudeCode claude
|
||||
&& allowsClaudeCode claudeApiKey
|
||||
&& !(claude.nixpkgs.config.allowUnfreePredicate { pname = "other-unfree"; });
|
||||
}
|
||||
];
|
||||
in
|
||||
runGroup "agent-runtime" cases
|
||||
|
|
|
|||
Loading…
Reference in a new issue