Repository navigation
fix(litellm): interactive onboarding never asks for the proxy base URL - #173164
Conversation
`openclaw onboard --auth-choice litellm-api-key` captures only an API key and silently keeps http://localhost:4000 with a seeded claude-opus-4-6, so operators on a remote proxy end up pointed at localhost with one selectable model. The non-interactive path already honors --custom-base-url; the interactive one has no equivalent prompt. Ask for the proxy base URL before the API key, seeded from any already-configured value. Enter keeps the default and leaves config untouched, so applyLitellmConfig still seeds the default model exactly as before; entering a custom URL records it and lets the merged explicit-URL discovery list the proxy's models.
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs real behavior proof before merge. What this changesAdds a LiteLLM proxy URL prompt and consolidates case-variant provider settings during authentication. Example: Configure a LiteLLM proxy at https://litellm.example/v1 through interactive onboarding.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Partial Merge readiness⛔ Blocked before merge - 2 items remain Keep open: this PR addresses behavior still present on main, preserves meaningful contributor work, and has maintainer involvement; no actionable code defect was found. Priority: P2 Before merge
FindingsNone. Tests
Agent review detailsHow this fits togetherThe LiteLLM plugin collects setup inputs and returns authentication results; shared provider-auth helpers merge those results into configuration, and the existing config writer persists them. flowchart LR
A[Interactive onboarding] --> B[LiteLLM URL prompt]
B --> C[Existing API key helper]
C --> D[Shared provider auth merge]
D --> E[Config writer]
E --> F[Saved provider settings]
Technical reviewBest possible solution: Retain the plugin-owned URL prompt and shared config-owner repair, with existing-install preservation demonstrated before merge. Do we have a high-confidence way to reproduce the issue? Current-main source confirms that interactive LiteLLM authentication has no URL prompt; supplied CLI evidence also reports the before/after behavior, but no target code was executed during this review. Is this the best way to solve the issue? The implementation uses the existing API-key helper and shared persistence owner, addresses the earlier preservation findings, and keeps live model selection as a documented follow-up. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against f2c8ebd3e2b4. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
PR surfaceSource +147, Tests +342, Docs +12. Total +501 across 7 files. Added test files: 1. View PR surface stats
Review metrics
LabelsLabel changes:
Label justifications:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReview history (5 earlier review cycles)
Reviewed October 16, 2026, 3:51 AM ET / 07:51 UTC (Revision 6). |
Eliding the prefilled default was correct only when nothing was being replaced. With an existing remote proxy configured, choosing http://localhost:4000 was discarded, leaving requests pointed at the old proxy with no visible outcome. Elide the default only when the provider row has no URL to replace, and prove prompt rejection by cancelling mid-prompt so a blocked URL cannot reach config.
Driving the shipped wizard over a pty showed the prompt pre-fills its initialValue, so a typed URL appended to it and failed validation as "http://localhost:4000https://...". Hint the default as a placeholder and prefill only when an existing URL is there to edit.
|
@clawsweeper re-review — addressed the P2 finding, replaced the validator tests, and added shipped-CLI proof. The CLI run surfaced a prefill defect (clack appends typed input to |
|
🦞👀 Re-review progress:
|
applyLitellmBaseUrl read providers.litellm by exact key. A config using models.providers.LiteLLM therefore missed its row, and the fresh lowercase row written here took precedence, dropping the operator's authored model definitions, apiKey, and request options from the effective configuration. Resolve the row through the normalized lookup the shared preset already uses.
|
@clawsweeper re-review — fixed the P1 in |
|
🦞👀 Re-review progress:
|
|
@clawsweeper re-review — added the requested upgrade run. Existing install (case-variant Also flagging a separate core defect that run exposed: |
|
🦞👀 Re-review progress:
|
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Merged via squash.
|
…74824) * fix(litellm): preserve mixed-case proxy URLs during reauthentication Resolve the authored provider row before choosing onboarding defaults, so unattended reauthentication keeps its proxy and catalog instead of staging localhost:4000. Reuse the same existing resolver for prompt and discovery reads. Related: #173300, #173164 * fix(setup): retain provider alias folding during activation * fix(setup): prefer canonical provider snapshots during activation * fix(litellm): keep discovery URL and path selection aligned
openclaw#173164) * fix(litellm): interactive onboarding never asks for the proxy base URL `openclaw onboard --auth-choice litellm-api-key` captures only an API key and silently keeps http://localhost:4000 with a seeded claude-opus-4-6, so operators on a remote proxy end up pointed at localhost with one selectable model. The non-interactive path already honors --custom-base-url; the interactive one has no equivalent prompt. Ask for the proxy base URL before the API key, seeded from any already-configured value. Enter keeps the default and leaves config untouched, so applyLitellmConfig still seeds the default model exactly as before; entering a custom URL records it and lets the merged explicit-URL discovery list the proxy's models. * fix(litellm): honor an explicit switch back to the default proxy URL Eliding the prefilled default was correct only when nothing was being replaced. With an existing remote proxy configured, choosing http://localhost:4000 was discarded, leaving requests pointed at the old proxy with no visible outcome. Elide the default only when the provider row has no URL to replace, and prove prompt rejection by cancelling mid-prompt so a blocked URL cannot reach config. * fix(litellm): hint the default proxy URL instead of prefilling it Driving the shipped wizard over a pty showed the prompt pre-fills its initialValue, so a typed URL appended to it and failed validation as "http://localhost:4000https://...". Hint the default as a placeholder and prefill only when an existing URL is there to edit. * fix(litellm): keep authored settings from a case-variant provider row applyLitellmBaseUrl read providers.litellm by exact key. A config using models.providers.LiteLLM therefore missed its row, and the fresh lowercase row written here took precedence, dropping the operator's authored model definitions, apiKey, and request options from the effective configuration. Resolve the row through the normalized lookup the shared preset already uses. * fix: preserve LiteLLM proxy settings during setup * fix: preserve changed auth fields across provider aliases * style: sort provider auth rows without mutation * test: use lint-compliant LiteLLM model fixtures --------- Co-authored-by: Peter Steinberger <[email protected]>
…enclaw#174824) * fix(litellm): preserve mixed-case proxy URLs during reauthentication Resolve the authored provider row before choosing onboarding defaults, so unattended reauthentication keeps its proxy and catalog instead of staging localhost:4000. Reuse the same existing resolver for prompt and discovery reads. Related: openclaw#173300, openclaw#173164 * fix(setup): retain provider alias folding during activation * fix(setup): prefer canonical provider snapshots during activation * fix(litellm): keep discovery URL and path selection aligned
* fix(litellm): select a model served by the configured proxy Reuse shared self-hosted discovery during interactive setup, preserving configured credentials and transport policy. Fall back to manual model entry with a visible reason. Keep noninteractive defaults unchanged. Follow-up to #173164 by @midhunvnadh; thanks to @Hylance for reporting #44789. * test(litellm): preserve the generic model picker signature * test(litellm): keep discovery fixtures on public plugin contracts * fix(litellm): preserve headerless discovery requests * fix(setup): revoke stale LiteLLM discovery authority * test(setup): isolate config authority fixtures * test(setup): preserve auth module exports in fixture * test(setup): shrink obsolete mock export exceptions * fix(setup): compare authored revision after agent creation * test: preserve wizard orchestration fixtures with setup authority
…174818) * fix(litellm): select a model served by the configured proxy Reuse shared self-hosted discovery during interactive setup, preserving configured credentials and transport policy. Fall back to manual model entry with a visible reason. Keep noninteractive defaults unchanged. Follow-up to openclaw#173164 by @midhunvnadh; thanks to @Hylance for reporting openclaw#44789. * test(litellm): preserve the generic model picker signature * test(litellm): keep discovery fixtures on public plugin contracts * fix(litellm): preserve headerless discovery requests * fix(setup): revoke stale LiteLLM discovery authority * test(setup): isolate config authority fixtures * test(setup): preserve auth module exports in fixture * test(setup): shrink obsolete mock export exceptions * fix(setup): compare authored revision after agent creation * test: preserve wizard orchestration fixtures with setup authority
Related: #44789
What Problem This Solves
Fixes interactive LiteLLM setup skipping the proxy URL, and reauthentication retaining conflicting case variants such as
LiteLLMandlitellmin saved provider configuration.User Impact
Operators can enter a remote or local proxy URL before supplying its API key. Reauthentication saves one canonical provider row while preserving authored headers, request options, model metadata, and model parameters. Noninteractive setup continues to accept
--custom-base-url.The wizard still seeds its documented default model; selecting from the proxy's discovered models remains a follow-up. If the proxy does not serve that alias, run
openclaw models list --provider litellm --refresh --jsonandopenclaw models set litellm/your-model-idafter setup. The provider documentation now states this limitation.Why This Change Was Made
Keep the existing API-key helper and add the URL prompt around it. Fold provider keys at the shared auth/config owner, including the persisted write, rather than adding a LiteLLM-only migration. Merge provider models by ID. For full-config auth results, replay fields changed by authentication over canonical source values so unchanged copied fields cannot overwrite authored settings. Existing concurrent-write conflict checks remain in place.
Thanks @midhunvnadh for the original URL-prompt fix. The contributor commits are preserved; this branch merges main without rebasing or force-pushing.
Evidence
Actual rebuilt CLI on macOS, with isolated state/config and loopback ports:
Enter LiteLLM API key, with no URL prompt. After: fresh onboarding prompted for the proxy URL before the key and completed successfully (266.52s wall).litellmrow, the selected URL, preserved provider/request/model headers and options, retained models, canonical model parameters, and the unchanged primary model.models list --provider litellm --refresh --jsondiscovered exactlylitellm/local-qwen, available with provider statusready(78.70s).models set litellm/local-qwensaved that selection (103.23s).agent --local --agent main --thinking off --message 'Reply exactly LOCAL_OK. Do not use tools.' --jsonreturnedLOCAL_OKthrough the configured proxy (169.02s wall; 26.776s agent duration). The receipt reports providerlitellm, modellocal-qwen, no reroute, and 12 tokens. This response came from a deterministic proxy fixture.Real local-model proof remains incomplete: proxy requests to shared Ollama
qwen3:4band a boundedllama3.2:latestcontrol timed out without a response (the bounded control exited in 309.76s). No shared models were stopped or unloaded. The existing-config proof uses a synthetic authored config, not a latest-stable installation upgrade.Focused validation:
Whole-PR delta against the merged base: production +176/-29 (net +147), tests +342/-0, docs +13/-1. The production growth covers URL handling and shared source-aware provider merging; redundant comments and a sole-use wrapper were removed. No new config option, schema, dependency, or credential owner.
Independent Codex review of
f94c9201de8711b9d0059d5ab73dbcb52d1ba884: scoped-clean, no actionable P0–P2 findings. The final commit changes only a test-fixture expression; all production files match the CLI-tested head.ClawSweeper reviewed this exact head with no code findings. Its remaining hold requests latest-stable upgrade/data-compatibility proof; that proof is not claimed here and is left to the maintainer decision.
Final-head CI run 38869128735 completed successfully, including
openclaw/ci-gate. No CI failures remain on this head.