-
Notifications
You must be signed in to change notification settings - Fork 14
how to contribute debugging
Where DroidProxy writes logs, the common failure modes, and the tools for inspecting a running instance.
All lifecycle and runtime logging uses NSLog (not print/os_log). View it in Console.app, or stream it from the terminal:
log stream --predicate 'process == "CLIProxyMenuBar"' --infoFilter by the bracketed prefixes the code uses:
-
[ThinkingProxy]— proxy request handling, rewrites, routing. -
[ServerManager]— backend process lifecycle, config merge, login flows. -
[AuthStatus]— account parsing and auth state. -
[SettingsView]— settings UI actions.
ThinkingProxy writes a compact per-request line to /tmp/droidproxy-debug.log so you can see what Droid actually sent and what the proxy did, without dumping whole prompts:
tail -f /tmp/droidproxy-debug.logLine types to look for:
-
REQUEST REASONING:— the parsedreasoning/reasoning_effort/thinking/output_config/service_tier/generationConfigfor the request, e.g.REQUEST REASONING: model=gpt-5.5 reasoning={"effort":"xhigh","summary":"auto"}. Confirms the effort Droid is sending. -
REWRITE MODEL/REWRITE PATH— model-alias and Gemini/v1/responses→/v1/chat/completionsrewrites. -
INJECTED service_tier— fast-mode (service_tier=priority) injection for enabled Codex/GPT models. -
SANITIZED CLAUDE THINKING BLOCKS— whenClaudeThinkingBlockSanitizerremoved stale thinking blocks.
See Thinking proxy for the meaning of each rewrite.
The bundled CLIProxyAPI backend writes its own logs to ~/.cli-proxy-api/logs/. These are enabled by the Verbose logging toggle in the Settings window; the change is hot-reloaded into the running backend (no restart needed). Use these to inspect what the backend sent upstream and the upstream response. See Server manager.
If the menu-bar app crashes or is force-quit, the bundled backend can be left running and hold port 8318. ServerManager.killOrphanedProcesses clears these on startup via pgrep/pkill. To clear them by hand:
pgrep -fl cli-proxy-api
pkill -x cli-proxy-apidev-relaunch.sh already does this kill step before relaunching.
ThinkingProxy binds :8317 and the backend binds 127.0.0.1:8318. If either is taken (an orphaned process, or another app), startup fails. Find the holder:
lsof -nP -iTCP:8317 -sTCP:LISTEN
lsof -nP -iTCP:8318 -sTCP:LISTENIf a configured custom bind address fails to bind, the backend can fall back to listening on all interfaces. Check the [ServerManager] logs and the generated ~/.cli-proxy-api/merged-config.yaml host: value. Local backend traffic is intended to stay on 127.0.0.1:8318.
Accounts live as JSON files in ~/.cli-proxy-api/. If a login isn't picked up:
- Check the file exists and has a recognized
typefield:ls ~/.cli-proxy-api/*.jsonand inspecttype(claude,codex,gemini,kimi). -
AuthDirectoryMonitoris a debounced watcher — a change can take a moment to register. Adding, changing, or removing a JSON file fires theonChangecallback after the debounce window.
See Auth.
After clicking Apply in the Settings window to write the Factory custom-model config, restart Factory / Droid so it re-reads the model catalog. If models still don't appear, re-run Apply and restart again.
The backend exposes a management dashboard at:
http://127.0.0.1:8318/management.html
It requires remote management to be configured (the remote-access settings in the Settings window inject allow-remote / secret-key into the merged config). See Server manager.
flowchart TD
A[Something's wrong] --> B{App running?}
B -- No --> C[Check Console.app for CLIProxyMenuBar crash]
B -- Yes --> D{Requests failing?}
D -- Yes --> E[tail -f /tmp/droidproxy-debug.log]
E --> F{Wrong rewrite / tier / model?}
F -- Yes --> G[Inspect [ThinkingProxy] NSLog]
F -- No --> H[Enable Verbose logging, read ~/.cli-proxy-api/logs/]
D -- No --> I{Models missing in Factory?}
I -- Yes --> J[Re-run Apply, restart Factory]
I -- No --> K[Check ports 8317/8318 + orphaned cli-proxy-api]