mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-08 10:20:44 +00:00
fix: silence cron exec completion noise
This commit is contained in:
committed by
Peter Steinberger
parent
017252e4f8
commit
bd60df3e53
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user