Repository navigation
fix(server): CLIProxyAPI hubs saved with their panel URL reach the management API - #30234
sidhartha1s wants to merge 2 commits into
Conversation
…nagement API Pasting the hub panel address (/management.html) as Hub URL built /management.html/v0/management/..., so every read got a 404. The API sits beside the panel page, so drop that page from the base before resolving. Fixes pingdotgg#28835 Written with Claude Opus 5.5 in Claude Code. Co-Authored-By: Claude <noreply@anthropic.com>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
ApprovabilityVerdict: Approved at Macroscope's review found this PR approvable — Hub URLs ending in /management.html now resolve to the adjacent management API while retaining their origin and deployment prefix. Existing authentication and reset-credit controls are unchanged, keeping the impact limited to endpoint resolution. Notes:
You can add or adjust custom eligibility rules. Learn more. |
|
Note Written by merged current main into the existing head without rebasing. resolved the management-url conflict by retaining main's hub parameter and the contributor's panel-path normalization. the diff remains two files, with authentication and deployment prefixes preserved. verified |
Problem
Settings → Add a CLIProxyAPI hub accepts the hub's management panel address, for example
https://hub.example.com/management.html. That is the address users have open in the browser, so it is the one they paste. The usage reader then requestshttps://hub.example.com/management.html/v0/management/auth-files. The hub answers 404, and Limits shows only "The hub answered with HTTP 404." The management key is correct. The same key works once the URL is changed to the bare origin.Fixes #28835
Change
CliproxyApi.managementbuilds every management request. It now drops a trailing/management.htmlfrom the hub URL's path before resolvingv0/management/<path>against it. The API sits beside the panel page, so a hub under a path prefix (https://tools.test/cliproxy/management.html) still resolves to/cliproxy/v0/management/....This is done at request time, so hubs already saved with the panel URL work without re-entering them. No contract, client, or settings change is needed.
Scope and approval
This is a very small, focused fix for an obvious bug: one URL is resolved in the wrong place, so every request from a hub saved with its panel address fails. It changes no defaults and adds no option. A hub URL that does not end in
/management.htmlresolves exactly as before.Verification
apps/server/src/usage/cliproxyApi.test.tsinto a table with a…/cliproxy/management.htmlrow.mainthat row fails:Tests 1 failed | 2 passed | 16 skipped.vp test run src/usage/cliproxyApi.test.ts→Tests 18 passed (18).vp run typecheckinapps/server: pass.vp run check:changed: format, lint, knip and graphql pass.check:changedfails to optimize dependencies because the repo path contains a space (Automation%20Projects). That step does not touch these files.Written with Claude Opus 5.5 in Claude Code.