openclaw / src /plugin-sdk /agent-harness-exec-review-runtime.test.ts
SaylorTwift's picture
SaylorTwift HF Staff
Add files using upload-large-folder tool
5c2a829 verified
Raw History Blame Contribute Delete
1.06 kB
import { describe, expect, it } from "vitest";
import { buildExecAutoReviewInputForShellCommand } from "./agent-harness-exec-review-runtime.js";
describe("agent harness exec auto-review input", () => {
it.runIf(process.platform !== "win32").each(["bash", "sh", "/bin/sh"])(
"does not bind %s login-shell startup as a reviewable command",
async (shell) => {
await expect(
buildExecAutoReviewInputForShellCommand({
command: `${shell} -lc "echo auto-review-startup-proof"`,
cwd: process.cwd(),
host: "codex-app-server",
}),
).resolves.toBeUndefined();
},
);
it("preserves ordinary single-command auto-review input", async () => {
await expect(
buildExecAutoReviewInputForShellCommand({
command: "node --version",
cwd: process.cwd(),
host: "codex-app-server",
}),
).resolves.toMatchObject({
command: "node --version",
argv: ["node", "--version"],
host: "codex-app-server",
reason: "approval-required",
});
});
});