feat(agent): require absolute path for command in hermes/cursor agent configs

BREAKING: HermesAgentConfig.command and CursorAgentConfig.command are now
required string fields (absolute path to CLI binary). Validation rejects
non-absolute paths at construction time.

- Eliminates PATH resolution ambiguity in spawned worker processes
- spawnCli: explicit env: process.env for clarity
- bundle-entry: WORKFLOW_CURSOR_COMMAND is now required
- Updated tests for both agents
This commit is contained in:
2026-05-12 12:52:48 +08:00
parent ecc348f182
commit 1b62cec0a2
9 changed files with 55 additions and 5 deletions
@@ -4,14 +4,28 @@ import { createHermesAgent, validateHermesAgentConfig } from "../src/index.js";
describe("validateHermesAgentConfig", () => {
test("accepts valid config", () => {
const r = validateHermesAgentConfig({
command: "/usr/local/bin/hermes",
model: null,
timeout: null,
});
expect(r.ok).toBe(true);
});
test("rejects non-absolute command", () => {
const r = validateHermesAgentConfig({
command: "hermes",
model: null,
timeout: null,
});
expect(r.ok).toBe(false);
if (!r.ok) {
expect(r.error).toContain("absolute path");
}
});
test("rejects negative timeout", () => {
const r = validateHermesAgentConfig({
command: "/usr/local/bin/hermes",
model: null,
timeout: -5,
});
@@ -25,6 +39,7 @@ describe("validateHermesAgentConfig", () => {
describe("createHermesAgent", () => {
test("returns an AgentFn", () => {
const agent = createHermesAgent({
command: "/usr/local/bin/hermes",
model: null,
timeout: null,
});