diff --git a/CHANGELOG.md b/CHANGELOG.md index 7e0f2912c88..4b1fc1900bd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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. diff --git a/docs/help/debugging.md b/docs/help/debugging.md index 073cfed9ce2..1e24d01dfc3 100644 --- a/docs/help/debugging.md +++ b/docs/help/debugging.md @@ -157,6 +157,9 @@ Use `--benchmark-dir ` 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`, diff --git a/scripts/gateway-watch-tmux.mjs b/scripts/gateway-watch-tmux.mjs index b7f4b95dbe3..0aab8cd034f 100644 --- a/scripts/gateway-watch-tmux.mjs +++ b/scripts/gateway-watch-tmux.mjs @@ -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 diff --git a/src/infra/gateway-watch-tmux.test.ts b/src/infra/gateway-watch-tmux.test.ts index 1e271eae8c1..99045a54cc1 100644 --- a/src/infra/gateway-watch-tmux.test.ts +++ b/src/infra/gateway-watch-tmux.test.ts @@ -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();