From d7349a1c6c4e32985841f9090d52ef3a15f3b561 Mon Sep 17 00:00:00 2001 From: Garry Tan Date: Fri, 17 Apr 2026 05:54:17 +0800 Subject: [PATCH] fix: honor BROWSE_PARENT_PID=0 with trailing whitespace MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The strict string compare `process.env.BROWSE_PARENT_PID === '0'` meant any stray newline or whitespace (common from shell `export` in a pipe or heredoc) would fail the check and re-enable the watchdog against the caller's intent. Switch to parseInt + === 0, matching the server's own parseInt at server.ts:760. Handles '0', '0\n', ' 0 ', and unset correctly; non-numeric values (parseInt returns NaN, NaN === 0 is false) fail safe — watchdog stays active, which is the safe default for unexpected input. Surfaced by /ship's adversarial subagent. Co-Authored-By: Claude Opus 4.7 (1M context) --- browse/src/cli.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/browse/src/cli.ts b/browse/src/cli.ts index e0906f04..eb58cd7d 100644 --- a/browse/src/cli.ts +++ b/browse/src/cli.ts @@ -214,7 +214,9 @@ async function startServer(extraEnv?: Record): Promise