Commit Graph

14 Commits

  • feat: differentiate fetch models error messages by failure type
    Distinguish between missing API key, missing endpoint, auth failure,
    unsupported provider (404/405), and timeout errors instead of showing
    a generic failure toast for all cases.
  • feat: add auto-fetch models from provider's /v1/models endpoint
    Add ability to fetch available models from third-party aggregation
    providers (SiliconFlow, OpenRouter, etc.) via OpenAI-compatible
    GET /v1/models endpoint. Users can click "Fetch Models" button in
    the provider form, then select models from a dropdown on each
    model input field.
    
    - Backend: new model_fetch service + Tauri command (Rust)
    - Frontend: ModelInputWithFetch shared component
    - Integrated into all 5 app forms (Claude/Codex/Gemini/OpenCode/OpenClaw)
    - i18n support for zh/en/ja
  • fix: place OpenCode model variants at top level instead of inside options (#1317)
    Split the expanded model panel into two editing areas:
    - "Model Properties" for top-level fields (variants, cost, etc.)
    - "SDK Options" for model.options fields (provider routing, etc.)
    
    Also guard against renaming extra fields to reserved keys (name, limit,
    options) or duplicate names, and fix ModelOptionKeyInput blur desync when
    a rename is rejected by the parent handler.
  • feat(opencode): add API key link support for OpenCode provider form
    Enable API key link feature for OpenCode app, allowing users to access
    provider websites for key registration directly from the form.
  • Feat/provider individual config (#663)
    * refactor(ui): simplify UpdateBadge to minimal dot indicator
    
    * feat(provider): add individual test and proxy config for providers
    
    Add support for provider-specific model test and proxy configurations:
    
    - Add ProviderTestConfig and ProviderProxyConfig types in Rust and TypeScript
    - Create ProviderAdvancedConfig component with collapsible panels
    - Update stream_check service to merge provider config with global config
    - Proxy config UI follows global proxy style (single URL input)
    
    Provider-level configs stored in meta field, no database schema changes needed.
    
    * feat(ui): add failover toggle and improve proxy controls
    
    - Add FailoverToggle component with slide animation
    - Simplify ProxyToggle style to match FailoverToggle
    - Add usage statistics button when proxy is active
    - Fix i18n parameter passing for failover messages
    - Add missing failover translation keys (inQueue, addQueue, priority)
    - Replace AboutSection icon with app logo
    
    * fix(proxy): support system proxy fallback and provider-level proxy config
    
    - Remove no_proxy() calls in http_client.rs to allow system proxy fallback
    - Add get_for_provider() to build HTTP client with provider-specific proxy
    - Update forwarder.rs and stream_check.rs to use provider proxy config
    - Fix EditProviderDialog.tsx to include provider.meta in useMemo deps
    - Add useEffect in ProviderAdvancedConfig.tsx to sync expand state
    
    Fixes #636
    Fixes #583
    
    * fix(ui): sync toast theme with app setting
    
    * feat(settings): add log config management
    
    Fixes #612
    Fixes #514
    
    * fix(proxy): increase request body size limit to 200MB
    
    Fixes #666
    
    * docs(proxy): update timeout config descriptions and defaults
    
    Fixes #612
    
    * fix(proxy): filter x-goog-api-key header to prevent duplication
    
    * fix(proxy): prevent proxy recursion when system proxy points to localhost
    
    Detect if HTTP_PROXY, HTTPS_PROXY, or ALL_PROXY environment variables
    point to loopback addresses (localhost, 127.0.0.1), and bypass system
    proxy in such cases to avoid infinite request loops.
    
    * fix(i18n): add providerAdvanced i18n keys and fix failover toast parameter
    
    - Add providerAdvanced.* i18n keys to en.json, zh.json, and ja.json
    - Fix failover toggleFailed toast to pass detail parameter
    - Remove Chinese fallback text from UI for English/Japanese users
    
    * fix(tray): restore tray-provider events and enable Auto failover properly
    
    - Emit provider-switched event on tray provider click (backward compatibility)
    - Auto button now: starts proxy, takes over live config, enables failover
    
    * fix(log): enable dynamic log level and single file mode
    
    - Initialize log at Trace level for dynamic adjustment
    - Change rotation strategy to KeepSome(1) for single file
    - Set max file size to 1GB
    - Delete old log file on startup for clean start
    
    * fix(tray): fix clippy uninlined format args warning
    
    Use inline format arguments: {app_type_str} instead of {}
    
    * fix(provider): allow typing :// in endpoint URL inputs
    
    Change input type from "url" to "text" to prevent browser
    URL validation from blocking :// input.
    
    Closes #681
    
    * fix(stream-check): use Gemini native streaming API format
    
    - Change endpoint from OpenAI-compatible to native streamGenerateContent
    - Add alt=sse parameter for SSE format response
    - Use x-goog-api-key header instead of Bearer token
    - Convert request body to Gemini contents/parts format
    
    * feat(proxy): add request logging for debugging
    
    Add debug logs for outgoing requests including URL and body content
    with byte size, matching the existing response logging format.
    
    * fix(log): prevent usize underflow in KeepSome rotation strategy
    
    KeepSome(n) internally computes n-2, so n=1 causes underflow.
    Use KeepSome(2) as the minimum safe value.
  • feat(opencode): add model-level options editor
    Add support for configuring per-model options like provider routing.
    Each model row now has an expand/collapse toggle to show a key-value
    editor for model-specific options (e.g., provider order, fallbacks).
    
    - Add options field to OpenCodeModel in Rust and TypeScript
    - Add expandable key-value editor UI for each model
    - Use local state pattern for option key input to prevent focus loss
    - Add i18n translations for zh/en/ja
  • feat(opencode): add extra options editor for SDK configuration
    Add key-value pair editor for configuring additional SDK options like
    timeout, setCacheKey, etc. Values are automatically parsed to appropriate
    types (number, boolean, object) on save.
    
    - Add `extra` field with serde flatten in Rust backend
    - Add index signature to OpenCodeProviderOptions type
    - Create ExtraOptionKeyInput component with local state pattern
    - Place extra options section above models configuration
  • fix(opencode): prevent model ID input focus loss on keystroke
    Use local state + onBlur pattern for ModelIdInput to keep React key
    stable during editing. Previously, each keystroke changed the object
    key, causing React to unmount/remount the input and lose focus.
  • fix(opencode): show Base URL field for all SDK types
    Previously Base URL was only shown for @ai-sdk/openai-compatible.
    Now it's always visible to support proxy scenarios for official SDKs
    like DeepSeek, Anthropic, etc.
  • refactor(opencode): simplify API format selector
    - Reduce npm package options from 10 to 4 core API formats (OpenAI, OpenAI Compatible, Anthropic, Google)
    - Rename "AI SDK Package" to "API Format" in i18n (zh/en/ja)
    - Remove check icon from Select dropdown items for cleaner UI
  • fix(opencode): address issues found during OpenCode integration review
    - Fix MCP server not removed from opencode.json when unchecked in edit modal
    - Fix Windows atomic write failure when opencode.json already exists
    - Fix i18n keys mismatch in OpenCodeFormFields (use opencode.* namespace)
    - Fix unit test missing apps.opencode field assertion
  • feat(opencode): Phase 9 - Frontend UI components for OpenCode
    - Create OpenCodeFormFields.tsx with:
      - NPM package selector (from AI SDK ecosystem)
      - API Key input using shared ApiKeySection component
      - Base URL input (shown for openai-compatible)
      - Dynamic models editor (add/remove models)
    
    - Update ProviderForm.tsx:
      - Import OpenCode presets and form fields
      - Add OPENCODE_DEFAULT_CONFIG constant
      - Add OpenCode to PresetEntry type union
      - Add OpenCode preset entries in useMemo
      - Add OpenCode state hooks (npm, apiKey, baseUrl, models)
      - Add OpenCode change handlers syncing to form
      - Add OpenCodeFormFields rendering section
      - Add OpenCode config editor using CommonConfigEditor
    
    - Update ProviderActions.tsx for OpenCode additive mode:
      - Add appId and isInConfig props
      - Implement "Add to Config" / "Remove from Config" buttons
      - Disable failover mode for OpenCode
      - Update delete button logic for additive mode
    
    - Update ProviderCard.tsx:
      - Pass appId and isInConfig to ProviderActions
    
    - Update AddProviderDialog.tsx:
      - Add OpenCode base URL extraction from options.baseURL