From 49c6d32e3b6c8eed999d62b609421e6f099b8b78 Mon Sep 17 00:00:00 2001 From: dtzp555-max Date: Wed, 13 May 2026 06:14:37 +1000 Subject: [PATCH] fix(scripts): default CLAUDE_PROXY_PORT to 3456 (completes v3.16.2 revert) (#97) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Three places in scripts/ still defaulted to 3478 after v3.16.2's plugin / manifest / README / plist revert: scripts/upgrade.mjs:137 scripts/doctor.mjs:84 scripts/doctor.mjs:205 These were the residual cascade source for the port-drift bug originally caused by the PR #71 dogfood accident on 2026-05-08 (see ~/.cc-rules/memory/learnings/subagent_setup_mjs_prod_host_collision.md and v3.16.2 CHANGELOG entry). Every `ocp doctor` / `ocp upgrade` invocation without an explicit `CLAUDE_PROXY_PORT` in env probed port 3478 — got "OCP not responding" against a healthy 3456 instance — and on the maintainer's host this cascaded into wrong baseUrl writes for the OpenClaw `claude-local` provider, taking out the OpenClaw Telegram agent ("大内总管") on 2026-05-13. This change is the smallest possible: three string literals `"3478"` → `"3456"`, aligning unset-env defaults with `server.mjs:126`. Env-set users are unaffected (env precedence is unchanged). cli.js: not applicable — this is a scripts/ change, not server.mjs. ALIGNMENT.md hard-requirements (cli.js citation, blacklist CI, independent reviewer) target server.mjs; this PR honors the SPOT spirit by ending the literal-port drift across the codebase. Bumps to v3.16.3. CHANGELOG entry added. Co-authored-by: dtzp555 --- CHANGELOG.md | 27 +++++++++++++++++++++++++++ package.json | 2 +- scripts/doctor.mjs | 4 ++-- scripts/upgrade.mjs | 2 +- 4 files changed, 31 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6d49022..0e3b2d5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,32 @@ # Changelog +## v3.16.3 — 2026-05-13 + +### Fixes — completes v3.16.2 port-drift revert + +v3.16.2 reverted the plugin / `openclaw.plugin.json` / README / Mac mini +plist back to `3456` (the historical source default since `593d0dc`), but +missed three places in `scripts/` that still defaulted to `3478`. Those +three lines were the residual cascade source: every time `ocp doctor` or +`ocp upgrade` ran without `CLAUDE_PROXY_PORT` in the env, they probed +`3478`, reported "OCP not responding" against a healthy 3456 instance, +and (in the case of OpenClaw sync follow-ups on the maintainer's host) +re-introduced 3478 into downstream config. + +Changes: + +- `scripts/upgrade.mjs:137` — default port `3478` → `3456`. +- `scripts/doctor.mjs:84` — default port `3478` → `3456`. +- `scripts/doctor.mjs:205` — default port `3478` → `3456`. + +No behavior change for users who set `CLAUDE_PROXY_PORT` explicitly; env +still takes precedence. The fix only affects the unset-env fallback, +which now matches `server.mjs:126` and the rest of the codebase. + +Test plan: existing `test-features.mjs` cases that pin +`CLAUDE_PROXY_PORT=3478` continue to pass — they use the env path, not +the default. + ## v3.16.2 — 2026-05-12 ### Fixes — corrects v3.16.1 diff --git a/package.json b/package.json index 562460a..47825d4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "open-claude-proxy", - "version": "3.16.2", + "version": "3.16.3", "description": "OCP (Open Claude Proxy) — use your Claude Pro/Max subscription as an OpenAI-compatible API for any IDE. Works with Cline, OpenCode, Aider, Continue.dev, OpenClaw, and more.", "type": "module", "bin": { diff --git a/scripts/doctor.mjs b/scripts/doctor.mjs index abe70b6..a88748b 100644 --- a/scripts/doctor.mjs +++ b/scripts/doctor.mjs @@ -81,7 +81,7 @@ export async function runDoctor(opts = {}) { health = opts.mockHealth; } else { try { - const port = process.env.CLAUDE_PROXY_PORT || "3478"; + const port = process.env.CLAUDE_PROXY_PORT || "3456"; const out = execSync(`curl -sf --max-time 3 http://127.0.0.1:${port}/health`, { stdio: ["pipe", "pipe", "pipe"] }).toString(); health = { status: 200, body: JSON.parse(out) }; } catch (e) { @@ -202,7 +202,7 @@ function runOauthOnly(opts, checks, push) { health = opts.mockHealth; } else { try { - const port = process.env.CLAUDE_PROXY_PORT || "3478"; + const port = process.env.CLAUDE_PROXY_PORT || "3456"; const out = execSync(`curl -sf --max-time 3 http://127.0.0.1:${port}/health`, { stdio: ["pipe", "pipe", "pipe"] }).toString(); health = { status: 200, body: JSON.parse(out) }; } catch (e) { diff --git a/scripts/upgrade.mjs b/scripts/upgrade.mjs index 7213509..d3db021 100644 --- a/scripts/upgrade.mjs +++ b/scripts/upgrade.mjs @@ -134,7 +134,7 @@ async function runFullUpgrade({ doctor, opts }) { // phase 6: post-flight (10s budget; skipped under mockExec) if (!opts.mockExec) { - const port = process.env.CLAUDE_PROXY_PORT || "3478"; + const port = process.env.CLAUDE_PROXY_PORT || "3456"; let ok = false; for (let i = 0; i < 10; i++) { try {