fix(ci): stabilize CLI startup memory gate

This commit is contained in:
Peter Steinberger
2026-07-13 02:31:44 -04:00
parent 71295851d7
commit 82d53fd91d
3 changed files with 18 additions and 2 deletions

View File

@@ -98,7 +98,9 @@ function resolveDefaultLimitsMb(platform = process.platform) {
// Plugin discovery is heavier than help, but must stay below the doctor/channel
// runtime graph that an empty metadata-only invocation must not import.
pluginsList: platform === "darwin" ? 500 : 400,
statusJson: 400,
// Node 24 status startup sits near 400 MB; retain regression signal without
// failing on sub-megabyte runner RSS variance.
statusJson: 425,
gatewayStatus: 500,
};
}

View File

@@ -1,7 +1,17 @@
// Validates the current runtime against OpenClaw's Node engine floor.
import process from "node:process";
import { expectDefined } from "@openclaw/normalization-core";
import { defaultRuntime, type RuntimeEnv } from "../runtime.js";
import type { RuntimeEnv } from "../runtime.js";
// Runtime validation precedes terminal setup. Keep this default path from
// pulling terminal-core into every CLI startup command.
const defaultRuntime: RuntimeEnv = {
log: (...args) => console.log(...args),
error: (...args) => console.error(...args),
exit: (code) => {
process.exit(code);
},
};
type RuntimeKind = "bun" | "node" | "unknown";

View File

@@ -63,6 +63,10 @@ describe("check-cli-startup-memory", () => {
);
});
it("keeps status startup headroom above Linux runner RSS variance", () => {
expect(testing.resolveDefaultLimitsMb("linux").statusJson).toBe(425);
});
it("keeps invalid startup memory env values from bypassing budgets", () => {
expect(() =>
testing.readPositiveNumberEnv("OPENCLAW_STARTUP_MEMORY_HELP_MB", 100, {