test: harden gateway sigterm argv

This commit is contained in:
Peter Steinberger
2026-01-19 16:35:45 +00:00
parent 90ea21536b
commit 37af1d6946

View File

@@ -123,9 +123,11 @@ describe("gateway SIGTERM", () => {
' console.error("Failed to parse CLAWDBOT_ENTRY_ARGS", err);',
" process.exit(1);",
"}",
"if (!Array.isArray(entryArgs)) entryArgs = [];",
'entryArgs = entryArgs.filter((arg) => typeof arg === "string" && !arg.toLowerCase().includes("node.exe"));',
`const runMainUrl = ${JSON.stringify(pathToFileURL(runMainPath).href)};`,
"const { runCli } = await import(runMainUrl);",
'await runCli([process.execPath, "clawdbot", ...entryArgs]);',
'await runCli(["node", "clawdbot", ...entryArgs]);',
].join("\n"),
"utf8",
);