fix: tighten gateway restart loop handling (#23416) (thanks @jeffwnli)

This commit is contained in:
Peter Steinberger
2026-02-22 10:36:11 +01:00
parent 26acb77450
commit dd07c06d00
6 changed files with 67 additions and 14 deletions

View File

@@ -56,6 +56,17 @@ describe("infra parsing", () => {
).toBe(true);
});
it("returns true for dist/entry.js when launched via openclaw.mjs wrapper", () => {
expect(
isMainModule({
currentFile: "/repo/dist/entry.js",
argv: ["node", "/repo/openclaw.mjs"],
cwd: "/repo",
env: {},
}),
).toBe(true);
});
it("returns false when running under PM2 but this module is imported", () => {
expect(
isMainModule({