From b169952039ad3f8eb1aee605f1df960bd393fb4a Mon Sep 17 00:00:00 2001 From: dtzp555 Date: Fri, 1 May 2026 03:24:21 +1000 Subject: [PATCH] fix(cli): set DISABLE_AUTOUPDATER=1 in manual restart fallback MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When ocp restart falls back to nohup (no launchctl/systemd service registered), prepend DISABLE_AUTOUPDATER=1 so the spawned server.mjs and any claude subprocess it spawns skip the in-binary auto-updater check. Why: claude-code's native binary contains an auto-updater that fires after each successful invocation. Partial install.cjs failures during update leave bin/claude.exe as an ASCII shim → spawnSync ENOEXEC → OCP slot lockup (symptoms in #37, #40 forensics). Setting this env at the launch site stops the trigger. Note: only covers the manual nohup path. Users with launchctl plist or systemd unit must add the env there too (plist EnvironmentVariables or systemd Environment=). Authoritative settings location is ~/.claude/settings.json env key — see learnings/claude_code_disable_autoupdate.md in cc-rules for the full 4-layer guidance. Verified: 24h+ stable on Mac mini after applying full multi-layer fix on 2026-04-30 04:20 (claude.exe mtime unchanged, OCP uptime 22h54m, 0 errors over 3 real calls). No server.mjs change — ALIGNMENT.md unaffected. --- ocp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ocp b/ocp index 6e92cff..e652324 100755 --- a/ocp +++ b/ocp @@ -604,7 +604,7 @@ cmd_restart() { self_r="${BASH_SOURCE[0]}" while [[ -L "$self_r" ]]; do self_r="$(readlink "$self_r")"; done script_dir="$(cd "$(dirname "$self_r")" && pwd)" - nohup node "$script_dir/server.mjs" >> "$HOME/.ocp/logs/proxy.log" 2>&1 & + DISABLE_AUTOUPDATER=1 nohup node "$script_dir/server.mjs" >> "$HOME/.ocp/logs/proxy.log" 2>&1 & fi sleep 3 if curl -sf --max-time 5 "$PROXY/health" > /dev/null 2>&1; then