fix(gateway): quiet benchmark watch output

This commit is contained in:
Peter Steinberger
2026-05-04 23:36:18 +01:00
parent f042b53782
commit f8e080386d
4 changed files with 31 additions and 0 deletions

View File

@@ -59,6 +59,7 @@ Docs: https://docs.openclaw.ai
### Fixes
- Gateway/watch: suppress sync-I/O trace output during `pnpm gateway:watch --benchmark` unless explicitly requested, so CPU profiling no longer floods the terminal with stack traces.
- Agents/OpenAI: default direct OpenAI Responses models to the SSE transport instead of WebSocket auto-selection, preventing pi runtime chat turns from hanging on servers where the WebSocket path stalls while the OpenAI HTTP stream works. Thanks @vincentkoc.
- Channels/plugins: key bundled package-state probes, env/config presence, and read-only command defaults by channel id instead of manifest plugin id, preserving setup and native-command detection for channel plugins whose package id differs from the channel alias. Thanks @vincentkoc.
- Docker: prune package-excluded plugin dist directories from runtime images unless the build explicitly opts that plugin in, so official external plugins such as Feishu stay install-on-demand instead of shipping partial metadata without compiled runtime output. Fixes #77424. Thanks @vincentkoc.

View File

@@ -157,6 +157,9 @@ Use `--benchmark-dir <path>` when you want profiles somewhere else.
Use `--benchmark-no-force` when you want the benchmarked child to skip the
default `--force` port cleanup and fail fast if the Gateway port is already in
use.
Benchmark mode suppresses sync-I/O trace spam by default. Set
`OPENCLAW_TRACE_SYNC_IO=1` with `--benchmark` when you explicitly want both CPU
profiles and Node sync-I/O stack traces.
The tmux wrapper carries common non-secret runtime selectors such as
`OPENCLAW_PROFILE`, `OPENCLAW_CONFIG_PATH`, `OPENCLAW_STATE_DIR`,

View File

@@ -97,6 +97,7 @@ const resolveGatewayWatchBenchmarkArgs = ({ args = [], env = process.env } = {})
if (benchmarkFlagSeen) {
nextEnv[RUN_NODE_CPU_PROF_DIR_ENV] =
benchmarkDir || nextEnv[RUN_NODE_CPU_PROF_DIR_ENV] || DEFAULT_BENCHMARK_PROFILE_DIR;
nextEnv.OPENCLAW_TRACE_SYNC_IO ??= "0";
}
return {
args: benchmarkNoForceSeen

View File

@@ -89,6 +89,7 @@ describe("gateway-watch tmux wrapper", () => {
expect(code).toBe(0);
const command = spawnSync.mock.calls[1]?.[1]?.[6] as string;
expect(command).toContain("'OPENCLAW_RUN_NODE_CPU_PROF_DIR=.artifacts/gateway-watch-profiles'");
expect(command).toContain("'OPENCLAW_TRACE_SYNC_IO=0'");
expect(command).not.toContain("--benchmark");
expect(command).toContain("'gateway'");
expect(command).toContain("'--force'");
@@ -97,6 +98,31 @@ describe("gateway-watch tmux wrapper", () => {
);
});
it("preserves explicit sync I/O tracing in benchmark mode", () => {
const stdout = createOutput();
const stderr = createOutput();
const spawnSync = vi
.fn()
.mockReturnValueOnce({ status: 1, stdout: "", stderr: "" })
.mockReturnValueOnce({ status: 0, stdout: "", stderr: "" })
.mockReturnValueOnce({ status: 0, stdout: "", stderr: "" })
.mockReturnValueOnce({ status: 0, stdout: "", stderr: "" });
const code = runGatewayWatchTmuxMain({
args: ["gateway", "--force", "--benchmark"],
cwd: "/repo",
env: { OPENCLAW_TRACE_SYNC_IO: "1", SHELL: "/bin/zsh" },
nodePath: "/node",
spawnSync,
stderr: stderr.stream,
stdout: stdout.stream,
});
expect(code).toBe(0);
const command = spawnSync.mock.calls[1]?.[1]?.[6] as string;
expect(command).toContain("'OPENCLAW_TRACE_SYNC_IO=1'");
});
it("can remove --force from benchmarked watch runs", () => {
const stdout = createOutput();
const stderr = createOutput();