惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

A
About on SuperTechFans
量子位
Apple Machine Learning Research
Apple Machine Learning Research
博客园 - 聂微东
V
Visual Studio Blog
小众软件
小众软件
Hugging Face - Blog
Hugging Face - Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
博客园 - 司徒正美
V
V2EX
The GitHub Blog
The GitHub Blog
博客园_首页
月光博客
月光博客
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
MyScale Blog
MyScale Blog
博客园 - 叶小钗
F
Fortinet All Blogs
T
Tailwind CSS Blog
GbyAI
GbyAI
酷 壳 – CoolShell
酷 壳 – CoolShell
IT之家
IT之家
WordPress大学
WordPress大学
B
Blog
H
Help Net Security

Recent Commits to openclaw:main

test: merge chat side-result checks · openclaw/openclaw@ddd2c2a test: merge cron history checks · openclaw/openclaw@f7eb746 test: merge responsive navigation shell checks · openclaw/openclaw@c2e4b47 docs(changelog): add codex oauth fixes · openclaw/openclaw@628e6cd test: merge navigation routing cases · openclaw/openclaw@5d8cecb Tests: mock channel registry bundled fallback · openclaw/openclaw@2b08233 Secrets: avoid broad web search discovery for single plugin config · openclaw/openclaw@a464f59 test: merge config view browser checks · openclaw/openclaw@20cf511 fix(status): align oauth health with runtime · openclaw/openclaw@eed7116 feat: add macOS screen snapshots for monitor preview (#67954) thanks … · openclaw/openclaw@f377db1 fix: report shared auth scopes in hello-ok (#67810) thanks @BunsDev · openclaw/openclaw@0b6c39b Auto-reply: avoid eager bundled route fallback · openclaw/openclaw@3ea1bf4 Tests: narrow session binding contract setup · openclaw/openclaw@54e4e16 fix(macOS): enable undo/redo in webchat composer text input (#34962) · openclaw/openclaw@00951dc Tests: speed up channel setup promotion · openclaw/openclaw@82b529a Docs: refresh agent instructions · openclaw/openclaw@5775fe2 fix(auth): serialize OAuth refresh across agents to fix #26322 (#67876) · openclaw/openclaw@8e79080 test: allow ollama public surface boundary test · openclaw/openclaw@7d4f1a6 Docs: add test performance guardrails · openclaw/openclaw@89706d3 Tests: restore context-engine usage proof · openclaw/openclaw@e4c4f95 Tests: slim context engine runtime coverage · openclaw/openclaw@74c198f ci: retry failed custom checkouts · openclaw/openclaw@0ee5baf test: trim duplicate provider auth onboarding cases · openclaw/openclaw@1ffc02e matrix: fix sessions_spawn --thread subagent session spawning (#67643) · openclaw/openclaw@1ce2596 test: reduce auth choice fixture churn · openclaw/openclaw@857b9cd test: mock health status config boundaries · openclaw/openclaw@9d5ab4a test: mock onboard config io boundary · openclaw/openclaw@299694d test: mock legacy state plugin boundaries · openclaw/openclaw@2713089 test: mock channel install boundaries · openclaw/openclaw@b945248 test: mock doctor preview channel boundaries · openclaw/openclaw@b1a3ad4
feat(gateway): profile watched gateway startup · openclaw...
steipete · 2026-05-03 · via Recent Commits to openclaw:main

@@ -7,6 +7,8 @@ const TMUX_DISABLE_VALUES = new Set(["0", "false", "no", "off"]);

77

const TMUX_ATTACH_DISABLE_VALUES = new Set(["0", "false", "no", "off"]);

88

const TMUX_ATTACH_FORCE_VALUES = new Set(["1", "true", "yes", "on"]);

99

const DEFAULT_PROFILE_NAME = "main";

10+

const DEFAULT_BENCHMARK_PROFILE_DIR = ".artifacts/gateway-watch-profiles";

11+

const RUN_NODE_CPU_PROF_DIR_ENV = "OPENCLAW_RUN_NODE_CPU_PROF_DIR";

1012

const RAW_WATCH_SCRIPT = "scripts/watch-node.mjs";

1113

const TMUX_CWD_ENV_KEY = "OPENCLAW_GATEWAY_WATCH_CWD";

1214

const TMUX_CWD_OPTION_KEY = "@openclaw.gateway_watch.cwd";

@@ -16,6 +18,7 @@ const TMUX_CHILD_ENV_KEYS = [

1618

"OPENCLAW_GATEWAY_PORT",

1719

"OPENCLAW_HOME",

1820

"OPENCLAW_PROFILE",

21+

RUN_NODE_CPU_PROF_DIR_ENV,

1922

"OPENCLAW_SKIP_CHANNELS",

2023

"OPENCLAW_STATE_DIR",

2124

];

@@ -46,6 +49,54 @@ const readArgValue = (args, flag) => {

4649

return null;

4750

};

485152+

const resolveGatewayWatchBenchmarkArgs = ({ args = [], env = process.env } = {}) => {

53+

const passthroughArgs = [];

54+

let benchmarkDir = null;

55+

let benchmarkFlagSeen = false;

56+57+

for (let index = 0; index < args.length; index += 1) {

58+

const arg = args[index];

59+

if (arg === "--benchmark") {

60+

benchmarkFlagSeen = true;

61+

benchmarkDir ??= DEFAULT_BENCHMARK_PROFILE_DIR;

62+

continue;

63+

}

64+

if (typeof arg === "string" && arg.startsWith("--benchmark=")) {

65+

benchmarkFlagSeen = true;

66+

benchmarkDir = arg.slice("--benchmark=".length) || DEFAULT_BENCHMARK_PROFILE_DIR;

67+

continue;

68+

}

69+

if (arg === "--benchmark-dir") {

70+

benchmarkFlagSeen = true;

71+

const next = args[index + 1];

72+

if (typeof next === "string" && !next.startsWith("-")) {

73+

benchmarkDir = next;

74+

index += 1;

75+

} else {

76+

benchmarkDir ??= DEFAULT_BENCHMARK_PROFILE_DIR;

77+

}

78+

continue;

79+

}

80+

if (typeof arg === "string" && arg.startsWith("--benchmark-dir=")) {

81+

benchmarkFlagSeen = true;

82+

benchmarkDir = arg.slice("--benchmark-dir=".length) || DEFAULT_BENCHMARK_PROFILE_DIR;

83+

continue;

84+

}

85+

passthroughArgs.push(arg);

86+

}

87+88+

const nextEnv = { ...env };

89+

if (benchmarkFlagSeen) {

90+

nextEnv[RUN_NODE_CPU_PROF_DIR_ENV] =

91+

benchmarkDir || nextEnv[RUN_NODE_CPU_PROF_DIR_ENV] || DEFAULT_BENCHMARK_PROFILE_DIR;

92+

}

93+

return {

94+

args: passthroughArgs,

95+

benchmarkProfileDir: nextEnv[RUN_NODE_CPU_PROF_DIR_ENV] || null,

96+

env: nextEnv,

97+

};

98+

};

99+49100

export const resolveGatewayWatchTmuxSessionName = ({ args = [], env = process.env } = {}) => {

50101

const profile =

51102

env.OPENCLAW_PROFILE ||

@@ -168,10 +219,14 @@ const setTmuxSessionMetadata = ({ cwd, sessionName, spawnSyncImpl, stderr }) =>

168219

};

169220170221

export const runGatewayWatchTmuxMain = (params = {}) => {

171-

const deps = {

222+

const resolvedArgs = resolveGatewayWatchBenchmarkArgs({

172223

args: params.args ?? process.argv.slice(2),

173-

cwd: params.cwd ?? process.cwd(),

174224

env: params.env ? { ...params.env } : { ...process.env },

225+

});

226+

const deps = {

227+

args: resolvedArgs.args,

228+

cwd: params.cwd ?? process.cwd(),

229+

env: resolvedArgs.env,

175230

nodePath: params.nodePath ?? process.execPath,

176231

spawnSync: params.spawnSync ?? spawnSync,

177232

stderr: params.stderr ?? process.stderr,

@@ -180,6 +235,10 @@ export const runGatewayWatchTmuxMain = (params = {}) => {

180235

stdoutIsTTY: params.stdoutIsTTY ?? process.stdout.isTTY,

181236

};

182237238+

if (resolvedArgs.benchmarkProfileDir) {

239+

log(deps.stderr, `gateway:watch benchmark CPU profiles: ${resolvedArgs.benchmarkProfileDir}`);

240+

}

241+183242

if (TMUX_DISABLE_VALUES.has(String(deps.env.OPENCLAW_GATEWAY_WATCH_TMUX ?? "").toLowerCase())) {

184243

return runForegroundWatcher({

185244

args: deps.args,