mirror of
https://github.com/farion1231/cc-switch.git
synced 2026-07-24 21:30:17 +08:00
feat(stream-check): support OpenClaw openai-completions protocol
Phase 1 of extending stream health check to OpenCode/OpenClaw apps. - Add early-dispatch path for OpenCode/OpenClaw in check_once so they bypass the adapter layer (which only knows Claude/Codex/Gemini settings_config shapes). - Introduce check_openclaw_stream dispatcher that reads the `api` field from settings_config and routes to the existing check_claude_stream with api_format="openai_chat" for "openai-completions". Other protocols return localized errors to be lit up in phases 2 and 4. - Extract build_stream_check_result helper to avoid duplicating the StreamCheckResult construction logic between the two code paths. - Unblock the test button for OpenClaw providers in ProviderList.tsx. OpenCode still returns the "not yet supported" error; it will be enabled in phase 3.
This commit is contained in:
@@ -348,11 +348,7 @@ export function ProviderList({
|
||||
onConfigureUsage={onConfigureUsage}
|
||||
onOpenWebsite={onOpenWebsite}
|
||||
onOpenTerminal={onOpenTerminal}
|
||||
onTest={
|
||||
appId !== "opencode" && appId !== "openclaw"
|
||||
? handleTest
|
||||
: undefined
|
||||
}
|
||||
onTest={appId !== "opencode" ? handleTest : undefined}
|
||||
isTesting={isChecking(provider.id)}
|
||||
isProxyRunning={isProxyRunning}
|
||||
isProxyTakeover={isProxyTakeover}
|
||||
|
||||
Reference in New Issue
Block a user