Tests: cover agents and fix web defaults

Co-authored-by: RealSid08 <RealSid08@users.noreply.github.com>
This commit is contained in:
Peter Steinberger
2025-12-02 10:56:10 +00:00
parent f31e89d5af
commit ed080ae988
17 changed files with 285 additions and 82 deletions

View File

@@ -193,7 +193,11 @@ describe("runCommandReply", () => {
throw { stdout: "partial output here", killed: true, signal: "SIGKILL" };
});
const { payload, meta } = await runCommandReply({
reply: { mode: "command", command: ["echo", "hi"], agent: { kind: "claude" } },
reply: {
mode: "command",
command: ["echo", "hi"],
agent: { kind: "claude" },
},
templatingCtx: noopTemplateCtx,
sendSystemOnce: false,
isNewSession: true,
@@ -214,7 +218,12 @@ describe("runCommandReply", () => {
throw { stdout: "", killed: true, signal: "SIGKILL" };
});
const { payload } = await runCommandReply({
reply: { mode: "command", command: ["echo", "hi"], cwd: "/tmp/work", agent: { kind: "claude" } },
reply: {
mode: "command",
command: ["echo", "hi"],
cwd: "/tmp/work",
agent: { kind: "claude" },
},
templatingCtx: noopTemplateCtx,
sendSystemOnce: false,
isNewSession: true,
@@ -236,7 +245,12 @@ describe("runCommandReply", () => {
stdout: `hi\nMEDIA:${tmp}\nMEDIA:https://example.com/img.jpg`,
});
const { payload } = await runCommandReply({
reply: { mode: "command", command: ["echo", "hi"], mediaMaxMb: 1, agent: { kind: "claude" } },
reply: {
mode: "command",
command: ["echo", "hi"],
mediaMaxMb: 1,
agent: { kind: "claude" },
},
templatingCtx: noopTemplateCtx,
sendSystemOnce: false,
isNewSession: true,
@@ -279,7 +293,11 @@ describe("runCommandReply", () => {
it("captures queue wait metrics in meta", async () => {
const runner = makeRunner({ stdout: "ok" });
const { meta } = await runCommandReply({
reply: { mode: "command", command: ["echo", "{{Body}}"], agent: { kind: "claude" } },
reply: {
mode: "command",
command: ["echo", "{{Body}}"],
agent: { kind: "claude" },
},
templatingCtx: noopTemplateCtx,
sendSystemOnce: false,
isNewSession: true,