fix(health): correct CLIProxy port detection on macOS/Linux

Two bugs caused the health check to incorrectly report "Proxy not running":

1. lsof command used mutually exclusive flags (-t and -F)
   - Removed -t flag since -F already provides structured output

2. isCLIProxyProcess whitelist was missing common binary names
   - Added: cliproxyapi, cli-proxy-api-plus (and .exe variants)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Shun Kakinoki
2025-12-26 19:42:23 +09:00
co-authored by Claude Opus 4.5
parent 2c977f686a
commit d1a0ebee61
+6 -2
View File
@@ -38,7 +38,7 @@ export async function getPortProcess(port: number): Promise<PortProcess | null>
*/
async function getPortProcessUnix(port: number): Promise<PortProcess | null> {
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,
});
@@ -117,7 +117,7 @@ export function isCLIProxyProcess(process: PortProcess | null): boolean {
return false;
}
// Match cli-proxy, cli-proxy.exe, cliproxy, cliproxy.exe, cli-proxy-api
// Match various CLIProxy binary names
const name = process.processName.toLowerCase();
return [
'cli-proxy',
@@ -126,6 +126,10 @@ export function isCLIProxyProcess(process: PortProcess | null): boolean {
'cliproxy.exe',
'cli-proxy-api',
'cli-proxy-api.exe',
'cliproxyapi',
'cliproxyapi.exe',
'cli-proxy-api-plus',
'cli-proxy-api-plus.exe',
].includes(name);
}