proxypilot: prefer proxypilot-engine + renamed launcher logs

This commit is contained in:
Finessse
2025-12-18 17:20:25 +07:00
parent f022b151c2
commit c2118c28c9
13 changed files with 42 additions and 30 deletions
+1 -2
View File
@@ -75,7 +75,7 @@ Wails can call `internal/desktopctl` directly; Tauri can call `cliproxyctl`.
### Logs / request diagnostics
- Open logs folder.
- Tail last N lines of `cliproxyapi.out.log` and `cliproxyapi.err.log`.
- Tail last N lines of `proxypilot-engine.out.log` and `proxypilot-engine.err.log`.
- “Copy diagnostics” button that includes:
- app version, proxy version
- config path, port, pid
@@ -126,4 +126,3 @@ Windows and macOS implementations can live in separate files via Go build tags:
- Should the desktop app bundle the engine binary, or manage an existing install?
- Do we want a dedicated “desktop control” HTTP endpoint in the proxy (vs local process control only)?
+2 -2
View File
@@ -65,6 +65,6 @@ ProxyPilot tray app includes:
Useful paths:
- `logs/cliproxyapi.out.log`
- `logs/cliproxyapi.err.log`
- `logs/proxypilot-engine.out.log`
- `logs/proxypilot-engine.err.log`
- `logs/v1-responses-*.log` / `logs/v1-chat-completions-*.log` (request logs, if enabled)
+1 -2
View File
@@ -46,7 +46,7 @@ This is the Windows-specific portion of the desktop UI plan. Shared (cross-platf
- Build (optional): build `cmd/server` into `bin/cliproxyapi-latest.exe`.
- Start:
- Uses a selectable config path (default: repo `config.yaml` if present).
- Writes logs to `logs/cliproxyapi.out.log` and `logs/cliproxyapi.err.log`.
- Writes logs to `logs/proxypilot-engine.out.log` and `logs/proxypilot-engine.err.log`.
- Stop:
- Prefer graceful stop; fallback to kill process if needed.
- Restart.
@@ -169,4 +169,3 @@ Windows-specific notes:
- endpoint reachable with `GET /v1/models` returning 200
- Open logs opens the correct folder.
- Copy base URL copies `http://127.0.0.1:<port>` (and optionally `/v1`).
@@ -33,9 +33,9 @@ func (h *Handler) GetProxyPilotLogTail(c *gin.Context) {
var name string
switch kind {
case "stdout", "out":
name = "cliproxyapi.out.log"
name = "proxypilot-engine.out.log"
case "stderr", "err":
name = "cliproxyapi.err.log"
name = "proxypilot-engine.err.log"
default:
c.JSON(http.StatusBadRequest, gin.H{"error": "invalid file (use stdout|stderr)"})
return
@@ -110,8 +110,8 @@ func (h *Handler) GetProxyPilotDiagnostics(c *gin.Context) {
b.WriteString("\n")
}
addTail("Launcher Stdout", "cliproxyapi.out.log")
addTail("Launcher Stderr", "cliproxyapi.err.log")
addTail("Launcher Stdout", "proxypilot-engine.out.log")
addTail("Launcher Stderr", "proxypilot-engine.err.log")
c.JSON(http.StatusOK, gin.H{"text": b.String()})
}
+2 -2
View File
@@ -103,8 +103,8 @@ func Start(opts StartOptions) (Status, error) {
return Status{}, err
}
stdoutLog := filepath.Join(logDir, "cliproxyapi.out.log")
stderrLog := filepath.Join(logDir, "cliproxyapi.err.log")
stdoutLog := filepath.Join(logDir, "proxypilot-engine.out.log")
stderrLog := filepath.Join(logDir, "proxypilot-engine.err.log")
stdoutFile, err := os.OpenFile(stdoutLog, os.O_CREATE|os.O_WRONLY|os.O_APPEND, 0o644)
if err != nil {
+12
View File
@@ -11,12 +11,24 @@ func pickDefaultExePath(repoRoot string) string {
return ""
}
if runtime.GOOS == "windows" {
// New preferred engine name (ProxyPilot branding).
preferred := filepath.Join(repoRoot, "bin", "proxypilot-engine.exe")
if _, err := os.Stat(preferred); err == nil {
return preferred
}
// Back-compat fallbacks.
latest := filepath.Join(repoRoot, "bin", "cliproxyapi-latest.exe")
if _, err := os.Stat(latest); err == nil {
return latest
}
return filepath.Join(repoRoot, "bin", "cliproxyapi.exe")
}
// New preferred engine name (ProxyPilot branding).
preferred := filepath.Join(repoRoot, "bin", "proxypilot-engine")
if _, err := os.Stat(preferred); err == nil {
return preferred
}
// Back-compat fallbacks.
latest := filepath.Join(repoRoot, "bin", "cliproxyapi-latest")
if _, err := os.Stat(latest); err == nil {
return latest
+2 -2
View File
@@ -17,8 +17,8 @@ This builds `bin/cliproxyapi-latest`.
- Restart: `./scripts/restart.sh`
Logs:
- `logs/cliproxyapi.out.log`
- `logs/cliproxyapi.err.log`
- `logs/proxypilot-engine.out.log`
- `logs/proxypilot-engine.err.log`
## Auto-start at login (launchd)
@@ -55,9 +55,9 @@ cat >"$plist_path" <<EOF
<true/>
<key>StandardOutPath</key>
<string>${logs_dir}/cliproxyapi.out.log</string>
<string>${logs_dir}/proxypilot-engine.out.log</string>
<key>StandardErrorPath</key>
<string>${logs_dir}/cliproxyapi.err.log</string>
<string>${logs_dir}/proxypilot-engine.err.log</string>
</dict>
</plist>
EOF
@@ -68,4 +68,3 @@ launchctl bootstrap "gui/${uid}" "$plist_path"
launchctl kickstart -k "gui/${uid}/${label}" >/dev/null 2>&1 || true
echo "Installed LaunchAgent: $plist_path"
+2 -3
View File
@@ -9,8 +9,8 @@ if [[ -f "$latest_exe" ]]; then exe="$latest_exe"; fi
config_path="$repo_root/config.yaml"
logs_dir="$repo_root/logs"
stdout_log="$logs_dir/cliproxyapi.out.log"
stderr_log="$logs_dir/cliproxyapi.err.log"
stdout_log="$logs_dir/proxypilot-engine.out.log"
stderr_log="$logs_dir/proxypilot-engine.err.log"
pid_file="$logs_dir/cliproxyapi.pid"
mkdir -p "$logs_dir"
@@ -61,4 +61,3 @@ echo "$pid" >"$pid_file"
echo "Started (PID $pid). Tail logs:"
echo " tail -f \"$stdout_log\""
+2 -2
View File
@@ -19,8 +19,8 @@ This will:
- Restart: `powershell -NoProfile -ExecutionPolicy Bypass -File .\scripts\restart-cliproxy.ps1`
Logs:
- `logs\cliproxyapi.out.log`
- `logs\cliproxyapi.err.log`
- `logs\proxypilot-engine.out.log`
- `logs\proxypilot-engine.err.log`
## Auto-start at logon (Windows)
+4 -1
View File
@@ -7,7 +7,8 @@ function Get-RepoRoot {
$repoRoot = Get-RepoRoot
$outDir = Join-Path $repoRoot "bin"
$outPath = Join-Path $outDir "cliproxyapi-latest.exe"
$outPath = Join-Path $outDir "proxypilot-engine.exe"
$compatPath = Join-Path $outDir "cliproxyapi-latest.exe"
if (-not (Test-Path -LiteralPath $outDir)) {
New-Item -ItemType Directory -Path $outDir | Out-Null
@@ -15,10 +16,12 @@ if (-not (Test-Path -LiteralPath $outDir)) {
Write-Host "Building CLIProxyAPI..."
Write-Host " out: $outPath"
Write-Host " compat: $compatPath"
Push-Location $repoRoot
try {
go build -o $outPath .\cmd\server
Copy-Item -Force -LiteralPath $outPath -Destination $compatPath
} finally {
Pop-Location
}
+7 -6
View File
@@ -12,18 +12,19 @@ function Ensure-Dir([string]$Path) {
}
$repoRoot = Get-RepoRoot
$defaultExePath = Join-Path $repoRoot "bin\\cliproxyapi.exe"
$preferredExePath = Join-Path $repoRoot "bin\\proxypilot-engine.exe"
$latestExePath = Join-Path $repoRoot "bin\\cliproxyapi-latest.exe"
$exePath = if (Test-Path -LiteralPath $latestExePath) { $latestExePath } else { $defaultExePath }
$defaultExePath = Join-Path $repoRoot "bin\\cliproxyapi.exe"
$exePath = if (Test-Path -LiteralPath $preferredExePath) { $preferredExePath } elseif (Test-Path -LiteralPath $latestExePath) { $latestExePath } else { $defaultExePath }
$configPath = Join-Path $repoRoot "config.yaml"
$logsDir = Join-Path $repoRoot "logs"
Ensure-Dir $logsDir
$stdoutLog = Join-Path $logsDir "cliproxyapi.out.log"
$stderrLog = Join-Path $logsDir "cliproxyapi.err.log"
$stdoutLog = Join-Path $logsDir "proxypilot-engine.out.log"
$stderrLog = Join-Path $logsDir "proxypilot-engine.err.log"
if (-not (Test-Path -LiteralPath $exePath)) {
throw "Binary not found: $exePath. Build it with: go build -o bin\\cliproxyapi.exe .\\cmd\\server (or: scripts\\build-cliproxyapi.ps1)."
throw "Binary not found: $exePath. Build it with: scripts\\windows\\build-cliproxyapi.ps1"
}
if (-not (Test-Path -LiteralPath $configPath)) {
throw "Config not found: $configPath"
@@ -45,7 +46,7 @@ if ($existing) {
return
}
Write-Host "Starting CLIProxyAPI..."
Write-Host "Starting ProxyPilot Engine..."
Write-Host " exe: $exePath"
Write-Host " config: $configPath"
Write-Host " logs: $logsDir"
+1 -1
View File
@@ -1,7 +1,7 @@
Set-StrictMode -Version Latest
$ErrorActionPreference = "Stop"
$procNames = @("cliproxyapi", "cliproxyapi-latest")
$procNames = @("proxypilot-engine", "cliproxyapi", "cliproxyapi-latest")
$procs = @()
foreach ($name in $procNames) {
$procs += @(Get-Process -Name $name -ErrorAction SilentlyContinue)