mirror of
https://github.com/farion1231/cc-switch.git
synced 2026-05-24 23:10:39 +08:00
c02b8c58cb
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.