fix: silence cron exec completion noise

This commit is contained in:
Mark Goldenstein
2026-04-24 20:56:34 -07:00
committed by Peter Steinberger
parent 017252e4f8
commit bd60df3e53
10 changed files with 212 additions and 3 deletions

View File

@@ -148,6 +148,7 @@ let executeNodeHostCommand: typeof import("./bash-tools.exec-host-node.js").exec
type MockNodeInvokeParams = {
command?: string;
params?: Record<string, unknown>;
};
describe("executeNodeHostCommand", () => {
@@ -276,6 +277,36 @@ describe("executeNodeHostCommand", () => {
);
});
it("suppresses node completion events when notifyOnExit is disabled", async () => {
requiresExecApprovalMock.mockReturnValue(false);
await executeNodeHostCommand({
command: "bun ./script.ts",
workdir: "/tmp/work",
env: {},
security: "full",
ask: "off",
defaultTimeoutSec: 30,
approvalRunningNoticeMs: 0,
warnings: [],
agentId: "requested-agent",
sessionKey: "requested-session",
notifyOnExit: false,
});
expect(callGatewayToolMock).toHaveBeenNthCalledWith(
2,
"node.invoke",
expect.anything(),
expect.objectContaining({
command: "system.run",
params: expect.objectContaining({
suppressNotifyOnExit: true,
}),
}),
);
});
it("denies timed-out inline-eval requests instead of invoking the node", async () => {
detectInterpreterInlineEvalArgvMock.mockReturnValue(INLINE_EVAL_HIT);
resolveApprovalDecisionOrUndefinedMock.mockResolvedValue(null);