mirror of
https://github.com/farion1231/cc-switch.git
synced 2026-07-28 16:56:16 +08:00
feat(stream-check): support OpenCode via npm package mapping
Phase 3: implement stream check for OpenCode providers by mapping the `settings_config.npm` (AI SDK package name) to the corresponding API protocol and delegating to the existing stream checkers. Package mapping: - @ai-sdk/openai-compatible → openai_chat - @ai-sdk/openai → openai_responses - @ai-sdk/anthropic → anthropic (ClaudeAuth strategy) - @ai-sdk/google → gemini (Google strategy) - @ai-sdk/amazon-bedrock → not supported (phase 4 message polish) Note: OpenCode nests baseURL/apiKey under `settings_config.options` (different from OpenClaw's root-level fields) and uses `baseURL` with a capital L. Three new extractors (base_url / api_key / npm) encode these shape differences so check_opencode_stream stays symmetric with check_openclaw_stream. Frontend: drop the remaining `appId !== "opencode"` filter in ProviderList.tsx — both apps can now test providers.
This commit is contained in:
@@ -348,7 +348,7 @@ export function ProviderList({
|
||||
onConfigureUsage={onConfigureUsage}
|
||||
onOpenWebsite={onOpenWebsite}
|
||||
onOpenTerminal={onOpenTerminal}
|
||||
onTest={appId !== "opencode" ? handleTest : undefined}
|
||||
onTest={handleTest}
|
||||
isTesting={isChecking(provider.id)}
|
||||
isProxyRunning={isProxyRunning}
|
||||
isProxyTakeover={isProxyTakeover}
|
||||
|
||||
Reference in New Issue
Block a user