From e984a99c7e004cafaaca32dbc2ee9e6508283721 Mon Sep 17 00:00:00 2001 From: Kevin Lin Date: Thu, 7 May 2026 16:40:35 -0700 Subject: [PATCH] fix: keep gateway watch sync tracing opt-in (#79110) --- CHANGELOG.md | 5 +++-- docs/help/debugging.md | 6 +++--- scripts/watch-node.mjs | 3 --- src/infra/watch-node.test.ts | 10 +++++++++- 4 files changed, 15 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4d5847bba62d..9dc22ce9d0fd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -73,7 +73,7 @@ Docs: https://docs.openclaw.ai - Gateway/performance: avoid resolving plugin auto-enable metadata twice in one runtime config pass, reducing repeated dashboard turn metadata scans. Thanks @shakkernerd. - Auth/providers: pass `config` and `workspaceDir` lookup context through to provider-id resolution so workspace-scoped auth aliases resolve correctly when no explicit alias map is supplied. Thanks @shakkernerd. - Gateway/performance: avoid importing `jiti` on native-loadable plugin startup paths, so compiled bundled plugin surfaces do not pay source-transform loader cost unless fallback loading is actually needed. -- Gateway/diagnostics: add startup phase spans, active work labels, stale terminal bridge markers, and default sync-I/O tracing in `pnpm gateway:watch` so slow Gateway turns are easier to attribute from logs and stability diagnostics. +- Gateway/diagnostics: add startup phase spans, active work labels, stale terminal bridge markers, and opt-in sync-I/O tracing in `pnpm gateway:watch` so slow Gateway turns are easier to attribute from logs and stability diagnostics. - Plugins/loader: preserve real compiled plugin module evaluation errors on the native fast path instead of treating every thrown `.js` module as a source-transform fallback miss. Thanks @vincentkoc. - QA/Mantis: add `pnpm openclaw qa mantis slack-desktop-smoke` to run Slack live QA inside a Crabbox VNC desktop, open Slack Web, and capture desktop screenshots beside the Slack QA artifacts. - QA/Mantis: add an opt-in Discord thread attachment before/after scenario that creates a real thread, calls `message.thread-reply` with `filePath`, and captures baseline/candidate screenshot evidence. @@ -127,7 +127,7 @@ Docs: https://docs.openclaw.ai - Plugins/runtime state: add `registerIfAbsent` for atomic keyed-store dedupe claims that return whether a plugin successfully claimed a key without overwriting an existing live value. Thanks @amknight. - Exec approvals: add a tree-sitter-backed shell command explainer for future approval and command-review surfaces. (#75004) Thanks @jesse-merhi. - Control UI/performance: record browser long animation frame or long task entries in the debug event log when supported, making slow dashboard renders easier to attribute from the UI. -- Gateway/diagnostics: add startup phase spans, active work labels, stale terminal bridge markers, and default sync-I/O tracing in `pnpm gateway:watch` so slow Gateway turns are easier to attribute from logs and stability diagnostics. +- Gateway/diagnostics: add startup phase spans, active work labels, stale terminal bridge markers, and opt-in sync-I/O tracing in `pnpm gateway:watch` so slow Gateway turns are easier to attribute from logs and stability diagnostics. - QA/Codex harness: add targeted live Docker/Testbox diagnostics, auth preflight checks, cache mount fixes, and app-server protocol checkout discovery so maintainer harness failures are easier to reproduce. Thanks @vincentkoc. - QA/Mantis: add `pnpm openclaw qa mantis slack-desktop-smoke` to run Slack live QA inside a Crabbox VNC desktop, open Slack Web, and capture desktop screenshots beside the Slack QA artifacts. - QA/Mantis: add visual desktop tasks with Crabbox MP4 recording, screenshot capture, and optional image-understanding assertions, and preserve video artifacts in Mantis before/after reports. @@ -156,6 +156,7 @@ Docs: https://docs.openclaw.ai ### Fixes +- Gateway/watch: leave `OPENCLAW_TRACE_SYNC_IO` disabled by default in `pnpm gateway:watch:raw` so watch mode avoids noisy Node sync-I/O stack traces unless explicitly requested. - Providers: preserve non-OK `text/event-stream` response bodies so provider HTTP errors keep their JSON detail instead of collapsing to generic streaming failures. Fixes #78180. - Gateway/auth: make explicit `trusted-proxy` mode fail closed instead of accepting local password fallback credentials after trusted-proxy identity checks fail. Fixes #78684. - Active memory: treat Google Chat `spaces/...` conversation ids as scoped targets instead of runnable channel names so recall runs no longer fail bundled-plugin dirName validation. Fixes #78918. diff --git a/docs/help/debugging.md b/docs/help/debugging.md index eeafe463894a..c3e110a07d15 100644 --- a/docs/help/debugging.md +++ b/docs/help/debugging.md @@ -96,9 +96,9 @@ add Node's sync I/O trace flag through the source runner: OPENCLAW_TRACE_SYNC_IO=1 pnpm openclaw gateway --force ``` -`pnpm gateway:watch` enables this flag by default for the watched Gateway child. -Set `OPENCLAW_TRACE_SYNC_IO=0` to suppress Node sync I/O trace output in watch -mode. +`pnpm gateway:watch` leaves this flag disabled by default for the watched +Gateway child. Set `OPENCLAW_TRACE_SYNC_IO=1` when you explicitly want Node +sync I/O trace output in watch mode. ## Gateway watch mode diff --git a/scripts/watch-node.mjs b/scripts/watch-node.mjs index da64b7cff0ab..6cb65d6dbc91 100644 --- a/scripts/watch-node.mjs +++ b/scripts/watch-node.mjs @@ -277,9 +277,6 @@ export async function runWatchMain(params = {}) { // The watcher owns process restarts; keep SIGUSR1/config reloads in-process // so inherited launchd/systemd markers do not make the child exit and stall. childEnv.OPENCLAW_NO_RESPAWN = "1"; - if (isGatewayWatchCommand(deps.args) && childEnv.OPENCLAW_TRACE_SYNC_IO === undefined) { - childEnv.OPENCLAW_TRACE_SYNC_IO = "1"; - } if (deps.args.length > 0) { childEnv.OPENCLAW_WATCH_COMMAND = deps.args.join(" "); } diff --git a/src/infra/watch-node.test.ts b/src/infra/watch-node.test.ts index 84fff891353a..b05d5955c125 100644 --- a/src/infra/watch-node.test.ts +++ b/src/infra/watch-node.test.ts @@ -143,11 +143,19 @@ describe("watch-node script", () => { OPENCLAW_WATCH_MODE: "1", OPENCLAW_WATCH_SESSION: "1700000000000-4242", OPENCLAW_NO_RESPAWN: "1", - OPENCLAW_TRACE_SYNC_IO: "1", OPENCLAW_WATCH_COMMAND: "gateway --force", }), }), ); + expect(spawn).toHaveBeenCalledWith( + "/usr/local/bin/node", + ["scripts/run-node.mjs", "gateway", "--force"], + expect.objectContaining({ + env: expect.not.objectContaining({ + OPENCLAW_TRACE_SYNC_IO: expect.any(String), + }), + }), + ); fakeProcess.emit("SIGINT"); const exitCode = await runPromise; expect(exitCode).toBe(130);