← Back to PRs

#23117: wizard: add manual endpoint type selection when custom provider detection fails

by wjonaskr open 2026-02-22 01:47 View on GitHub →
commands size: S
## Summary - Problem: When `openclaw onboard` with "Custom Provider" fails to auto-detect the endpoint type (OpenAI/Anthropic), the wizard only offers retrying URL/model — no way to manually specify the type. The user gets stuck in a loop and ends up with no `models.providers` entry in config. - Why it matters: Blocks all users with custom OpenAI-compatible proxies (Bedrock Access Gateway, LiteLLM, vLLM, corporate gateways) from completing onboarding. They must manually edit `openclaw.json` with an undocumented schema. - What changed: Added "Select endpoint type manually" as the first option in the retry prompt when detection fails. Selecting it lets the user choose OpenAI or Anthropic, then proceeds to write a complete `models.providers` config entry. - What did NOT change (scope boundary): Auto-detection logic, named provider flows, non-interactive onboarding, and `applyCustomApiConfig` are untouched. ## Change Type (select all) - [ ] Bug fix - [x] Feature - [ ] Refactor - [ ] Docs - [ ] Security hardening - [ ] Chore/infra ## Scope (select all touched areas) - [ ] Gateway / orchestration - [ ] Skills / tool execution - [ ] Auth / tokens - [ ] Memory / storage - [ ] Integrations - [ ] API / contracts - [x] UI / DX - [ ] CI/CD / infra ## Linked Issue/PR - None ## User-visible / Behavior Changes When endpoint auto-detection fails during `openclaw onboard` with a custom provider, the retry prompt now shows a new first option: "Select endpoint type manually". Choosing it presents an OpenAI/Anthropic selector and proceeds without re-probing, writing a working `models.providers` config entry. Existing retry options (Change base URL / Change model / Change both) remain unchanged. ## Security Impact (required) - New permissions/capabilities? No - Secrets/tokens handling changed? No - New/changed network calls? No - Command/tool execution surface changed? No - Data access scope changed? No ## Repro + Verification ### Environment - OS: macOS 15.7.4 - Runtime/container: Node 24.13.1 - Model/provider: Custom OpenAI-compatible Bedrock proxy (AWS API Gateway) - Relevant config (redacted): Custom provider base URL pointing to an API Gateway endpoint ### Steps 1. Run `openclaw onboard`, choose "Custom Provider" 2. Enter a Bedrock proxy URL + API key + model ID 3. Choose "Unknown (detect automatically)" 4. Detection fails → select "Select endpoint type manually" → choose "OpenAI-compatible" ### Expected - Wizard proceeds and writes a complete `models.providers` entry to config ### Actual (before fix) - Only retry options for URL/model; no way to manually specify type; config ends up without provider entry ## Evidence - [x] Failing test/log before + passing after New test: `allows manual type selection when detection fails` — verifies the full flow from detection failure through manual selection to correct config output. All 13 e2e tests pass: `pnpm vitest run src/commands/onboard-custom.e2e.test.ts --config vitest.e2e.config.ts` ## Human Verification (required) - Verified scenarios: Full onboarding flow with a real Bedrock proxy endpoint that fails auto-detection - Edge cases checked: Existing retry flows (baseUrl/model/both) still work; test suite confirms - What you did **not** verify: Anthropic-compatible manual selection path (tested OpenAI path only) ## Compatibility / Migration - Backward compatible? Yes - Config/env changes? No - Migration needed? No ## Failure Recovery (if this breaks) - How to disable/revert this change quickly: Revert the single commit - Files/config to restore: `src/commands/onboard-custom.ts` - Known bad symptoms reviewers should watch for: Wizard skipping verification when it shouldn't ## Risks and Mitigations - Risk: User selects wrong endpoint type manually, gets a broken config - Mitigation: This is the same risk as explicitly choosing OpenAI/Anthropic in the initial compatibility prompt. The manual selection is an escape hatch, not the default path. <!-- greptile_comment --> <h3>Greptile Summary</h3> Added manual endpoint type selection as an escape hatch when auto-detection fails during custom provider onboarding. This solves the issue where users with OpenAI-compatible proxies that fail detection would get stuck in a retry loop. **Key changes:** - Added `"selectType"` option to retry prompt when detection fails - Manual selection bypasses verification (intentional escape hatch per PR description) - Includes test coverage for the new flow **Critical issue found:** - Missing `selectType` handling at line 674 can cause infinite loop when verification fails after explicit compatibility choice (not during detection) <h3>Confidence Score: 2/5</h3> - Infinite loop bug when `selectType` is chosen during verification failure makes this unsafe to merge - Core feature works (manual type selection during detection failure) but critical logic error at line 674 causes infinite loop when `selectType` chosen after verification failure with explicit compatibility choice. The missing case handling is a blocker. - Pay close attention to `src/commands/onboard-custom.ts` line 674 - requires additional case handling for `selectType` <sub>Last reviewed commit: c6fb251</sub> <!-- greptile_other_comments_section --> <sub>(2/5) Greptile learns from your feedback when you react with thumbs up/down!</sub> <!-- /greptile_comment -->

Most Similar PRs