fix(agent): defer config validation to call time

Bundle top-level code runs during `workflow add` (descriptor extraction),
but agent config env vars (e.g. WORKFLOW_HERMES_COMMAND) are only available
at `workflow run` time. Deferring validation prevents premature throws.
This commit is contained in:
2026-05-12 12:58:06 +08:00
parent 4c4dabb7a3
commit c5fd84432f
4 changed files with 30 additions and 32 deletions
@@ -37,11 +37,11 @@ describe("validateHermesAgentConfig", () => {
});
describe("createHermesAgent", () => {
test("returns an AgentFn", () => {
test("returns an AgentFn even with invalid config (validation deferred to call)", () => {
const agent = createHermesAgent({
command: "/usr/local/bin/hermes",
model: null,
timeout: null,
timeout: -5,
});
expect(typeof agent).toBe("function");
});