mirror of
https://github.com/hansjone/oclaw.git
synced 2026-10-09 11:20:44 +08:00
重构主控编排与运行时预热链路,统一工作区提示词/专家调度协议并补齐 wiki 记忆注入与写回闭环。
同时收敛启动与运维脚本默认行为(含 wiki worker)、更新 Admin 可观测性与相关测试,降低首轮时延并提高运行稳定性。 Made-with: Cursor
This commit is contained in:
parent
4a23b715a2
commit
dbbe3add6a
14438 changed files with 2693620 additions and 2546 deletions
77
openclaw/scripts/test-update-cli-startup-bench.mjs
Normal file
77
openclaw/scripts/test-update-cli-startup-bench.mjs
Normal file
|
|
@ -0,0 +1,77 @@
|
|||
import { spawnSync } from "node:child_process";
|
||||
import { parseFlagArgs, stringFlag, intFlag } from "./lib/arg-utils.mjs";
|
||||
|
||||
const CLI_STARTUP_BENCH_FIXTURE_PATH = "test/fixtures/cli-startup-bench.json";
|
||||
|
||||
if (process.argv.slice(2).includes("--help")) {
|
||||
console.log(
|
||||
[
|
||||
"Usage: node scripts/test-update-cli-startup-bench.mjs [options]",
|
||||
"",
|
||||
"Refresh the checked-in CLI benchmark fixture.",
|
||||
"",
|
||||
"Options:",
|
||||
" --out <path> Output path (default: test/fixtures/cli-startup-bench.json)",
|
||||
" --entry <path> CLI entry to benchmark (default: openclaw.mjs)",
|
||||
" --preset <name> startup | real | all (default: all)",
|
||||
" --runs <n> Measured runs per case (default: 5)",
|
||||
" --warmup <n> Warmup runs per case (default: 1)",
|
||||
" --timeout-ms <ms> Per-run timeout (default: 30000)",
|
||||
" --help Show this help text",
|
||||
"",
|
||||
"Example:",
|
||||
" node scripts/test-update-cli-startup-bench.mjs --preset all --runs 3 --warmup 1",
|
||||
].join("\n"),
|
||||
);
|
||||
process.exit(0);
|
||||
}
|
||||
|
||||
const opts = parseFlagArgs(
|
||||
process.argv.slice(2),
|
||||
{
|
||||
out: CLI_STARTUP_BENCH_FIXTURE_PATH,
|
||||
entry: "openclaw.mjs",
|
||||
preset: "all",
|
||||
runs: 5,
|
||||
warmup: 1,
|
||||
timeoutMs: 30_000,
|
||||
},
|
||||
[
|
||||
stringFlag("--out", "out"),
|
||||
stringFlag("--entry", "entry"),
|
||||
stringFlag("--preset", "preset"),
|
||||
intFlag("--runs", "runs", { min: 1 }),
|
||||
intFlag("--warmup", "warmup", { min: 0 }),
|
||||
intFlag("--timeout-ms", "timeoutMs", { min: 1 }),
|
||||
],
|
||||
);
|
||||
|
||||
const args = [
|
||||
"--import",
|
||||
"tsx",
|
||||
"scripts/bench-cli-startup.ts",
|
||||
"--entry",
|
||||
opts.entry,
|
||||
"--preset",
|
||||
opts.preset,
|
||||
"--runs",
|
||||
String(opts.runs),
|
||||
"--warmup",
|
||||
String(opts.warmup),
|
||||
"--timeout-ms",
|
||||
String(opts.timeoutMs),
|
||||
"--output",
|
||||
opts.out,
|
||||
];
|
||||
|
||||
const run = spawnSync("node", args, {
|
||||
cwd: process.cwd(),
|
||||
stdio: "inherit",
|
||||
env: process.env,
|
||||
});
|
||||
|
||||
if (run.status !== 0) {
|
||||
process.exit(run.status ?? 1);
|
||||
}
|
||||
|
||||
console.log(`[test-update-cli-startup-bench] wrote fixture to ${opts.out}`);
|
||||
Loading…
Add table
Add a link
Reference in a new issue