mirror of
https://github.com/farion1231/cc-switch.git
synced 2026-06-16 13:34:04 +08:00
codex/claude-thinking-fallback
52 Commits
-
feat(copilot): add GitHub Copilot reverse proxy support (#930)
* refactor(toolsearch): replace binary patch with ENABLE_TOOL_SEARCH env var toggle - Remove toolsearch_patch.rs binary patching mechanism (~590 lines) - Delete `toolsearch_patch.rs` and `commands/toolsearch.rs` - Remove auto-patch startup logic and command registration from lib.rs - Remove `tool_search_bypass` field from settings.rs - Remove frontend settings ToggleRow, useSettings hook sync logic, and API methods - Clean up zh/en/ja i18n keys (notifications + settings) - Add ENABLE_TOOL_SEARCH toggle to Claude provider form - Add checkbox in CommonConfigEditor.tsx (alongside teammates toggle) - When enabled, writes `"env": { "ENABLE_TOOL_SEARCH": "true" }` - When disabled, removes the key; takes effect on provider switch - Add zh/en/ja i18n key: `claudeConfig.enableToolSearch` Claude Code 2.1.76+ natively supports this env var, eliminating the need for binary patching. * feat(claude): add effortLevel high toggle to provider form - Add "high-effort thinking" checkbox to Claude provider config form - When checked, writes `"effortLevel": "high"`; when unchecked, removes the field - Add zh/en/ja i18n translations * refactor(claude): remove deprecated alwaysThinking toggle - Claude Code now enables extended thinking by default; alwaysThinkingEnabled is a no-op - Thinking control is now handled via effortLevel (added in prior commit) - Remove state, switch case, and checkbox UI from CommonConfigEditor - Clean up alwaysThinking i18n keys across zh/en/ja locales * feat(opencode): add setCacheKey: true to all provider presets - Add setCacheKey: true to options in all 33 regular presets - Add setCacheKey: true to OPENCODE_DEFAULT_CONFIG for custom providers - Exclude 2 OMO presets (Oh My OpenCode / Slim) which have their own config mechanism Closes #1523 * fix(codex): resolve 1M context window toggle causing MCP editor flicker - Add localValueRef to short-circuit duplicate CodeMirror updateListener callbacks, breaking the React state → CodeMirror → stale onChange → React state feedback loop - Use localValueRef.current in handleContextWindowToggle and handleCompactLimitChange to avoid stale closure reads - Change compact limit input from type="number" to type="text" with inputMode="numeric" to remove unnecessary spinner buttons * feat(codex): add 1M context window toggle utilities and i18n keys - Add extractCodexTopLevelInt, setCodexTopLevelInt, removeCodexTopLevelField TOML helpers in providerConfigUtils.ts - Add i18n keys for contextWindow1M, autoCompactLimit in zh/en/ja locales * feat(claude): collapse model mapping fields by default - Wrap 5 model mapping inputs in a Collapsible, collapsed by default - Auto-expand when any model value is present (including preset-filled) - Show hint text when collapsed explaining most users need no config - Add zh/en/ja i18n keys for toggle label and collapsed hint - Use variant={null} to avoid ghost button hover style clash in dark mode * feat(claude): merge advanced fields into single collapsible section - Merge API format, auth field, and model mapping into a unified "Advanced Options" collapsible - Extend smart-expand logic to detect non-default values across all advanced fields - Preserve model mapping sub-header and hint with a separator line - Update zh/en/ja i18n keys (advancedOptionsToggle, advancedOptionsHint, modelMappingLabel, modelMappingHint) * feat(copilot): add GitHub Copilot reverse proxy support Add GitHub Copilot as a Claude provider variant with OAuth device code authentication and Anthropic ↔ OpenAI format transformation. Backend: - Add CopilotAuthManager for GitHub OAuth device code flow - Implement Copilot token auto-refresh (60s before expiry) - Persist GitHub token to ~/.cc-switch/copilot_auth.json - Add ProviderType::GitHubCopilot and AuthStrategy::GitHubCopilot - Modify forwarder to use /chat/completions for Copilot - Add Copilot-specific headers (Editor-Version, Editor-Plugin-Version) Frontend: - Add CopilotAuthSection component for OAuth UI - Add useCopilotAuth hook for OAuth state management - Auto-copy user code to clipboard and open browser - Use 8-second polling interval to avoid GitHub rate limits - Skip API Key validation for Copilot providers - Add GitHub Copilot preset with claude-sonnet-4 model Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com> * fix(copilot): remove is_expired() calls from tests Remove references to deleted is_expired() method in test code. Only is_expiring_soon() is needed for token refresh logic. Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com> * feat(copilot): add real-time model listing from Copilot API - Add fetch_models() to CopilotAuthManager calling GET /models endpoint - Add copilot_get_models Tauri command - Add copilotGetModels() frontend API wrapper - Modify ClaudeFormFields to show model dropdown for Copilot providers - Fetches available models on component mount when isCopilotPreset - Groups models by vendor (Anthropic, OpenAI, Google, etc.) - Input + dropdown button combo allows both manual entry and selection - Non-Copilot providers keep original plain Input behavior Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * feat(copilot): add usage query integration - Add Copilot usage API integration (fetch_usage method) - Add copilot_get_usage Tauri command - Add GitHub Copilot template in usage query modal - Unify naming: copilot → github_copilot - Add constants management (TEMPLATE_TYPES, PROVIDER_TYPES) - Improve error handling with detailed error messages - Add database migration (v5 → v6) for template type update - Add i18n translations (zh, en, ja) - Improve type safety with TemplateType - Apply code formatting (cargo fmt, prettier) * 修复github 登录和注销问题 ,模型选择问题 * feat(copilot): add multi-account support for GitHub Copilot - Add multi-account storage structure with v1 to v2 migration - Add per-account token caching and auto-refresh - Add new Tauri commands for account management - Integrate account selection in Proxy forwarder - Add account selection UI in CopilotAuthSection - Save githubAccountId to ProviderMeta - Add i18n translations for multi-account features (zh/en/ja) * 修复用量查询Reset字段出现多余字符 * refactor(auth-binding): introduce generic provider auth binding primitives - add shared authBinding types in Rust and TypeScript while keeping githubAccountId as a compatibility field\n- resolve Copilot token, models, and usage through provider-bound account lookup instead of only the implicit default account\n- fix the Unix build regression in settings.rs by restoring std::io::Write for write_all()\n- remove the accidental .github ignore entry and drop leftover Copilot form debug logs\n- keep the first migration step non-breaking by writing both authBinding and the legacy githubAccountId field from the form * refactor(auth-service): add managed auth command surface and explicit default account state - introduce generic managed auth commands and frontend auth API wrappers for provider-scoped login, status, account listing, removal, logout, and default-account selection\n- store an explicit Copilot default_account_id instead of relying on HashMap iteration order, and use it consistently for fallback token/model/usage resolution\n- sort managed accounts deterministically and surface default-account state to the UI\n- refactor the Copilot form hook to wrap a generic useManagedAuth implementation while preserving the existing component contract\n- add default-account controls to the Copilot auth section and extend Copilot auth status serialization/tests for the new state * feat(auth-center): add a dedicated settings entrypoint for managed OAuth accounts - add an Auth Center tab to Settings so managed OAuth accounts are no longer hidden inside individual provider forms\n- introduce a first AuthCenterPanel that hosts GitHub Copilot account management as the initial managed auth provider\n- keep the provider form experience intact while establishing a global account-management surface for future providers such as OpenAI\n- validate that the new settings tab works cleanly with the generic managed auth hook and existing Copilot account controls * feat(add-provider): expose managed OAuth sources alongside universal providers - add an OAuth tab to the Add Provider flow so managed auth sources sit beside app-specific and universal providers\n- reuse the new Auth Center panel inside the dialog, keeping account management discoverable during provider creation\n- make the dialog footer adapt to the OAuth tab so account setup does not pretend to create a provider directly\n- align the add-provider UX with the new architecture where OAuth accounts are global assets and providers bind to them later * fix(auth-reliability): harden managed auth persistence and refresh behavior - replace direct Copilot auth store writes with private temp-file writes and atomic rename semantics, and document the local token storage limitation\n- add per-account refresh locks plus a double-check path so concurrent requests do not stampede GitHub token refresh\n- surface legacy migration failures through auth status, expose them in the UI, and add translated copy for the new account-state labels\n- stop writing the legacy githubAccountId field from the provider form while keeping compatibility reads in place\n- add logout error recovery and Copilot model-load toasts so auth failures are no longer silently swallowed * refactor(copilot-detection): prefer provider type before URL fallbacks - update forwarder endpoint rewriting to treat providerType as the primary GitHub Copilot signal\n- keep githubcopilot.com string matching only as a compatibility fallback for older provider records without providerType\n- reduce one more path where Copilot behavior depended purely on URL heuristics * fix(copilot-auth): add cancel button to error state in CopilotAuthSection - 错误状态下仅有"重试"按钮,用户无法退出(如不可恢复的 403 未订阅错误) - 新增"取消"按钮,复用已有的 cancelAuth 逻辑重置为 idle 状态 * 修复打包后github账号头像显示异常 * 修复github copilot 来源的模型测试报错 * feat(copilot-preset): add default model presets for GitHub Copilot - 补充 Copilot 预设的默认模型配置,用户选完预设即可直接使用 - ANTHROPIC_MODEL: claude-opus-4.6 - ANTHROPIC_DEFAULT_HAIKU_MODEL: claude-haiku-4.5 - ANTHROPIC_DEFAULT_SONNET_MODEL: claude-sonnet-4.6 - ANTHROPIC_DEFAULT_OPUS_MODEL: claude-opus-4.6 --------- Co-authored-by: Jason <farion1231@gmail.com> Co-authored-by: 周梦泽 <mengze.zhou@dafeng-tech.com> Co-authored-by: Claude Haiku 4.5 <noreply@anthropic.com>Zhou Mengze ·
2026-03-17 23:57:58 +08:00 -
fix: make Codex TOML base_url editing section-aware
Rewrite setCodexBaseUrl/extractCodexBaseUrl to understand TOML section boundaries, ensuring base_url is written into the correct [model_providers.<name>] section instead of being appended to file end. - Add section-aware TOML helpers in providerConfigUtils.ts - Extract shared update_codex_toml_field/remove_codex_toml_base_url_if in codex_config.rs, deduplicate proxy.rs TOML editing logic - Replace scattered inline base_url regexes with extractCodexBaseUrl() - Add comprehensive tests for both Rust and TypeScript implementations
Jason ·
2026-03-12 22:20:59 +08:00 -
Jason ·
2026-03-09 08:56:58 +08:00 -
fix:Add a new vendor page, API endpoint, and model name. (#1155)
* fix:Add a new vendor page, API endpoint, and model name. Fix the bug where, after entering characters, line breaks cannot be fully deleted. * fix: add missing i18n key codexConfig.modelNameHint for zh/en/ja --------- Co-authored-by: Jason <farion1231@gmail.com>
wugeer ·
2026-03-07 22:53:44 +08:00 -
fix: use structural TOML merge/subset for Codex common config snippet
The text-based approach (string append + substring matching) failed to detect already-merged snippets when config.toml was reformatted by external tools (MCP sync, Codex CLI). Replace with smol-toml parse/ stringify + existing deepMerge/isSubset/deepRemove for correct structural operations. Falls back to text matching on parse failure.
Jason ·
2026-03-04 23:01:40 +08:00 -
revert: restore full config overwrite + Common Config Snippet (revert
992dda5c)Revert the partial key-field merging refactoring introduced in
992dda5c, along with two dependent commits (24fa8a18,87604b18) that referenced the now-removed ClaudeQuickToggles component. The whitelist-based partial merge approach had critical issues: - Non-whitelisted custom fields were lost during provider switching - Backfill permanently stripped non-key fields from the database - Whitelist required constant maintenance to track upstream changes This restores the proven "full config overwrite + Common Config Snippet" architecture where each provider stores its complete configuration and shared settings are managed via a separate snippet mechanism. Reverted commits: -24fa8a18: context-aware JSON editor hint + hide quick toggles -87604b18: hide ClaudeQuickToggles when creating -992dda5c: partial key-field merging refactoring Restored: - Full config snapshot write (write_live_snapshot) for Claude/Codex/Gemini - Full config backfill (settings_config = live_config) - Common Config Snippet UI and backend commands - 6 frontend components/hooks for common config editing - configApi barrel export and DB snippet methods Removed: - ClaudeQuickToggles component - write_live_partial / backfill_key_fields / patch_claude_live - All KEY_FIELDS constantsJason ·
2026-02-27 23:12:34 +08:00 -
feat: Add AWS Bedrock Provider Support (AKSK & API Key) (#1047)
* Add AWS Bedrock provider integration design document Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * Add AWS Bedrock provider implementation plan Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * Update implementation plan: add OpenCode Bedrock support Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * feat: add cloud_provider category to ProviderCategory type Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * feat: add AWS Bedrock (AKSK) Claude Code provider preset with tests Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * feat: add AWS Bedrock (API Key) Claude Code provider preset with tests Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * feat: add AWS Bedrock OpenCode provider preset with @ai-sdk/amazon-bedrock Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * docs: add AWS Bedrock provider feature summary for PR Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * chore: remove internal planning documents Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * docs: add AWS Bedrock support to README (EN/ZH/JA) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * Add AWS Bedrock UI merge design document Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * Add AWS Bedrock UI merge implementation plan Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * feat: skip optional template values in validation Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * feat: support isSecret template fields and hide base URL for Bedrock Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * feat: add Bedrock validation, cleanup, and isBedrock prop in ProviderForm Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * feat: extend TemplateValueConfig and merge Bedrock presets Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix: mask Bedrock API Key as secret and support GovCloud regions - Add isSecret: true to BEDROCK_API_KEY template value - Update region regex to support multi-segment regions (us-gov-west-1) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * style: replace AWS icon with updated logo Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * style: replace AWS icon with updated logo Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * style: replace AWS icon with new PNG image Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix: address code review findings - Fix AWS icon: use SVG with embedded <image> instead of raw <img> tag - Hide duplicate ApiKeySection for Bedrock (auth via template fields only) - Guard settingsConfig cleanup against unresolved template placeholders Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * chore: remove planning documents Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * refactor: address PR review - split Bedrock into two presets, restore SVG icon Based on maintainer review feedback on PR #1047: 1. Split merged "AWS Bedrock" back into two separate presets: - "AWS Bedrock (AKSK)": uses AWS_ACCESS_KEY_ID + AWS_SECRET_ACCESS_KEY - "AWS Bedrock (API Key)": uses top-level apiKey field via standard UI input 2. Restore aws.svg to pure vector SVG (was PNG-in-SVG) 3. Remove all Bedrock-specific logic from shared components: - Remove isBedrock prop from ClaudeFormFields - Remove Bedrock validation/cleanup blocks from ProviderForm - Remove optional/isSecret from TemplateValueConfig - Remove optional skip from useTemplateValues 4. Add cloud_provider category handling: - Skip API Key/Base URL required validation - Hide Speed Test and Base URL for cloud_provider - Hide API format selector for cloud_provider (always Anthropic) - Show API Key input only when config has apiKey field 5. Fix providerConfigUtils to support top-level apiKey: - getApiKeyFromConfig: check config.apiKey before env fields - setApiKeyInConfig: write to config.apiKey when present - hasApiKeyField: detect top-level apiKey property 6. Add OpenClaw Bedrock preset (bedrock-converse-stream protocol) 7. Update model IDs: - Sonnet: global.anthropic.claude-sonnet-4-6 - Opus: global.anthropic.claude-opus-4-6-v1 - Haiku: global.anthropic.claude-haiku-4-5-20251001-v1:0 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix(test): align Bedrock API Key test assertions with preset implementation The API Key preset was refactored to use standard UI input (apiKey: "") instead of template variables, but the tests were not updated accordingly. --------- Co-authored-by: root <root@ip-10-0-11-189.ap-northeast-1.compute.internal> Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com> Co-authored-by: Jason <farion1231@gmail.com>
Keith Yu ·
2026-02-24 21:11:18 +08:00 -
refactor(provider): switch from full config overwrite to partial key-field merging (#1098)
* refactor(provider): switch from full config overwrite to partial key-field merging Replace the provider switching mechanism for Claude/Codex/Gemini from full settings_config overwrite to partial key-field replacement, preserving user's non-provider settings (plugins, MCP, permissions, etc.) across switches. - Add write_live_partial() with per-app implementations for Claude (JSON env merge), Codex (auth replace + TOML partial merge), and Gemini (env merge) - Add backfill_key_fields() to extract only provider-specific fields when saving live config back to provider entries - Update switch_normal, sync_current_to_live, add, update to use partial merge - Remove common config snippet feature for Claude/Codex/Gemini (no longer needed with partial merging); preserve OMO common config - Delete 6 frontend files (3 components + 3 hooks), clean up 11 modified files - Remove backend extract_common_config_* methods, 3 Tauri commands, CommonConfigSnippets struct, and related migration code - Update integration tests to validate key-field-only backfill behavior * refactor(cleanup): remove dead code and redundant MCP sync after partial-merge refactor - Remove ConfigService legacy full-overwrite sync methods (~150 lines) - Remove redundant McpService::sync_all_enabled from switch_normal - Switch proxy fallback recovery from write_live_snapshot to write_live_partial - Remove dead ProviderService::write_gemini_live wrapper - Update tests to reflect partial-merge behavior (MCP preserved, not re-synced) * feat(claude): add Quick Toggles for common Claude Code preferences Add checkbox toggles for hideAttribution, alwaysThinking, and enableTeammates that write directly to the live settings file via RFC 7396 JSON Merge Patch. Mirror changes to the form editor using form.watch for reactive updates. * fix(provider): add missing key fields to partial-merge constants Add provider-specific fields verified against official docs to prevent key residue or loss during provider switching: - Claude: CLAUDE_CODE_SUBAGENT_MODEL (env), model (top-level) - Codex: review_model, plan_mode_reasoning_effort - Gemini: GOOGLE_API_KEY (official alternative to GEMINI_API_KEY) * fix(provider): expand partial-merge key fields for Bedrock, Vertex, Foundry and behavior settings Add missing env/top-level fields to CLAUDE_KEY_ENV_FIELDS and CLAUDE_KEY_TOP_LEVEL so that provider switching correctly replaces (and clears) credentials and flags for AWS Bedrock, Google Vertex AI, Microsoft Foundry, and provider behavior overrides like max output tokens and prompt caching. * feat(provider): add auth field selector for Claude providers (AUTH_TOKEN / API_KEY) Allow users to choose between ANTHROPIC_AUTH_TOKEN and ANTHROPIC_API_KEY when creating or editing custom Claude providers, persisted in meta.apiKeyField. * refactor(preset): remove AiHubMix hardcoded API_KEY in favor of generic auth selector AiHubMix was the only preset that hardcoded ANTHROPIC_API_KEY before the generic auth field selector was introduced. Now that users can freely choose between AUTH_TOKEN and API_KEY via the UI, remove the special-case and default AiHubMix to the standard ANTHROPIC_AUTH_TOKEN.
Jason Young ·
2026-02-23 21:57:04 +08:00 -
feat: 添加 ESC 键快捷返回功能 (#670)
* feat: 添加 ESC 键快捷返回功能 - FullScreenPanel 组件支持 ESC 键关闭 - App.tsx 主页面支持 ESC 键返回主界面 - 优化键盘事件处理,合并多个监听器 - 使用事件捕获阶段避免冲突 - 适用于所有子页面:MCP、设置、Prompts、Skills 等 - 跨平台兼容:macOS、Windows、Linux * perf: 优化 ESC 键处理逻辑 - 使用 useRef 避免闭包陷阱,提升性能 - 修复输入框中按 ESC 会关闭面板的问题 - 检测焦点元素,不干扰输入框的 ESC 行为 - 改进用户体验,避免意外关闭导致数据丢失 * fix: enhance global keyboard shortcuts and improve useModelState sync - App & FullScreenPanel: Use `isTextEditableTarget` to prevent shortcuts (ESC, etc.) from triggering while editing text. - useModelState: Prevent overwriting user input during config synchronization. - App: Add `Cmd/Ctrl + ,` shortcut to open settings. - Add `isTextEditableTarget` utility.
咸蛋黄 ·
2026-01-20 16:33:50 +08:00 -
feat(deeplink): 深链支持用量查询配置 (#400)
## 新增功能 - 深链导入支持用量查询配置参数: - `usageEnabled`: 是否启用用量查询 - `usageScript`: Base64 编码的用量查询脚本 - `usageApiKey`: 用量查询专用 API Key - `usageBaseUrl`: 用量查询专用 Base URL - `usageAccessToken`: 访问令牌(NewAPI 模板) - `usageUserId`: 用户 ID(NewAPI 模板) - `usageAutoInterval`: 自动查询间隔(分钟) ## 修改文件 - **mod.rs**: DeepLinkImportRequest 结构体添加用量查询字段 - **parser.rs**: 解析 URL 中的用量查询参数 - **provider.rs**: 构建 ProviderMeta 包含 UsageScript 配置 - **deeplink.ts**: 添加 TypeScript 类型定义 - **DeepLinkImportDialog.tsx**: 确认对话框显示用量查询配置 ## Bug 修复 - **formatters.ts**: 修复 formatJSON() 格式化时删除 "env" 键的问题 ## 深链格式示例 ``` ccswitch://v1/import?resource=provider&app=claude&name=xxx&usageEnabled=true&usageScript={base64}&usageAutoInterval=30 ``` 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>千羽 ·
2025-12-14 21:52:13 +08:00 -
fix: add fallback for crypto.randomUUID() on older WebViews
crypto.randomUUID() is not available on older systems (macOS < 12.3, Safari < 15.4). This caused "crypto.randomUUID is not a function" error when adding providers. - Add generateUUID() utility with getRandomValues() fallback - Provide user-friendly error message if crypto API unavailable
Jason ·
2025-12-04 17:01:17 +08:00 -
refactor(url): remove automatic trailing slash stripping from base URL inputs
- Remove `.replace(/\/+$/, "")` from all base URL handlers in useBaseUrlState.ts - Remove trailing slash stripping in useCodexConfigState.ts - Remove trailing slash normalization in providerConfigUtils.ts setCodexBaseUrl() - Update i18n hints (en/ja/zh) to instruct users to avoid trailing slashes This gives users explicit control over URL format rather than silently modifying input.
Jason ·
2025-11-29 20:52:29 +08:00 -
feat: add model configuration support and fix Gemini deeplink bug (#251)
* feat(providers): add notes field for provider management - Add notes field to Provider model (backend and frontend) - Display notes with higher priority than URL in provider card - Style notes as non-clickable text to differentiate from URLs - Add notes input field in provider form - Add i18n support (zh/en) for notes field * chore: format code and clean up unused props - Run cargo fmt on Rust backend code - Format TypeScript imports and code style - Remove unused appId prop from ProviderPresetSelector - Clean up unused variables in tests - Integrate notes field handling in provider dialogs * feat(deeplink): implement ccswitch:// protocol for provider import Add deep link support to enable one-click provider configuration import via ccswitch:// URLs. Backend: - Implement URL parsing and validation (src-tauri/src/deeplink.rs) - Add Tauri commands for parse and import (src-tauri/src/commands/deeplink.rs) - Register ccswitch:// protocol in macOS Info.plist - Add comprehensive unit tests (src-tauri/tests/deeplink_import.rs) Frontend: - Create confirmation dialog with security review UI (src/components/DeepLinkImportDialog.tsx) - Add API wrapper (src/lib/api/deeplink.ts) - Integrate event listeners in App.tsx Configuration: - Update Tauri config for deep link handling - Add i18n support for Chinese and English - Include test page for deep link validation (deeplink-test.html) Files: 15 changed, 1312 insertions(+) * chore(deeplink): integrate deep link handling into app lifecycle Wire up deep link infrastructure with app initialization and event handling. Backend Integration: - Register deep link module and commands in mod.rs - Add URL handling in app setup (src-tauri/src/lib.rs:handle_deeplink_url) - Handle deep links from single instance callback (Windows/Linux CLI) - Handle deep links from macOS system events - Add tauri-plugin-deep-link dependency (Cargo.toml) Frontend Integration: - Listen for deeplink-import/deeplink-error events in App.tsx - Update DeepLinkImportDialog component imports Configuration: - Enable deep link plugin in tauri.conf.json - Update Cargo.lock for new dependencies Localization: - Add Chinese translations for deep link UI (zh.json) - Add English translations for deep link UI (en.json) Files: 9 changed, 359 insertions(+), 18 deletions(-) * refactor(deeplink): enhance Codex provider template generation Align deep link import with UI preset generation logic by: - Adding complete config.toml template matching frontend defaults - Generating safe provider name from sanitized input - Including model_provider, reasoning_effort, and wire_api settings - Removing minimal template that only contained base_url - Cleaning up deprecated test file deeplink-test.html * style: fix clippy uninlined_format_args warnings Apply clippy --fix to use inline format arguments in: - src/mcp.rs (8 fixes) - src/services/env_manager.rs (10 fixes) * style: apply code formatting and cleanup - Format TypeScript files with Prettier (App.tsx, EnvWarningBanner.tsx, formatters.ts) - Organize Rust imports and module order alphabetically - Add newline at end of JSON files (en.json, zh.json) - Update Cargo.lock for dependency changes * feat: add model name configuration support for Codex and fix Gemini model handling - Add visual model name input field for Codex providers - Add model name extraction and update utilities in providerConfigUtils - Implement model name state management in useCodexConfigState hook - Add conditional model field rendering in CodexFormFields (non-official only) - Integrate model name sync with TOML config in ProviderForm - Fix Gemini deeplink model injection bug - Correct environment variable name from GOOGLE_GEMINI_MODEL to GEMINI_MODEL - Add test cases for Gemini model injection (with/without model) - All tests passing (9/9) - Fix Gemini model field binding in edit mode - Add geminiModel state to useGeminiConfigState hook - Extract model value during initialization and reset - Sync model field with geminiEnv state to prevent data loss on submit - Fix missing model value display when editing Gemini providers Changes: - 6 files changed, 245 insertions(+), 13 deletions(-)
YoVinchen ·
2025-11-19 09:03:18 +08:00 -
fix(mcp): correct Codex MCP configuration format to [mcp_servers]
BREAKING CHANGE: The [mcp.servers] format was completely incorrect and not any official Codex format. The only correct format is [mcp_servers] at the top level of config.toml. Changes: - Remove incorrect [mcp.servers] nested table support - Always use [mcp_servers] top-level table (official Codex format) - Auto-migrate and cleanup erroneous [mcp.servers] entries on write - Preserve error-tolerant import for migrating old incorrect configs - Simplify sync logic by removing format selection branches (~60 lines) - Update all documentation and tests to reflect correct format - Add warning logs when detecting and cleaning incorrect format Backend (Rust): - mcp.rs: Simplify sync_enabled_to_codex by removing Target enum - mcp.rs: sync_single_server_to_codex now always uses [mcp_servers] - mcp.rs: remove_server_from_codex cleans both locations - mcp.rs: Update import_from_codex comments to clarify format status - tests: Rename test to sync_enabled_to_codex_migrates_erroneous_* - tests: Update assertions to verify migration behavior Frontend (TypeScript): - tomlUtils.ts: Prioritize [mcp_servers] format in parsing - tomlUtils.ts: Update error messages to guide correct format Documentation: - README.md: Correct MCP format reference to [mcp_servers] - CLAUDE.md: Add comprehensive format specification with examples All 79 tests pass. This ensures backward compatibility while enforcing the correct Codex official standard going forward. Refs: https://github.com/openai/codex/issues/3441
Jason ·
2025-11-17 22:57:04 +08:00 -
fix(mcp): improve format/submit UX and fix validation errors
Fixes two critical issues with the MCP JSON input: 1. Format button failed with wrapped format like "server": {...} 2. Submit button failed despite input validation passing Changes: - Updated formatJSON to use smart parser (supports wrapped format) - Simplified submit validation logic (removed redundant validateJsonConfig call) - Improved UX: input preserves original format, cleanup happens on format/submit * Prevents confusing "instant disappearance" when pasting wrapped JSON * Auto-fills ID/Name fields while keeping input unchanged * Format button now strips wrapper key and formats cleanly * Submit button correctly extracts config regardless of format Code quality: - Reduced code by 5 lines (20 changes, 11 insertions, 16 deletions) - Consistent use of parseSmartMcpJson across all JSON operations - No type errors introducedJason ·
2025-11-16 20:40:16 +08:00 -
feat(mcp): add smart JSON parser for flexible input formats
Support multiple MCP configuration input formats: - Pure config object: { "command": "npx", ... } - Key-value pair fragment: "server-name": { "command": "npx", ... } - Wrapped object: { "server-name": { "command": "npx", ... } } The parser automatically: - Detects and wraps JSON fragments into complete objects - Extracts server name from single-key objects - Auto-fills ID and Name fields when applicable - Formats the config for display This improves UX by allowing users to paste configs directly from .claude.json or .codex/config.toml without manual editing.Jason ·
2025-11-16 20:08:04 +08:00 -
feat(mcp): add SSE (Server-Sent Events) transport type support
Add comprehensive support for SSE transport type to MCP server configuration, enabling real-time streaming connections alongside existing stdio and http types. Backend Changes: - Add SSE type validation in mcp.rs validate_server_spec() - Extend Codex TOML import/export to handle SSE servers - Update claude_mcp.rs legacy API for backward compatibility - Unify http/sse handling in json_server_to_toml_table() Frontend Changes: - Extend McpServerSpec type definition to include "sse" - Add SSE radio button to configuration wizard UI - Update wizard form logic to handle SSE url and headers - Add SSE validation in McpFormModal submission Validation & Error Handling: - Add SSE support in useMcpValidation hook (TOML/JSON) - Extend tomlUtils normalizeServerConfig for SSE parsing - Update Zod schemas (common.ts, mcp.ts) with SSE enum - Add SSE error message mapping in errorUtils Internationalization: - Add "typeSse" translations (zh: "sse", en: "sse") Tests: - Add SSE validation test cases in useMcpValidation.test.tsx SSE Configuration Format: { "type": "sse", "url": "https://api.example.com/sse", "headers": { "Authorization": "Bearer token" } }Jason ·
2025-11-16 16:15:17 +08:00 -
feat(gemini): add Gemini provider integration (#202)
* feat(gemini): add Gemini provider integration - Add gemini_config.rs module for .env file parsing - Extend AppType enum to support Gemini - Implement GeminiConfigEditor and GeminiFormFields components - Add GeminiIcon with standardized 1024x1024 viewBox - Add Gemini provider presets configuration - Update i18n translations for Gemini support - Extend ProviderService and McpService for Gemini * fix(gemini): resolve TypeScript errors, add i18n support, and fix MCP logic **Critical Fixes:** - Fix TS2741 errors in tests/msw/state.ts by adding missing Gemini type definitions - Fix ProviderCard.extractApiUrl to support GOOGLE_GEMINI_BASE_URL display - Add missing apps.gemini i18n keys (zh/en) for proper app name display - Fix MCP service Gemini cross-app duplication logic to prevent self-copy **Technical Details:** - tests/msw/state.ts: Add gemini default providers, current ID, and MCP config - ProviderCard.tsx: Check both ANTHROPIC_BASE_URL and GOOGLE_GEMINI_BASE_URL - services/mcp.rs: Skip Gemini in sync_other_side logic with unreachable!() guards - Run pnpm format to auto-fix code style issues **Verification:** - ✅ pnpm typecheck passes - ✅ pnpm format completed * feat(gemini): enhance authentication and config parsing - Add strict and lenient .env parsing modes - Implement PackyCode partner authentication detection - Support Google OAuth official authentication - Auto-configure security.auth.selectedType for PackyCode - Add comprehensive test coverage for all auth types - Update i18n for OAuth hints and Gemini config --------- Co-authored-by: Jason <farion1231@gmail.com>
YoVinchen ·
2025-11-12 10:47:34 +08:00 -
fix(toml): normalize CJK quotes to prevent parsing errors
Add quote normalization to handle Chinese/fullwidth quotes automatically converted by IME. This fixes TOML parsing failures when users input configuration with non-ASCII quotes (" " ' ' etc.). Changes: - Add textNormalization utility for quote normalization - Apply normalization in TOML input handlers (MCP form, Codex config) - Disable browser auto-correction in Textarea component - Add defensive normalization in TOML parsing layerJason ·
2025-11-10 14:35:55 +08:00 -
fix(mcp): preserve custom fields in Codex TOML config editor
Fixed an issue where custom/extension fields (e.g., timeout_ms, retry_count) were silently dropped when editing Codex MCP server configurations in TOML format. Root cause: The TOML parser functions only extracted known fields (type, command, args, env, cwd, url, headers), discarding any additional fields during normalization. Changes: - mcpServerToToml: Now uses spread operator to copy all fields before stringification - normalizeServerConfig: Added logic to preserve unknown fields after processing known ones - Both stdio and http server types now retain custom configuration fields This fix enables forward compatibility with future MCP protocol extensions and allows users to add custom configurations without code changes.
Jason ·
2025-11-10 12:03:15 +08:00 -
refactor(endpoints): implement deferred submission and fix clear-all bug
Implement Solution A (complete deferred submission) for custom endpoint management, replacing the dual-mode system with unified local staging. Changes: - Remove immediate backend saves from EndpointSpeedTest * handleAddEndpoint: local state update only * handleRemoveEndpoint: local state update only * handleSelect: remove lastUsed timestamp update - Add explicit clear detection in ProviderForm * Distinguish "user cleared endpoints" from "user didn't modify" * Pass empty object {} as clear signal vs null for no-change - Fix mergeProviderMeta to handle three distinct cases: * null/undefined: don't modify endpoints (no meta sent) * empty object {}: explicitly clear endpoints (send empty meta) * with data: add/update endpoints (overwrite) Fixed Critical Bug: When users deleted all custom endpoints, changes were not saved because: - draftCustomEndpoints=[] resulted in customEndpointsToSave=null - mergeProviderMeta(meta, null) returned undefined - Backend interpreted missing meta as "don't modify", preserving old values Solution: Detect when user had endpoints and cleared them (hadEndpoints && length===0), then pass empty object to mergeProviderMeta as explicit clear signal. Architecture Improvements: - Transaction atomicity: all fields submitted together on form save - UX consistency: add/edit modes behave identically - Cancel button: true rollback with no immediate saves - Code simplification: removed ~40 lines of immediate save error handling Testing: - TypeScript type check: passed - Rust backend tests: 10/10 passed - Build: successfulJason ·
2025-11-04 15:30:54 +08:00 -
refine(usage): enhance query robustness and error handling
Backend improvements: - Add InvalidHttpMethod error enum for better error semantics - Clamp HTTP timeout to 2-30s to prevent config abuse - Strict HTTP method validation instead of silent fallback to GET Frontend improvements: - Add i18n support for usage query errors (en/zh) - Improve error handling with type-safe unknown instead of any - Optimize i18n import (direct import instead of dynamic) - Disable auto-retry for usage queries to avoid API stampede Additional changes: - Apply prettier formatting to affected files Files changed: - src-tauri/src/error.rs (+2) - src-tauri/src/usage_script.rs (+8 -2) - src/i18n/locales/{en,zh}.json (+4 -1 each) - src/lib/api/usage.ts (+21 -4) - src/lib/query/queries.ts (+1) - style: prettier formatting on 6 other filesJason ·
2025-11-03 10:24:59 +08:00 -
feat: support ANTHROPIC_API_KEY field and add AiHubMix provider
Add compatibility for providers that use ANTHROPIC_API_KEY instead of ANTHROPIC_AUTH_TOKEN, enabling support for AiHubMix and similar services. Changes: - Backend: Add fallback to ANTHROPIC_API_KEY in credential extraction - migration.rs: Support API_KEY during config migration - services/provider.rs: Extract credentials from either field - Frontend: Smart API key field detection and management - getApiKeyFromConfig: Read from either field (AUTH_TOKEN priority) - setApiKeyInConfig: Write to existing field, preserve user choice - hasApiKeyField: Detect presence of either field - Add AiHubMix provider preset with dual endpoint candidates - Define apiKeyField metadata for provider presets (documentation) Technical Details: - Uses or_else() for zero-cost field fallback in Rust - Runtime field detection ensures correct field name preservation - Maintains backward compatibility with existing configurations - Priority: ANTHROPIC_AUTH_TOKEN > ANTHROPIC_API_KEY
Jason ·
2025-11-02 23:10:21 +08:00 -
refactor(config): rename providerPresets to claudeProviderPresets
- Rename src/config/providerPresets.ts to claudeProviderPresets.ts - Update all import statements across 11 files to reflect the new name - Establish symmetrical naming convention with codexProviderPresets.ts - Improve code clarity and maintainability
Jason ·
2025-11-02 21:05:48 +08:00 -
refactor(hooks): introduce unified post-change sync utility
- Add postChangeSync.ts utility with Result pattern for graceful error handling - Replace try-catch with syncCurrentProvidersLiveSafe in useImportExport - Add directory-change-triggered sync in useSettings to maintain SSOT - Introduce partial-success status to distinguish import success from sync failures - Add test coverage for sync behavior in different scenarios This refactoring ensures config.json changes are reliably synced to live files while providing better user feedback for edge cases.
Jason ·
2025-11-01 23:58:29 +08:00 -
feat(editor): add JSON format button to editors
Add one-click format functionality for JSON editors with toast notifications: - Add format button to JsonEditor (CodeMirror) - Add format button to CodexAuthSection (auth.json) - Add format button to CommonConfigEditor (settings + modal) - Add formatJSON utility function - Add i18n keys: format, formatSuccess, formatError Note: TOML formatting was intentionally NOT added to avoid losing comments during parse/stringify operations. TOML validation remains available via the existing useCodexTomlValidation hook.
Jason ·
2025-11-01 21:05:01 +08:00 -
Jason ·
2025-10-30 15:31:08 +08:00 -
fix(providers): preserve custom endpoints in meta during add/edit operations
Fixed two critical data loss bugs where user-added custom endpoints were discarded: 1. **AddProviderDialog**: Form submission ignored values.meta from ProviderForm and re-inferred URLs only from presets/config, causing loss of endpoints added via speed test modal. Now prioritizes form-collected meta and uses fallback inference only when custom_endpoints is missing. 2. **ProviderForm**: Edit mode always returned initialData.meta, discarding any changes made in the speed test modal. Now uses mergeProviderMeta to properly merge customEndpointsMap with existing meta fields. Changes: - Extract mergeProviderMeta utility to handle meta field merging logic - Preserve other meta fields (e.g., usage_script) during endpoint updates - Unify new/edit code paths to use consistent meta handling - Add comprehensive unit tests for meta merging scenarios - Add integration tests for AddProviderDialog submission flow Impact: - Third-party and custom providers can now reliably manage multiple endpoints - Edit operations correctly reflect user modifications - No data loss for existing meta fields like usage_script
Jason ·
2025-10-28 20:28:11 +08:00 -
refactor(mcp): improve data structure with metadata/spec separation
- Separate MCP server metadata from connection spec for cleaner architecture - Add comprehensive server entry fields: name, description, tags, homepage, docs - Remove legacy format compatibility logic from extract_server_spec - Implement data validation and filtering in get_servers_snapshot_for - Add strict id consistency check in upsert_in_config_for - Enhance import logic with defensive programming for corrupted data - Simplify frontend by removing normalization logic (moved to backend) - Improve error messages with contextual information - Add comprehensive i18n support for new metadata fields
Jason ·
2025-10-12 00:08:37 +08:00 -
fix(mcp): improve error message internationalization
- Add translateMcpBackendError utility to map backend errors to i18n keys - Update error handling in McpPanel, McpFormModal, and McpWizardModal - Internationalize stdio/http type selectors in Wizard - Implement three-tier fallback strategy: translation → raw error → default message - No backend changes required, fully frontend-based i18n implementation
Jason ·
2025-10-11 16:20:12 +08:00 -
fix(app): eliminate startup white screen by replacing @iarna/toml with browser-friendly smol-toml
- chore(deps): switch TOML dependency from @iarna/toml to smol-toml and update lockfile - feat(mcp): add TOML editing/validation for Codex while keeping JSON for Claude; support auto ID extraction from TOML and JSON->TOML conversion for wizard output; add pre-submit required checks (stdio.command / http.url) - refactor(mcp): unify JSON/TOML validation errors via i18n; add formatTomlError for consistent, localized messages; consolidate state into formConfig/configError - feat(i18n): add TOML labels/placeholders and error keys (tomlConfig, tomlPlaceholder, tomlInvalid) - feat(utils): introduce tomlUtils with parse/stringify/validate/convert helpers using smol-toml; provide tomlToMcpServer, mcpServerToToml, extractIdFromToml, validateToml - build: confirm Vite no longer externalizes Node builtins during build; renderer builds without 'Module 'stream' has been externalized' warning
Jason ·
2025-10-11 15:34:58 +08:00 -
refactor: improve error handling and code formatting
- Enhanced error messages in Rust backend to include file paths - Improved provider switching error handling with detailed messages - Added MCP button placeholder in UI (functionality TODO) - Applied code formatting across frontend components - Extended error notification duration to 6s for better readability
Jason ·
2025-10-08 21:22:56 +08:00 -
feat: Implement Speed Test Function
* feat: add unified endpoint speed test for API providers Add a comprehensive endpoint latency testing system that allows users to: - Test multiple API endpoints concurrently - Auto-select the fastest endpoint based on latency - Add/remove custom endpoints dynamically - View latency results with color-coded indicators Backend (Rust): - Implement parallel HTTP HEAD requests with configurable timeout - Handle various error scenarios (timeout, connection failure, invalid URL) - Return structured latency data with status codes Frontend (React): - Create interactive speed test UI component with auto-sort by latency - Support endpoint management (add/remove custom endpoints) - Extract and update Codex base_url from TOML configuration - Integrate with provider presets for default endpoint candidates This feature improves user experience when selecting optimal API endpoints, especially useful for users with multiple provider options or proxy setups. * refactor: convert endpoint speed test to modal dialog - Transform EndpointSpeedTest component into a modal dialog - Add "Advanced" button next to base URL input to open modal - Support ESC key and backdrop click to close modal - Apply Linear design principles: minimal styling, clean layout - Remove unused showBaseUrlInput variable - Implement same modal pattern for both Claude and Codex * fix: prevent modal cascade closing when ESC is pressed - Add state checks to prevent parent modal from closing when child modals (endpoint speed test or template wizard) are open - Update ESC key handler dependencies to track all modal states - Ensures only the topmost modal responds to ESC key * refactor: unify speed test panel UI with project design system UI improvements: - Update modal border radius from rounded-lg to rounded-xl - Unify header padding from px-6 py-4 to p-6 - Change speed test button color to blue theme (bg-blue-500) for consistency - Update footer background from bg-gray-50 to bg-gray-100 - Style "Done" button as primary action button with blue theme - Adjust footer button spacing and hover states Simplify endpoint display: - Remove endpoint labels (e.g., "Current Address", "Custom 1") - Display only URL for cleaner interface - Clean up all label-related logic: * Remove label field from EndpointCandidate interface * Remove label generation in buildInitialEntries function * Remove label handling in useEffect merge logic * Remove label generation in handleAddEndpoint * Remove label parameters from claudeSpeedTestEndpoints * Remove label parameters from codexSpeedTestEndpoints * refactor: improve endpoint list UI consistency - Show delete button for all endpoints on hover for uniform UI - Change selected state to use blue theme matching main interface: * Blue border (border-blue-500) for selected items * Light blue background (bg-blue-50/dark:bg-blue-900/20) * Blue indicator dot (bg-blue-500/dark:bg-blue-400) - Switch from compact list (space-y-px) to card-based layout (space-y-2) - Add rounded corners to each endpoint item for better visual separation * feat: persist custom endpoints to settings.json - Extend AppSettings to store custom endpoints for Claude and Codex - Add Tauri commands: get/add/remove/update custom endpoints - Update frontend API with endpoint persistence methods - Modify EndpointSpeedTest to load/save custom endpoints via API - Track endpoint last used time for future sorting/cleanup - Store endpoints per app type in settings.json instead of localStorage * - feat(types): add Provider.meta and ProviderMeta (snake_case) with custom_endpoints map - feat(provider-form): persist custom endpoints on provider create by merging EndpointSpeedTest’s custom URLs into meta.custom_endpoints on submit - feat(endpoint-speed-test): add onCustomEndpointsChange callback emitting normalized custom URLs; wire it for both Claude/Codex modals - fix(api): send alias param names (app/appType/app_type and provider_id/providerId) in Tauri invokes to avoid “missing providerId” with older backends - storage: custom endpoints are stored in ~/.cc-switch/config.json under providers[<id>].meta.custom_endpoints (not in settings.json) - behavior: edit flow remains immediate writes; create flow now writes once via addProvider, removing the providerId dependency during creation * feat: add endpoint candidates support and code formatting improvements - Add endpointCandidates field to ProviderPreset and CodexProviderPreset interfaces - Integrate preset endpoint candidates into speed test endpoint selection - Add multiple endpoint options for PackyCode providers (Claude & Codex) - Apply consistent code formatting (trailing commas, line breaks) - Improve template value type safety and readability * refactor: improve endpoint management button UX Replace ambiguous "Advanced" text with intuitive "Manage & Test" label accompanied by Zap icon, making the endpoint management panel entry point more discoverable and self-explanatory for both Claude and Codex configurations. * - merge: merge origin/main, resolve conflicts and preserve both feature sets - feat(tauri): register import/export and file dialogs; keep endpoint speed test and custom endpoints - feat(api): add updateTrayMenu and onProviderSwitched; wire import/export APIs - feat(types): extend global API declarations (import/export) - chore(presets): GLM preset supports both new and legacy model keys - chore(rust): add chrono dependency; refresh lockfile --------- Co-authored-by: Jason <farion1231@gmail.com>
YoVinchen ·
2025-10-07 19:14:32 +08:00 -
Jason ·
2025-10-03 20:03:55 +08:00 -
Lakr ·
2025-10-02 22:14:35 +08:00 -
refactor: consolidate chatgpt.config cleanup logic
Merged duplicate try-catch blocks that handle invalid chatgpt.config values. Now handles all edge cases (scalar values, arrays, empty objects) in a single unified check, reducing code duplication and improving performance by parsing JSON only once.
farion1231 ·
2025-09-26 09:27:56 +08:00 -
- refactor(utils): extract Codex base_url parsing into shared helpers
- refactor(ProviderList): use shared base_url helpers - refactor(App): reuse shared base_url helpers for VS Code sync - fix(auto-sync): global shared VS Code auto-apply state (localStorage + event broadcast) - feat(tray): auto-apply to VS Code on Codex provider-switched when enabled - behavior: manual Apply enables auto-sync; manual Remove disables; official providers clear managed keys only - chore(typecheck): pass pnpm typecheck
Jason ·
2025-09-19 14:22:39 +08:00 -
- feat(codex): Add “Apply to VS Code/Remove from VS Code” button on current Codex provider card
- feat(tauri): Add commands to read/write VS Code settings.json with cross-variant detection (Code/Insiders/VSCodium/OSS) - fix(vscode): Use top-level keys “chatgpt.apiBase” and “chatgpt.config.preferred_auth_method” - fix(vscode): Handle empty settings.json (skip deletes, direct write) to avoid “Can not delete in empty document” - fix(windows): Make atomic writes robust by removing target before rename - ui(provider-list): Improve error surfacing when applying/removing - chore(types): Extend window.api typings and tauri-api wrappers for VS Code commands - deps: Add jsonc-parser
Jason ·
2025-09-19 08:30:29 +08:00 -
refactor: simplify TOML common config handling by removing markers
- Remove COMMON_CONFIG_MARKER_START/END constants - Simplify config snippet addition/removal logic - Use natural append/replace approach instead of markers - Fix unused variable warning - Improve user experience with cleaner config output
Jason ·
2025-09-18 22:33:55 +08:00 -
Revert "feat: add VS Code ChatGPT plugin config sync functionality"
This reverts commit
9bf216b102.Jason ·
2025-09-18 17:57:32 +08:00 -
Revert "fix: improve VS Code config synchronization and code formatting"
This reverts commit
463e430a3d.Jason ·
2025-09-18 17:57:32 +08:00 -
fix: improve VS Code config synchronization and code formatting
- Add automatic VS Code config sync when base_url changes in TOML - Improve error handling for VS Code configuration writes - Enhance state management with ref tracking to prevent duplicate API calls - Fix code formatting issues and improve readability across components - Optimize common configuration handling for both Claude and Codex providers
Jason ·
2025-09-18 15:25:10 +08:00 -
Jason ·
2025-09-18 10:58:03 +08:00 -
fix: improve JSON validation with unified validation function
- Extract common validateJsonConfig function for reuse - Apply unified validation to both main config and common config snippets - Add real-time JSON validation to JsonEditor component using CodeMirror linter - Simplify error handling without over-engineering error position extraction
Jason ·
2025-09-18 08:35:09 +08:00 -
refactor: extract error message handling to utils module
- Move extractErrorMessage function from App.tsx to utils/errorUtils.ts - Improve code organization and reusability - Enhance error notification with dynamic message extraction and timeout
Jason ·
2025-09-17 23:47:17 +08:00 -
feat: add common config support for Codex with TOML format
- Added separate common config state and storage for Codex - Implemented TOML-based common config merging with markers - Created UI components for Codex common config editor - Added toggle and edit functionality similar to Claude config - Store Codex common config in localStorage separately - Support appending/removing common TOML snippets to config.toml
Jason ·
2025-09-17 10:44:30 +08:00 -
refactor: replace co-authored setting with flexible common config snippet feature
- Replace single "disable co-authored" checkbox with universal "common config snippet" functionality - Add localStorage persistence for common config snippets - Implement deep merge/remove operations for complex JSON structures - Add modal editor for managing common config snippets - Optimize performance with custom deepClone function instead of JSON.parse/stringify - Fix deep remove logic to only delete matching values - Improve error handling and validation for JSON snippets
Jason ·
2025-09-16 22:59:00 +08:00 -
feat: refactor ProviderForm component with new subcomponents (#13)
* feat: refactor ProviderForm component with new subcomponents - Introduced PresetSelector, ApiKeyInput, ClaudeConfigEditor, and CodexConfigEditor for improved modularity and readability. - Simplified preset selection logic for both Claude and Codex configurations. - Enhanced API Key input handling with dedicated components for better user experience. - Removed redundant code and improved state management in the ProviderForm component. * feat: add Kimi model selection to ProviderForm component - Introduced KimiModelSelector for enhanced model configuration options. - Implemented state management for Kimi model selection, including initialization and updates based on preset selection. - Improved user experience by conditionally displaying the Kimi model selector based on the selected preset. - Refactored related logic to ensure proper handling of Kimi-specific settings in the ProviderForm. * feat: enhance API Key input and model selection in ProviderForm - Added toggle functionality to show/hide API Key in ApiKeyInput component for improved user experience. - Updated placeholder text in ProviderForm to provide clearer instructions based on the selected preset. - Enhanced KimiModelSelector to display a more informative message when API Key is not provided. - Refactored provider presets to remove hardcoded API Key values for better security practices. * fix(kimi): optimize debounce implementation in model selector - Fix initial state: use empty string instead of apiKey.trim() - Refactor fetchModels to fetchModelsWithKey with explicit key parameter - Ensure consistent behavior between auto-fetch and manual refresh - Eliminate mental overhead from optional parameter fallback logic * fix(api-key): remove custom masking logic, use native password input - Remove getDisplayValue function with custom star masking - Use native browser password input behavior for better UX consistency - Simplify component logic while maintaining show/hide toggle functionality * chore: format code with prettier - Apply consistent code formatting across all TypeScript files - Fix indentation and spacing according to project style guide --------- Co-authored-by: Jason <farion1231@gmail.com>
TinsFox ·
2025-09-06 23:13:01 +08:00 -
feat: JsonEditor for inputting JSON content (#4)
* feat(editor): add JsonEditor component for JSON configuration editing * fix(provider): update API Key visibility logic in ProviderForm component * fix(editor): stabilize JsonEditor height and restore API Key logic - Revert API Key visibility to preset-based rule and injection to non-custom preset only. - Reduce JsonEditor min-height from rows*22px to rows*18px to lessen layout jitter when switching presets. - Keep fonts/size consistent with the previous textarea for visual parity. * - fix(form): remove websiteUrl auto-extraction from JSON to prevent incorrect overrides --------- Co-authored-by: Jason <farion1231@gmail.com>
QuentinHsu ·
2025-09-06 09:30:09 +08:00 -
chore: format code and fix bundle identifier for v3.0.0 release
- Format all TypeScript/React code with Prettier - Format all Rust code with cargo fmt - Fix bundle identifier from .app to .desktop to avoid macOS conflicts - Prepare codebase for v3.0.0 Tauri release
Jason ·
2025-08-27 11:00:53 +08:00