mirror of
https://github.com/openclaw/openclaw.git
synced 2026-07-14 02:26:03 +00:00
fix(ci): stabilize CLI startup memory gate
This commit is contained in:
@@ -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,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -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";
|
||||
|
||||
|
||||
@@ -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, {
|
||||
|
||||
Reference in New Issue
Block a user