diff --git a/CHANGELOG.md b/CHANGELOG.md index 9c0035f4..b7791b0e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +## [7.7.1](https://github.com/kaitranntt/ccs/compare/v7.7.0...v7.7.1) (2025-12-26) + +### Bug Fixes + +* **health:** correct CLIProxy port detection on macOS/Linux ([d1a0ebe](https://github.com/kaitranntt/ccs/commit/d1a0ebee61b8987df85c328d359967e46d1e5226)) +* **health:** use prefix matching for Linux process name truncation ([91e7b9f](https://github.com/kaitranntt/ccs/commit/91e7b9f93787e5b2d45bffdaed75e75c151281e4)) + ## [7.7.0](https://github.com/kaitranntt/ccs/compare/v7.6.0...v7.7.0) (2025-12-25) ### Features diff --git a/package.json b/package.json index f1cfcbba..e2edad01 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@kaitranntt/ccs", - "version": "7.7.0-dev.5", + "version": "7.7.1", "description": "Claude Code Switch - Instant profile switching between Claude Sonnet 4.5 and GLM 4.6", "keywords": [ "cli", diff --git a/src/utils/port-utils.ts b/src/utils/port-utils.ts index e3351ac2..2359f1ab 100644 --- a/src/utils/port-utils.ts +++ b/src/utils/port-utils.ts @@ -38,7 +38,7 @@ export async function getPortProcess(port: number): Promise */ async function getPortProcessUnix(port: number): Promise { try { - const { stdout } = await execAsync(`lsof -i :${port} -sTCP:LISTEN -t -F pcn`, { + const { stdout } = await execAsync(`lsof -i :${port} -sTCP:LISTEN -F pcn`, { timeout: 3000, }); @@ -111,22 +111,17 @@ async function getPortProcessWindows(port: number): Promise /** * Check if process is CLIProxy + * Uses prefix matching to handle Linux kernel's 15-char process name truncation + * (e.g., 'cli-proxy-api-plus' becomes 'cli-proxy-api-p' in lsof/ps output) */ export function isCLIProxyProcess(process: PortProcess | null): boolean { if (!process) { return false; } - // Match cli-proxy, cli-proxy.exe, cliproxy, cliproxy.exe, cli-proxy-api const name = process.processName.toLowerCase(); - return [ - 'cli-proxy', - 'cli-proxy.exe', - 'cliproxy', - 'cliproxy.exe', - 'cli-proxy-api', - 'cli-proxy-api.exe', - ].includes(name); + // All CLIProxy variants start with 'cli-proxy' or 'cliproxy' + return name.startsWith('cli-proxy') || name.startsWith('cliproxy'); } /**