Function isAgentHarness
Checks if the tests are run by an AI harness. TRIAL_AGENT overrides the detection.
bool isAgentHarness(
const(string[string]) environment
);
Example
isAgentHarness returns true when CLAUDECODE is set
["CLAUDECODE": "1"] .isAgentHarness .should .equal(true);
Example
isAgentHarness returns false when only PATH is set
["PATH": "/usr/bin"] .isAgentHarness .should .equal(false);
Example
isAgentHarness returns false when CLAUDECODE is set and TRIAL_AGENT is "0"
["CLAUDECODE": "1", "TRIAL_AGENT": "0"] .isAgentHarness .should .equal(false);
Example
isAgentHarness returns true when only TRIAL_AGENT is "1"
["TRIAL_AGENT": "1"] .isAgentHarness .should .equal(true);