Repository navigation
Conversation
…ws accounts A hub saved as its management API base (`.../v0/management`, with or without a trailing slash or path prefix) made every management call go to `/v0/management/v0/management/...`, so the hub answered 404 and Usage showed no accounts. Strip a trailing `/v0/management` along with `/management.html` before resolving the management path. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ApprovabilityVerdict: Approved at Macroscope's review found this PR approvable — This fixes hub account and usage access when the saved URL ends in /v0/management. Requests retain the same origin, credentials and existing action safeguards; no product defaults change. You can add or adjust custom eligibility rules. Learn more. |
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
|
Note Written by Verified in a real dev environmentpartial verification on linux with real CLIProxyAPI 8.0.48, no mocks or demo data. tested added the hub through settings → providers with the doubled request path is reproduced on main and corrected on the pr through the running client/server path. this does not prove successful account loading, for the credential reason below. created a project pointing at the real main git worktree through the app and completed real codex
Not verifiedsuccessful account loading, account usage, credits and reset consumption remain blocked. the VM provides a provider API key, which the real proxy rejects as a management key (401, then 403 on subsequent requests). management authentication masks the original 404 symptom on this proxy, so only the doubled path was reproduced. stopped management requests rather than substituting fake accounts or claiming success. a valid management credential is needed to complete this verification. local codex usage also reports JSON-RPC -32600 on both revisions, although real provider turns work. native desktop, iOS/Android, other providers, path-prefix deployments and remote/tunnel connections were not exercised. the existing tests cover the URL variants, but are not real deployment evidence. |
|
Note 🤖 Opus 5.5 replying on behalf of Victor. Thanks @maria-rcks. Your run on a real CLIProxyAPI 8.0.48 release covers a gap the PR body left open: until now the doubled path was shown only against a stand-in hub. Your request capture shows main sending You're right that account loading on a real release is still unproven. Without a management key the proxy answers 401/403 before it ever gets to the path. Nobody needs to share a key to close that gap. |
|
Note 🤖 Opus 5.5 replying on behalf of Victor. Follow-up on the part that was still open: accounts actually loading. We ran
Account avatars show only initials. The Codex -32600 line comes from the test machine's local Codex CLI, as in the PR body. Before ( After (head): |
|
Note 🤖 Opus 5.5 replying on behalf of Victor. Closing this: it is not a bug fix, and this repository now takes only bug fixes from outside contributors. The branch stays on my fork if it is useful. |




Problem
CLIProxyAPI serves its management API under
/v0/management. That base URL is the obvious thing to paste next to a management key. A hub saved that way (https://hub.example.com/v0/management, with or without a trailing/or a path prefix) gets no accounts in Usage → Limits. Every management call goes to/v0/management/v0/management/..., the hub answers 404, and the only message is "The hub answered with HTTP 404." The account list, usage, credits and Use reset calls all fail the same way.The Add hub dialog saves the URL as typed, so the server is the one place that sees every saved form, including older hubs and hand-edited
settings.json.Change
CliproxyApi.managementalready strips a trailing/management.html(#25579) before resolvingv0/management/<path>relative to the hub URL (#19336). This adds/v0/managementto that same trailing-suffix strip. Prefix hubs keep their prefix (/cliproxy/v0/management→/cliproxy/), and a path such as/team-management.htmlis still left alone.The existing "keeps the path of a hub served under a prefix" table gets the
/cliproxy/v0/managementand/cliproxy/v0/management/rows. ItsstartsWith("/cliproxy/v0/management/")check also matched the doubled path, so the table now also checks that the first request is exactly/cliproxy/v0/management/auth-files.Scope and approval
This is a small, focused fix for an obvious bug. It qualifies for the no-prior-issue exception: one regex alternative in the URL normalization that #25579 added, plus two test rows. No client, contract or settings change. #28835 reported the related
management.htmlform, which #25579 fixed. Nothing on main covers the/v0/managementform.Verification
vp test run src/usage/cliproxyApi.test.tsfromapps/server:Tests 2 failed | 26 passed (28). Both failures are the new rows: expected/cliproxy/v0/management/auth-files, received/cliproxy/v0/management/v0/management/auth-files.Tests 28 passed (28).vp run check:changed a9e709f15passed: format, lint, knip, typecheck and tests.Real hub on desktop, iOS and Android. I ran
main(1c65ad032e), then this head (1e4debc22b), then this head merged locally withmain(3605a3edf2). For each, I started the Linux desktop app (vp run dev:desktop, Electron under Xvfb) in a fresh test home and added a running CLIProxyAPI hub in Settings → Providers → Add hub by its/v0/managementURL and a valid management key. Desktop input was sent through the debugging port. In a second desktop run per revision, I paired an iOS 26.5 simulator and an Android 16 emulator (software rendering, SwiftShader) to its server and tapped through the T3 Device panel. Both ranmain's app, as the change is server-only. The runs only read from the hub.On
main, all three show only "Test hub: The hub answered with HTTP 404."On this head, all three list the hub's accounts with no hub error. Account labels are initials only.
The head merged with
main(3605a3edf2) shows the same list on all three surfaces; captures kept in my record.The earlier web run against a real hub, and the stand-in hub (stub) run for the request log
Real hub. I ran
vp run devonmain(4c36119) and on this head (1e4debc22b), each in a fresh test home, against a running CLIProxyAPI hub with a valid management key, saved with its/v0/managementURL, and opened Usage → Limits. How that page was driven was not recorded. The run only read from the hub.Before, on
main: no accounts, only "Test hub: The hub answered with HTTP 404."After, on this head: Usage → Limits lists the hub's Claude and Codex accounts with their weekly and session windows. The account count matches the hub's own
auth-fileslist. Avatars show initials only.The "Codex could not read usage (JSON-RPC -32600)" line in these web captures comes from the test machine's local Codex CLI, which has no login there. It is unrelated to the hub.
maria-rcks's run drove the web client with Playwright through the debugging port against CLIProxyAPI 8.0.48:
/v0/management/v0/management/auth-fileson main (4c36119),/v0/management/auth-fileson this head (1e4debc22b).Stand-in hub (stub), for the request log. Same steps on
main(a9e709f15) and this head (1e4debc22b) in the T3 Browser panel, with a local stand-in hub on127.0.0.1that answers only/v0/management/*and returns two fake Codex accounts. The hub was added in Settings → Providers → Add hub with this URL and a fake key:Before, on
main: only the 404 for the hub. The stand-in hub loggedGET /v0/management/v0/management/auth-files.After, on this head: the same saved hub shows its two fake accounts, and the card names the hub as its source. The stand-in hub logged
GET /v0/management/auth-filesandPOST /v0/management/api-call.Not checked: the macOS and Windows desktop apps.
Prior PRs
management.htmlform only and was closed without merging.Generated with Claude Opus 5.5 in T3 Code Nightly