fix(web): point provider calls at routes that exist - #105
Conversation
The web client posted to POST /providers, DELETE /providers/{id} and
POST /providers/{id}:refresh. None of those routes were ever registered, so
adding an API key from the desktop app returned 404 and a new user could not
configure a provider at all.
Adding a provider now writes one POST /config patch carrying the provider, a
model alias and default_model, which is what GET /auth needs before it reports
ready. Refresh reads the real GET /providers/{id}.
Removal cannot go through POST /config, because the config patch deep-merges and
strips undefined, so a key can never be cleared. A removePythinkerProvider RPC
already existed with no HTTP route; this adds DELETE /providers/{provider_id}
wired to it, which also cleans up model aliases pointing at the removed provider.
|
Warning Review limit reached
Next review available in: 23 minutes Limit details: You’ve used all 3 included reviews currently available under your plan. Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (9)
Comment |
commit: |
|
Closing: merged locally into main; a new PR will follow. |
Related Issue
No issue. The problem is described below.
Problem
Three of the four provider calls in the web client pointed at routes that do not exist.
addProviderposted to/providers,deleteProviderdeleted/providers/{id}, andrefreshProviderposted to/providers/{id}:refresh, while the server registers onlyGET /providersandGET /providers/{provider_id}. The client marked the whole block "PRESUMED". The result is that "Add provider" in the web UI could not work against a real daemon, which is the first thing a new user reaches on a fresh install.What changed
addProviderwrites onePOST /configpatch carrying the provider, a model alias, anddefault_model, then reads the created provider back.refreshProviderre-readsGET /providers/{id}.deleteProvidercalls a newDELETE /providers/{provider_id}route. Removal cannot go throughPOST /config: the config patch is a deep merge andundefinedis stripped, so a key can never be removed that way. The route is wired to the existingremovePythinkerProviderRPC, which also drops the model aliases that referenced the provider.Verified locally: 3594 agent-core tests, 512 server tests, 329 web tests, three typechecks, and lint all pass.
Checklist
gen-changesetsskill, or this PR needs no changeset.gen-docsskill, or this PR needs no doc update.