* feat(gemini): update model types and add support for gemini3 variants
add new model type identifiers for gemini3 flash and pro variants
implement utility functions to detect gemini3 flash and pro models
update reasoning configuration and tests for new gemini variants
* docs(i18n): update chinese translation for minimal_description
* chore: update @ai-sdk/google and @ai-sdk/google-vertex dependencies
- Update @ai-sdk/google to version 2.0.49 with patch for model path fix
- Update @ai-sdk/google-vertex to version 3.0.94 with updated dependencies
* feat(gemini): add thinking level mapping for Gemini 3 models
Implement mapping between reasoning effort options and Gemini's thinking levels. Enable thinking config for Gemini 3 models to support advanced reasoning features.
* chore: update yarn.lock with patched @ai-sdk/google dependency
* test(reasoning): update tests for Gemini model type classification and reasoning options
Update test cases to reflect new Gemini model type classifications (gemini2_flash, gemini3_flash, gemini2_pro, gemini3_pro) and their corresponding reasoning effort options. Add tests for Gemini 3 models and adjust existing ones to match current behavior.
* docs(reasoning): remove outdated TODO comment about model support
* feat: add support for Xiaomi MiMo model
- Implemented support for the MiMo model in reasoning logic.
- Added MiMo model configuration in default models.
- Included MiMo logos for both models and providers.
- Updated provider configurations to include Xiaomi MiMo.
- Enhanced reasoning effort and options to accommodate MiMo.
- Added migration logic for state management to include MiMo.
- Updated versioning in store to reflect changes.
* chore(i18n): add specific provider name
* fix(provider): add xiaomi mimo anthropic apihost
* chore: url
* fix: add tool use capability
* ✨ feat(mcp): add Nowledge Mem builtin MCP server
Add @cherry/nowLedgeMem as a new builtin MCP server that connects
to local Nowledge Mem service via HTTP at 127.0.0.1:14242/mcp.
- Add nowLedgeMem to BuiltinMCPServerNames type definitions
- Add HTTP transport handling in MCPService with APP header
- Add server config to builtinMCPServers array
- Add i18n translations (en-us, zh-cn, zh-tw)
* Fix Nowledge Mem server name typos across codebase
* 🌐 i18n: add missing translations for Nowledge Mem and Git Bash settings
Translate [to be translated] markers across 8 locale files:
- zh-tw, de-de, fr-fr, es-es, pt-pt, ru-ru: nowledgeMem description
- fr-fr, es-es, pt-pt, ru-ru, el-gr, ja-jp: xhigh reasoning chain option
- el-gr, ja-jp: Git Bash configuration strings
* 🐛 fix: address PR review comments for Nowledge Mem MCP
- Fix log message typo: use server.name instead of hardcoded "NowLedgeMem"
- Rename i18n key from "nowledgeMem" to "nowledge_mem" for consistency
- Update descriptions to warn about external dependency requirement
* refactor: improve budget calculation logic
* Update src/renderer/src/aiCore/utils/__tests__/reasoning.test.ts
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Update src/renderer/src/aiCore/utils/__tests__/reasoning.test.ts
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* [WIP] Address feedback on budget calculation logic refactor (#11974)
* Initial plan
* fix: revert budget calculation to linear interpolation formula
Reverted the budget calculation in getAnthropicThinkingBudget from
`tokenLimit.max * effortRatio` back to the original linear interpolation
formula `(tokenLimit.max - tokenLimit.min) * effortRatio + tokenLimit.min`.
The new formula was causing lower budgets for all effort ratios (e.g.,
LOW effort changed from 2609 to 1638 tokens, a 37% reduction). The linear
interpolation formula ensures budgets range from min (at effortRatio=0) to
max (at effortRatio=1), matching the behavior in other parts of the codebase
(lines 221, 597).
Updated tests to reflect the correct expected values with the linear
interpolation formula.
Co-authored-by: DeJeune <67425183+DeJeune@users.noreply.github.com>
---------
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: DeJeune <67425183+DeJeune@users.noreply.github.com>
* fix(test): reasoning
* fix: test
---------
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
* feat(reasoning): add default reasoning effort option and update i18n
Add 'default' reasoning effort option to all reasoning models to represent no additional configuration. Update translations for new option and modify reasoning logic to handle default case. Also update store version and migration for new reasoning_effort field.
Update test cases and reasoning configuration to include default option. Add new lightbulb question icon for default reasoning state.
* fix(ThinkingButton): correct isThinkingEnabled condition to exclude 'default'
The condition now properly disables thinking when effort is 'default' to match intended behavior. Click thinking button will not switch reasoning effort to 'none'.
* refactor(types): improve reasoning_effort_cache documentation
Update comments to clarify the purpose and future direction of reasoning_effort_cache
Remove TODO and replace with FIXME suggesting external cache service
* feat(i18n): add reasoning effort descriptions and update thinking button logic
add descriptions for reasoning effort options in multiple languages
move reasoning effort label maps to component for better maintainability
* fix(aiCore): handle default reasoning_effort value consistently across providers
Ensure consistent behavior when reasoning_effort is 'default' or undefined by returning empty object
* test(reasoning): fix failing tests after 'default' option introduction
Fixed two test cases that were failing after the introduction of the 'default'
reasoning effort option:
1. getAnthropicReasoningParams test: Updated to explicitly set reasoning_effort
to 'none' instead of empty settings, as undefined/empty now represents
'default' behavior (no configuration override)
2. getGeminiReasoningParams test: Similarly updated to set reasoning_effort
to 'none' for the disabled thinking test case
This aligns with the new semantic where:
- undefined/'default' = use model's default behavior (returns {})
- 'none' = explicitly disable reasoning (returns disabled config)
* feat: auto-discover and persist Git Bash path on Windows
- Add autoDiscoverGitBash function to find and cache Git Bash path when needed
- Modify System_CheckGitBash IPC handler to auto-discover and persist path
- Update Claude Code service with fallback auto-discovery mechanism
- Git Bash path is now cached after first discovery, improving UX for Windows users
* udpate
* fix: remove redundant validation of auto-discovered Git Bash path
The autoDiscoverGitBash function already returns a validated path, so calling validateGitBashPath again is unnecessary.
Co-Authored-By: Claude <noreply@anthropic.com>
* udpate
* test: add unit tests for autoDiscoverGitBash function
Add comprehensive test coverage for autoDiscoverGitBash including:
- Discovery with no existing config path
- Validation of existing config paths
- Handling of invalid existing paths
- Config persistence verification
- Real-world scenarios (standard Git, portable Git, user-configured paths)
Co-Authored-By: Claude <noreply@anthropic.com>
* fix: remove unnecessary async keyword from System_CheckGitBash handler
The handler doesn't use await since autoDiscoverGitBash is synchronous.
Removes async for consistency with other IPC handlers.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* fix: rename misleading test to match actual behavior
Renamed "should not call configManager.set multiple times on single discovery"
to "should persist on each discovery when config remains undefined" to
accurately describe that each call to autoDiscoverGitBash persists when
the config mock returns undefined.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* refactor: use generic type parameter instead of type assertion
Replace `as string | undefined` with `get<string | undefined>()` for
better type safety when retrieving GitBashPath from config.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* refactor: simplify Git Bash path resolution in Claude Code service
Remove redundant validateGitBashPath call since autoDiscoverGitBash
already handles validation of configured paths before attempting
discovery. Also remove unused ConfigKeys and configManager imports.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* fix: attempt auto-discovery when configured Git Bash path is invalid
Previously, if a user had an invalid configured path (e.g., Git was
moved or uninstalled), autoDiscoverGitBash would return null without
attempting to find a valid installation. Now it logs a warning and
attempts auto-discovery, providing a better user experience by
automatically fixing invalid configurations.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* fix: ensure CLAUDE_CODE_GIT_BASH_PATH env var takes precedence over config
Previously, if a valid config path existed, the environment variable
CLAUDE_CODE_GIT_BASH_PATH was never checked. Now the precedence order is:
1. CLAUDE_CODE_GIT_BASH_PATH env var (highest - runtime override)
2. Configured path from settings
3. Auto-discovery via findGitBash
This allows users to temporarily override the configured path without
modifying their persistent settings.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* refactor: improve code quality and test robustness
- Remove duplicate logging in Claude Code service (autoDiscoverGitBash logs internally)
- Simplify Git Bash path initialization with ternary expression
- Add afterEach cleanup to restore original env vars in tests
- Extract mockExistingPaths helper to reduce test code duplication
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* feat: track Git Bash path source to distinguish manual vs auto-discovered
- Add GitBashPathSource type and GitBashPathInfo interface to shared constants
- Add GitBashPathSource config key to persist path origin ('manual' | 'auto')
- Update autoDiscoverGitBash to mark discovered paths as 'auto'
- Update setGitBashPath IPC to mark user-set paths as 'manual'
- Add getGitBashPathInfo API to retrieve path with source info
- Update AgentModal UI to show different text based on source:
- Manual: "Using custom path" with clear button
- Auto: "Auto-discovered" without clear button
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* refactor: simplify Git Bash config UI as form field
- Replace large Alert components with compact form field
- Use static isWin constant instead of async platform detection
- Show Git Bash field only on Windows with auto-fill support
- Disable save button when Git Bash path is missing on Windows
- Add "Auto-discovered" hint for auto-detected paths
- Remove hasGitBash state, simplify checkGitBash logic
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* ui: add explicit select button for Git Bash path
Replace click-on-input interaction with a dedicated "Select" button
for clearer UX
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* refactor: simplify Git Bash UI by removing clear button
- Remove handleClearGitBash function (no longer needed)
- Remove clear button from UI (auto-discover fills value, user can re-select)
- Remove auto-discovered hint (SourceHint)
- Remove unused SourceHint styled component
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* feat: add reset button to restore auto-discovered Git Bash path
- Add handleResetGitBash to clear manual setting and re-run auto-discovery
- Show "Reset" button only when source is 'manual'
- Show "Auto-discovered" hint when path was found automatically
- User can re-select if auto-discovered path is not suitable
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* fix: re-run auto-discovery when resetting Git Bash path
When setGitBashPath(null) is called (reset), now automatically
re-runs autoDiscoverGitBash() to restore the auto-discovered path.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* feat(i18n): add Git Bash config translations
Add translations for:
- autoDiscoveredHint: hint text for auto-discovered paths
- placeholder: input placeholder for bash.exe selection
- tooltip: help tooltip text
- error.required: validation error message
Supported languages: en-US, zh-CN, zh-TW
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* update i18n
* fix: auto-discover Git Bash when getting path info
When getGitBashPathInfo() is called and no path is configured,
automatically trigger autoDiscoverGitBash() first. This handles
the upgrade scenario from old versions that don't have Git Bash
path configured.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
---------
Co-authored-by: Claude <noreply@anthropic.com>
* refactor: rewrite filesystem MCP server with new tool set
- Replace existing filesystem MCP with modular architecture
- Implement 6 new tools: glob, ls, grep, read, write, delete
- Add comprehensive TypeScript types and Zod schemas
- Maintain security with path validation and allowed directories
- Improve error handling and user feedback
- Add result limits for performance (100 files/matches max)
- Format output with clear, helpful messages
- Keep backward compatibility with existing import patterns
BREAKING CHANGE: Tools renamed from snake_case to lowercase
- read_file → read
- write_file → write
- list_directory → ls
- search_files → glob
- New tools: grep, delete
- Removed: edit_file, create_directory, directory_tree, move_file, get_file_info
* 🐛 fix: remove filesystem allowed directories restriction
* 🐛 fix: relax binary detection for text files
* ✨ feat: add edit tool with fuzzy matching to filesystem MCP server
- Add edit tool with 9 fallback replacers from opencode for robust
string replacement (SimpleReplacer, LineTrimmedReplacer,
BlockAnchorReplacer, WhitespaceNormalizedReplacer, etc.)
- Add Levenshtein distance algorithm for similarity matching
- Improve descriptions for all tools (read, write, glob, grep, ls, delete)
following opencode patterns for better LLM guidance
- Register edit tool in server and export from tools index
* ♻️ refactor: replace allowedDirectories with baseDir in filesystem MCP server
- Change server to use single baseDir (from WORKSPACE_ROOT env or userData/workspace default)
- Remove list_allowed_directories tool as restriction mechanism is removed
- Add ripgrep integration for faster grep searches with JS fallback
- Simplify validatePath() by removing allowlist checks
- Display paths relative to baseDir in tool outputs
* 📝 docs: standardize filesystem MCP server tool descriptions
- Unify description format to bullet-point style across all tools
- Add absolute path requirement to ls, glob, grep schemas and descriptions
- Update glob and grep to output absolute paths instead of relative paths
- Add missing error case documentation for edit tool (old_string === new_string)
- Standardize optional path parameter descriptions
* ♻️ refactor: use ripgrep for glob tool and extract shared utilities
- Extract shared ripgrep utilities (runRipgrep, getRipgrepAddonPath) to types.ts
- Rewrite glob tool to use `rg --files --glob` for reliable file matching
- Update grep tool to import shared ripgrep utilities
* 🐛 fix: handle ripgrep exit code 2 with valid results in glob tool
- Process ripgrep stdout when content exists, regardless of exit code
- Exit code 2 can indicate partial errors while still returning valid results
- Remove fallback directory listing (had buggy regex for root-level files)
- Update tool description to clarify patterns without "/" match at any depth
* 🔥 chore: remove filesystem.ts.backup file
Remove unnecessary backup file from mcpServers directory
* 🐛 fix: use correct default workspace path in filesystem MCP server
Change default baseDir from userData/workspace to userData/Data/Workspace
to match the app's data storage convention (Data/Files, Data/Notes, etc.)
Addresses PR #11937 review feedback.
* 🐛 fix: pass WORKSPACE_ROOT to FileSystemServer constructor
The envs object passed to createInMemoryMCPServer was not being used
for the filesystem server. Now WORKSPACE_ROOT is passed as a constructor
parameter, following the same pattern as other MCP servers.
* \feat: add link to documentation for MCP server configuration requirement
Wrap the configuration requirement tag in a link to the documentation for better user guidance on MCP server settings.
---------
Co-authored-by: kangfenmao <kangfenmao@qq.com>
Change the default knowledge base retrieval behavior from tool call to prompt injection mode.
This provides faster response times when knowledge base search is forced.
Intent recognition mode (tool call) is still available as an opt-in option.
- Remove toolChoiceMiddleware for forced knowledge base search
- Add prompt injection for knowledge base references in KnowledgeService
- Move transformMessagesAndFetch to ApiService, delete OrchestrateService
- Export getMessageContent from searchOrchestrationPlugin
- Add setCitationBlockId callback to citationCallbacks
- Default knowledgeRecognition to 'off' (prompt mode)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
feat(assistants): merge import and subscribe popups, add export to manage
- Merge import and subscribe buttons into single unified popup
- Add export functionality to manage assistant presets
- Change delete mode to manage mode with both export and delete options
- Show import count in success message
- Default to manage mode when opening manage popup
- Fix unsubscribe button to clear URL properly
- Fix file import not working issue
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
* feat(topics): add topic manage mode for batch operations
- Add topic manage mode with batch delete and move operations
- Implement search functionality within manage mode with keyword matching
- Create reusable AssistantAvatar component for consistent icon display
- Add assistant icons to move-to dropdown menus
- Include selection badge with clear selection tooltip
- Add delete confirmation dialog with danger button styling
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* refactor(TopicManageMode): convert styled components to Tailwind CSS
- Replace styled-components with Tailwind CSS for ManagePanel, ManagePanelContent, ManageIconButton, and other UI elements.
- Update button styling to use Tailwind classes for improved consistency and maintainability.
- Enhance component structure with functional components and props for better reusability.
* style(Topics): update HeaderIconButton dimensions and border radius
- Increased dimensions of HeaderIconButton from 28px to 32px for improved visibility.
- Updated border radius to use a CSS variable for consistency with other UI elements.
---------
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
- Incremented the version number in the persisted reducer from 185 to 186.
- Added migration logic for version 186 to handle API server settings and OpenAI configuration updates, ensuring compatibility with existing user settings.
This change prepares the application for the new migration requirements and maintains backward compatibility.
* feat: add tool use mode setting to default assistant settings
- Add toolUseMode selector (prompt/function) to DefaultAssistantSettings
- Add dividers between model parameter sections for better UI
- Reduce slider margins for compact layout
- Add migration (v185) to reset toolUseMode to 'function' for existing users
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* fix: reset toolUseMode for all assistants during migration
- Update migration logic to reset toolUseMode to 'function' for all assistants with a 'prompt' setting.
- Ensure compatibility with function calling models by checking model type before resetting.
---------
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Simplifies and centralizes header construction by merging defaultAppHeaders and extra_headers, and sets X-Api-Key for OpenAI providers. Removes redundant header assignment logic for improved maintainability.
* refactor: rename i18n commands for better consistency
- Rename `check:i18n` to `i18n:check`
- Rename `sync:i18n` to `i18n:sync`
- Rename `update:i18n` to `i18n:translate` (clearer purpose)
- Rename `auto:i18n` to `i18n:all` (runs check, sync, and translate)
- Update lint script to use new `i18n:check` command name
This follows the common naming convention of grouping related commands
under a namespace prefix (e.g., `test:main`, `test:renderer`).
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* refactor: update i18n command names and improve documentation
- Renamed i18n commands for consistency: `sync:i18n` to `i18n:sync`, `check:i18n` to `i18n:check`, and `auto:i18n` to `i18n:translate`.
- Updated relevant documentation and scripts to reflect new command names.
- Improved formatting and clarity in i18n-related guides and scripts.
This change enhances the clarity and usability of i18n commands across the project.
---------
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
* ✨ feat: add CDP browser MCP server
* ♻️ refactor: add navigation timeout for browser cdp
* 🐛 fix: reuse window for execute and add debugger logging
* ✨ feat: add show option and multiline execute for browser cdp
* ✨ feat: support multiple sessions for browser cdp
* ♻️ refactor: add LRU and idle cleanup for browser cdp sessions
* Refactor browser-cdp for readability and set Firefox UA
* 🐛 fix: type electron mock for cdp tests
* ♻️ refactor: rename browser_cdp MCP server to browser
Simplify the MCP server name from @cherry/browser-cdp to just browser
for cleaner tool naming in the MCP protocol.
* ✨ feat: add fetch tool to browser MCP server
Add a new `fetch` tool that uses the CDP-controlled browser to fetch URLs
and return content in various formats (html, txt, markdown, json).
Also ignore .conductor folder in biome and eslint configs.
* ♻️ refactor: split browser MCP server into modular folder structure
Reorganize browser.ts (525 lines) into browser/ folder with separate
files for better maintainability. Each tool now has its own file with
schema, definition, and handler.
* ♻️ refactor: use switch statement in browser server request handler
* ♻️ refactor: extract helpers and use handler registry pattern
- Add successResponse/errorResponse helpers in tools/utils.ts
- Add closeWindow helper to consolidate window cleanup logic
- Add ensureDebuggerAttached helper to consolidate debugger setup
- Add toolHandlers map for registry-based handler lookup
- Simplify server.ts to use dynamic handler dispatch
* 🐛 fix: improve browser MCP server robustness
- Add try-catch for JSON.parse in fetch() to handle invalid JSON gracefully
- Add Zod schema validation to reset tool for consistency with other tools
- Fix memory leak in open() by ensuring event listeners cleanup on timeout
- Add JSDoc comments for key methods and classes
* ♻️ refactor: rename browser MCP to @cherry/browser
Follow naming convention of other builtin MCP servers.
* 🌐 i18n: translate pending strings across 8 locales
Translate all "[to be translated]" markers including:
- CDP browser MCP server description (all 8 locales)
- "Extra High" reasoning chain length option (6 locales)
- Git Bash configuration strings (el-gr, ja-jp)
* ✨ feat: add ExaMCP free web search provider
Add a new web search provider that uses Exa's free MCP API endpoint,
requiring no API key. This provides users with a free alternative
to the existing Exa provider.
- Add 'exa-mcp' to WebSearchProviderIds
- Create ExaMcpProvider using JSON-RPC/SSE protocol
- Add provider config and migration for existing users
- Use same Exa logo in settings UI
* Add robust text chunk parser for ExaMcpProvider results
* feat(translate): add reasoning effort option to translate service
Add support for configuring reasoning effort level in translation requests. This allows better control over the translation quality and processing time based on model capabilities.
* test: add comprehensive tests for getModelSupportedReasoningEffort
* test(reasoning): update model test cases and comments
- Remove test case for 'gpt-4o-deep-research' as it needs to be an actual OpenAI model
- Add provider requirement comment for Grok 4 Fast recognition
- Simplify array assertions in test cases
- Add comment about Qwen models working well for name-based fallback
* docs(reasoning): add detailed jsdoc for getModelSupportedReasoningEffort
* refactor(openai): replace getThinkModelType with getModelSupportedReasoningEffort
Simplify reasoning effort validation by using getModelSupportedReasoningEffort
* refactor(models): rename getModelSupportedReasoningEffort to getModelSupportedReasoningEffortOptions
Update function name and all related references to better reflect its purpose of returning reasoning effort options
* fix(code-viewer): copy selected code without line numbers
* fix(context-menu): strip line numbers from code selection
* style(codeviewer): fix format
* fix: preserve indentation and format when copying mixed content (text + code blocks)
- Replace regex-based extraction with DOM structure-based approach
- Remove line number elements while preserving all other content
- Use TreeWalker to handle mixed content (text paragraphs + code blocks)
- Preserve indentation and newlines in code blocks
- Simplify CodeViewer.tsx by removing duplicate context menu logic
Fixes#11790
* style: remove unused comment
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* refactor: optimize TreeWalker performance
---------
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
- Increased maxHeight of the modal body to 70vh for improved visibility.
- Changed LogList to extend Scrollbar for better scrolling experience.
- Updated LogItem background color to use a more appropriate variable for consistency.
- Add tool calling support in tooluse.ts
- Add reasoning support in reasoning.ts
- Add vision support in vision.ts
Doubao Seed Code models (doubao-seed-code-preview-251028 and future models)
now support function calling, deep thinking (enabled/disabled), and image understanding.
Updated the marginRight property in the Chat component to include the border width when the topic position is 'right' and topics are shown. This change enhances the layout by ensuring proper spacing in the UI.
* feat: support gpt 5.2
* feat: support param when set to 'none'
* chore version & simply type
* fix: comment
* fix: typecheck
* replace placeholder
* simplify func
* feat: add gpt-5.1-codex-max
* fix: correct token calculation in prompt tool use plugin
- Fix duplicate token accumulation in recursive stream handling
- Accumulate usage for finish-step without tool calls
- Filter out recursive stream's start/finish events (only one per conversation)
- Make accumulateUsage method public for reuse
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* refactor: simplify pipeRecursiveStream method in StreamEventManager
- Removed unnecessary context parameter from pipeRecursiveStream method
- Streamlined the invocation of pipeRecursiveStream in recursive call handling
This change enhances code clarity and reduces complexity in stream management.
---------
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
* fix: update Ollama provider options for Qwen model support
Pass the model to buildOllamaProviderOptions and enable 'think' option only for supported Qwen models. This improves reasoning capability handling for Ollama providers.
* fix: empty array
* feat: ollama oss
---------
Co-authored-by: suyao <sy20010504@gmail.com>
- Updated InputbarCore to avoid closing the quick panel when in multiple selection mode or if triggered by input.
- Removed unnecessary useEffect in KnowledgeBaseButton that dynamically updated the quick panel list based on selected bases.
* feat(assistants): enhance ManageAssistantPresetsPopup with sort and batch delete modes
- Merge sorting and batch delete functionality into a single popup
- Add Segmented control to switch between sort and delete modes
- Sort mode: drag and drop to reorder assistants using DraggableList
- Delete mode: select and batch delete assistants with checkbox
- Add "+100" button for quick batch selection when there are many presets
- Add manage button to AssistantPresetsPage header
- Update AssistantPresetCard menu to use the new ManageAssistantPresetsPopup
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* feat(assistants): improve selection logic in ManageAssistantPresetsPopup
- Update the "+100" button functionality to select the next 100 unselected presets starting from the last selected preset.
- Enhance user experience by ensuring that the selection continues from the correct index, allowing for more intuitive batch selection of presets.
* feat(assistants): adjust initial mode in ManageAssistantPresetsPopup based on preset count
- Modify the initial state of the mode to switch between 'delete' and 'sort' based on the number of presets available, enhancing user experience by optimizing the default action for larger preset collections.
---------
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
* Initial plan
* ✨ feat: Add print to PDF and save as HTML for mini program webviews
- Add IPC channels for Webview_PrintToPDF and Webview_SaveAsHTML
- Implement printWebviewToPDF and saveWebviewAsHTML functions in WebviewService
- Add keyboard shortcuts handlers (Cmd/Ctrl+P for print, Cmd/Ctrl+S for save)
- Update WebviewContainer to handle keyboard shortcuts and trigger print/save actions
- Add preload API methods for webview print and save operations
Co-authored-by: DeJeune <67425183+DeJeune@users.noreply.github.com>
* ♻️ refactor: Improve webview ID handling and remove unused import
- Get webviewId dynamically when shortcuts are triggered instead of caching
- Remove unused 'join' import from WebviewService
- Add null check for webviewId in shortcut handler
Co-authored-by: DeJeune <67425183+DeJeune@users.noreply.github.com>
* 🐛 fix: Improve doctype serialization for better cross-browser compatibility
- Use direct DOCTYPE construction instead of XMLSerializer
- More reliable across different browser contexts
- Based on code review feedback
Co-authored-by: DeJeune <67425183+DeJeune@users.noreply.github.com>
* ✨ enhance: Complete DOCTYPE support with publicId and systemId
- Add full DOCTYPE construction including publicId and systemId
- Fix grammar in comment (custom -> with custom logic)
- Ensures proper HTML5 and XHTML document types are preserved
Co-authored-by: DeJeune <67425183+DeJeune@users.noreply.github.com>
* 🔒 security: Add input validation and improve code structure
- Extract shortcut checking logic into isHandledShortcut helper
- Add try-catch in executeJavaScript for safety
- Escape quotes in DOCTYPE publicId and systemId
- Add optional chaining for documentElement
- Provide fallback if doctype properties are unexpected
Co-authored-by: DeJeune <67425183+DeJeune@users.noreply.github.com>
* 🐛 fix: Correct DOCTYPE declaration format and quote escaping
- Use single quotes and proper escaping for DOCTYPE attributes
- Add SYSTEM keyword for systemId-only cases
- Ensure PUBLIC is only used with publicId
- Fix quote escaping to use backslashes instead of HTML entities
- Properly handle all DOCTYPE declaration formats per HTML/SGML spec
Co-authored-by: DeJeune <67425183+DeJeune@users.noreply.github.com>
* 🐛 fix: Correct JavaScript string escaping for quotes
- Fix quote escaping from \\\\\' to \\'
- Ensures proper backslash escaping in JavaScript template string
- Produces correct \' in the final DOCTYPE string
Co-authored-by: DeJeune <67425183+DeJeune@users.noreply.github.com>
* fix(i18n): Auto update translations for PR #11104
* ✨ enhance: Use page title for default filename and improve PDF pagination
- Get page title from webview and use it as default filename for both PDF and HTML export
- Sanitize filename by removing invalid characters and limiting length
- Add preferCSSPageSize option to printToPDF for better multi-page support
- Fallback to timestamp-based filename if title is unavailable
Addresses reviewer feedback and fixes PDF export only capturing first page issue.
Co-authored-by: DeJeune <67425183+DeJeune@users.noreply.github.com>
* 🎨 style: Fix formatting issues
- Remove trailing whitespace in WebviewContainer.tsx
- Run biome format and lint to ensure code style compliance
Co-authored-by: DeJeune <67425183+DeJeune@users.noreply.github.com>
---------
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: DeJeune <67425183+DeJeune@users.noreply.github.com>
Co-authored-by: GitHub Action <action@github.com>
Co-authored-by: SuYao <sy20010504@gmail.com>
Fixes#11772
When user stops the reply after thinking is complete but text is still
streaming, all blocks in STREAMING status are now updated to PAUSED,
which properly stops the thinking timer.
Signed-off-by: Calvin <calvinvwei@gmail.com>
- Modified the typecheck script in package.json to run node and web type checks concurrently for improved efficiency.
- Added 'concurrently' as a new dependency in package.json and updated yarn.lock accordingly.
* refactor(ui): improve settings tab and assistant item UI
- Remove SettingsTab from HomeTabs, open settings via navbar drawer instead
- Add menu icon to assistant/agent items for quick access to settings popup
- Remove SessionSettingsTab component (consolidated into settings popup)
- Restore avatar display in bubble message style
- Update topic/session item styles for consistency
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* refactor(ui): simplify MessageHeader component logic
- Removed unnecessary header visibility check in MessageHeader.
- Updated justifyContent logic for UserWrap to account for multi-select mode.
This change enhances the clarity and maintainability of the MessageHeader component.
* refactor(ui): streamline ChatNavbar and SettingsTab components
- Removed unused chat state from ChatNavbar.
- Updated SettingsTab to conditionally render settings based on active topic or session.
- Enhanced clarity and maintainability by reducing unnecessary checks and improving component logic.
This change improves the overall user experience and code readability.
* refactor(ui): enhance AgentItem and ChatNavbar components for improved UI
- Updated AgentItem to conditionally hide the assistant icon based on settings.
- Enhanced ChatNavbar to display the assistant's emoji and name with a new layout.
- Introduced memoization for assistant name to optimize rendering.
These changes improve the user interface and maintainability of the components.
* refactor(ui): update HtmlArtifactsPopup to start in fullscreen mode
- Changed initial state of isFullscreen in HtmlArtifactsPopup from false to true.
This adjustment enhances the user experience by providing a more immersive view upon opening the popup.
* refactor(types): remove 'settings' tab from Tab type
- Updated the Tab type in chat.ts to remove the 'settings' option, simplifying the available tabs for the chat interface.
This change streamlines the chat functionality and improves code clarity.
* refactor(ui): enhance UserWrap styling in MessageHeader component
- Added flex property to UserWrap to improve layout flexibility.
This change enhances the responsiveness and layout management of the MessageHeader component.
* refactor(ui): update HtmlArtifactsPopup to prevent drag on ViewControls
- Added "nodrag" class to ViewControls to prevent drag events on double click.
This change improves the user interaction by ensuring that double-clicking on the ViewControls does not trigger drag actions.
* refactor(ui): adjust spacing in AgentLabel component
- Updated the gap between items in the AgentLabel component from 1 to 2 for improved layout consistency.
This change enhances the visual spacing and overall user interface of the AgentSettings page.
* refactor(ui): remove unused useSessions hook from AgentItem component
- Eliminated the useSessions hook from the AgentItem component to streamline the code and improve performance.
This change enhances the maintainability of the AgentItem component by removing unnecessary dependencies.
* refactor(ui): optimize MessageHeader component layout and logic
- Introduced a memoized userNameJustifyContent calculation to streamline the justifyContent logic for UserWrap.
- Simplified the HStack component by replacing inline logic with the new memoized value.
These changes enhance the maintainability and clarity of the MessageHeader component.
---------
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
- Changed the Gemini base URL in providerToAiSdkConfig to point to '/v1beta/models' for CherryIN provider.
- Added a default thinking budget of -1 in getGeminiReasoningParams to enhance reasoning configuration.
* feat: enhance web search tool switching logic to support provider-specific context
* Update packages/aiCore/src/core/plugins/built-in/webSearchPlugin/helper.ts
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Update packages/aiCore/src/core/plugins/built-in/webSearchPlugin/index.ts
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* refactor: consolidate control flow in switchWebSearchTool (#11771)
* Initial plan
* refactor: make control flow consistent in switchWebSearchTool
Replace early returns with break statements in all switch cases to ensure
consistent control flow. Move fallback logic into default case for clarity.
Co-authored-by: DeJeune <67425183+DeJeune@users.noreply.github.com>
---------
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: DeJeune <67425183+DeJeune@users.noreply.github.com>
* Update packages/aiCore/src/core/plugins/built-in/webSearchPlugin/index.ts
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Update packages/aiCore/src/core/plugins/built-in/webSearchPlugin/index.ts
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* chore: format
* fix: ensure switchWebSearchTool is always called for cherryin providers
- Add missing else branch to prevent silent failure when provider extraction fails
- Add empty string check for extracted providerId from split operation
- Ensures web search functionality is preserved in all edge cases
Addresses PR review feedback from #11769🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
* refactor: simplify repetitive switchWebSearchTool calls
- Extract providerId determination logic before calling switchWebSearchTool
- Call switchWebSearchTool only once at the end with updated providerId
- Reduce code duplication while maintaining all edge case handling
Addresses review feedback from @kangfenmao
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
* refactor: eliminate code duplication in switchWebSearchTool
- Extract helper functions: ensureToolsObject, applyToolBasedSearch, applyProviderOptionsSearch
- Replace switch statement and fallback if-else chain with providerHandlers map
- Use array-based priority order for fallback logic
- Reduce code from 73 lines to 80 lines but with much better maintainability
- Eliminates 12 instances of "if (!params.tools) params.tools = {}"
- Single source of truth for each provider's configuration logic
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
---------
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
* feat(SelectionAssistant): open URL for search action
When selected text is a valid URI or file path, directly open it
instead of searching. This enhances the search action to be smarter
about handling URLs and file paths.
Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
* fix: format
* feat: increase maximum custom and enabled items in settings actions list
Updated the maximum number of custom items from 8 to 10 and enabled items from 6 to 8 in the settings actions list to enhance user customization options.
---------
Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
* chore: add gitcode release sync workflow
* fix(ci): address review feedback for gitcode sync workflow
- Use Authorization header instead of token in URL query parameter
- Add file existence check before copying signed Windows artifacts
- Remove inappropriate `|| true` from artifact listing
- Use heredoc for safe GITHUB_OUTPUT writing
- Add error context logging in upload_file function
- Add curl timeout for API requests (connect: 30s, max: 60s)
- Add cleanup step for temp files with `if: always()`
- Add env var validation for GitCode credentials
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Fixes logic issues in knowledge base search:
1. Inverted search priority in KnowledgeService to use specific sub-queries over generic rewrites.
2. Updated SEARCH_SUMMARY_PROMPT_KNOWLEDGE_ONLY to explicitly allow decomposed questions, improving intent recognition for complex queries.
feat(provider): add CherryIN settings and migration support
- Introduced CherryINSettings component for configuring CherryIN API hosts.
- Updated ProviderSetting to conditionally render CherryINSettings based on provider ID and user language.
- Enhanced providerToAiSdkConfig to include CherryIN API host URLs.
- Incremented store version to 183 and added migration logic to set default CherryIN API hosts.
* fix(aiCore): omit empty content in assistant messages with tool_calls
When an assistant message contains tool_calls but no text content,
the content field was being set to undefined or empty string.
This caused API errors on strict OpenAI-compatible endpoints like CherryIn:
"messages: text content blocks must be non-empty"
The fix conditionally includes the content field only when there is
actual text content, which conforms to the OpenAI API specification.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* fix(aiCore): omit empty assistant message in new aiCore StreamEventManager
When building recursive params after tool execution, only add the assistant
message when textBuffer has content. This avoids sending empty/invalid
assistant messages to strict OpenAI-compatible APIs like CherryIn, which
causes "text content blocks must be non-empty" errors.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* revert: remove legacy OpenAIApiClient fix (legacy is deprecated)
The legacy aiCore code is no longer used. Only the fix in the new aiCore
architecture (StreamEventManager.ts) is needed.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
* feat(utils): add isWithTrailingSharp URL helper function
Add new utility function to check if URLs end with trailing '#' character
Includes comprehensive test cases covering various URL patterns and edge cases
* fix(api): check whether to auto append api version or not when formatting api host
- extract api version to variable in GeminiAPIClient for consistency
- simplify getBaseURL in OpenAIBaseClient by removing formatApiHost
- modify provider api host formatting to respect trailing #
- add tests for url parsing with trailing # characters
* fix: update provider config tests for new isWithTrailingSharp function
- Add isWithTrailingSharp to vi.mock in providerConfig tests
- Update test expectations to match new formatApiHost calling behavior
- All tests now pass with the new trailing # delimiter functionality
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
* fix(anthropic): prevent duplicate api version in base url
The Anthropic SDK automatically appends /v1 to endpoints, so we need to avoid duplication by removing the version from baseURL and explicitly setting the path in listModels
---------
Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
Add model's name as an additional fallback option when determining the id field in adaptSdkModel to handle cases where neither id nor modelId is available
Implement custom window resize functionality for the SelectionAction window
on Windows only. This is a workaround for an Electron bug where native
window resize doesn't work with frame: false + transparent: true.
- Add IPC channel and API for window resize
- Implement resize handler in SelectionService
- Add 8 resize handles (4 edges + 4 corners) in SelectionActionApp
- Only enable on Windows, other platforms use native resize
Bug reference: https://github.com/electron/electron/issues/42738
All workaround code is documented and can be removed once the bug is fixed.
Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
- Renamed job from 'propose-update' to 'update-config' for clarity.
- Replaced pull request creation step with direct commit and push to streamline the update process.
- Configured Git user for automated commits to improve workflow reliability.
- Added ability to ignore updates in the UpdateDialogPopup, updating the state accordingly.
- Updated UpdateAppButton to conditionally render based on the ignore state.
- Refactored runtime state to include an ignore flag for better update management.
- Minor UI adjustments in UpdateAppButton for improved user experience.
- Reorder menu items to prioritize "Copy as Image" as the first action
- Rename "Copy" to "Copy Image Source" for better clarity
- Remove unused ImageIcon import
- Add i18n support for "preview.copy.src" across all locales
This change improves the user experience by making the most common
action (copy image) the first option in the context menu, while also
clarifying what each copy action does.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude <noreply@anthropic.com>
* refactor(model-params): split temperature and top_p support checks into separate functions
Replace deprecated isNotSupportTemperatureAndTopP with isSupportTemperatureModel and isSupportTopPModel
Add comprehensive tests for new model parameter support functions
* refactor(model-parameters): improve temperature and topP parameter handling
- Add fallback to DEFAULT_ASSISTANT_SETTINGS when enableTemperature/enableTopP is undefined
- Simplify conditional logic in parameter validation
- Update documentation to better explain parameter selection rules
* refactor(models): remove deprecated isNotSupportTemperatureAndTopP function
The function was marked as deprecated and its usage has been replaced by isSupportTemperatureModel and isSupportTopPModel. Also removed corresponding test cases.
* feat(models): add mutual exclusivity check for temperature and top_p
Add new utility function to enforce mutual exclusivity between temperature and top_p parameters for Claude 4.5 reasoning models. Update model parameter preparation logic to use this new check and add corresponding tests.
Resolved issue where Upload component UI was not synchronized with
editImageFiles state in NewApiPage. Switched to controlled fileList and
handled file removal via onRemove to ensure consistent UI updates.
- Update Claude models to 4.5 series
- Replace GPT-4.5 with GPT-5 series
- Upgrade Gemini models to 2.5/3.0 versions
- Consolidate DeepSeek and Qwen models
- Remove deprecated model versions
* refactor(settings): rename actions prop to contentAfter for clarity
The prop name 'actions' was misleading as it could imply functionality rather than layout. 'contentAfter' better describes its purpose of displaying content after the title.
* feat(agent): add tooltip for model selection in agent settings
Add tooltip to explain that only Anthropic endpoint models are supported for agents
* feat(i18n): add model tooltip and translate upload strings
Add tooltip message about Anthropic endpoint model requirement for Agent feature
Translate previously untranslated upload-related strings in multiple languages
* style: update gemini logo images and fix model logo condition
Update the Gemini logo images in both apps and models directories
Remove or fix the always-true isLight condition in getModelLogoById
* style: downsample gemini icon
* style(minapp): Add bordered property for gemini minapp
Add FIXME comment to indicate 'bodered' should be 'bordered' and update config to use correct property
* fix(windows): improve Git Bash detection for portable installations
Enhance Git Bash detection on Windows to support portable Git installations
and custom installation paths. The previous implementation only checked fixed
paths and failed to detect Git when installed to custom locations or added
to PATH manually.
Key improvements:
- Use where.exe to find git.exe in PATH and derive bash.exe location
- Support CHERRY_STUDIO_GIT_BASH_PATH environment variable override
- Add security check to skip executables in current directory
- Implement three-tier fallback strategy (env var -> git derivation -> common paths)
- Add detailed logging for troubleshooting
This fixes the issue where users with portable Git installations could run
git.exe from command line but the app failed to detect Git Bash.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* fix(windows): improve Git Bash detection for portable installations
Enhance Git Bash detection on Windows to support portable Git installations
and custom installation paths. The previous implementation only checked fixed
paths and failed to detect Git when installed to custom locations or added
to PATH manually.
Key improvements:
- Move findExecutable and findGitBash to utils/process.ts for better code organization
- Use where.exe to find git.exe in PATH and derive bash.exe location
- Add security check to skip executables in current directory
- Implement two-tier fallback strategy (git derivation -> common paths)
- Add detailed logging for troubleshooting
- Remove environment variable override to simplify implementation
This fixes the issue where users with portable Git installations could run
git.exe from command line but the app failed to detect Git Bash.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* fix(windows): improve Git Bash detection for portable installations
Enhance Git Bash detection on Windows to support portable Git installations
and custom installation paths. The previous implementation only checked fixed
paths and failed to detect Git when installed to custom locations or added
to PATH manually.
Key improvements:
- Move findExecutable and findGitBash to utils/process.ts for better code organization
- Use where.exe to find git.exe in PATH and derive bash.exe location
- Add security check to skip executables in current directory
- Implement two-tier fallback strategy (git derivation -> common paths)
- Add detailed logging for troubleshooting
- Remove environment variable override to simplify implementation
This fixes the issue where users with portable Git installations could run
git.exe from command line but the app failed to detect Git Bash.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* update iswin
* test: add comprehensive test coverage for findExecutable and findGitBash
Add 33 test cases covering:
- Git found in common paths (Program Files, Program Files (x86))
- Git found via where.exe in PATH
- Windows/Unix line ending handling (CRLF/LF)
- Whitespace trimming from where.exe output
- Security checks to skip executables in current directory
- Multiple Git installation structures (Standard, Portable, MSYS2)
- Bash.exe path derivation from git.exe location
- Common paths fallback when git.exe not found
- LOCALAPPDATA environment variable handling
- Priority order (derivation over common paths)
- Error scenarios (Git not installed, bash.exe missing)
- Real-world scenarios (official installer, portable, Scoop)
All tests pass with proper mocking of fs, path, and child_process modules.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* refactor: clarify path navigation comments in findGitBash
Replace confusing arrow notation showing intermediate directories with
clearer descriptions of the navigation intent:
- "navigate up 2 levels" instead of showing "-> Git/cmd -> Git ->"
- "bash.exe in same directory" for portable installations
- Emphasizes the intent rather than the intermediate steps
Makes the code more maintainable by clearly stating what each path
pattern is checking for.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* test: skip process utility tests on non-Windows platforms
Use describe.skipIf to skip all tests when not on Windows since
findExecutable and findGitBash have platform guards that return null
on non-Windows systems. Remove redundant platform mocking in nested
describe blocks since the entire suite is already Windows-only.
This fixes test failures on macOS and Linux where all 33 tests were
failing because the functions correctly return null on those platforms.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* format
* fix: improve Git Bash detection error handling and logging
- Add try-catch wrapper in IPC handler to handle unexpected errors
- Fix inaccurate comment: usr/bin/bash.exe is for MSYS2, not Git 2.x
- Change log level from INFO to DEBUG for internal "not found" message
- Keep WARN level only in IPC handler for user-facing message
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
---------
Co-authored-by: Claude <noreply@anthropic.com>
* fix(ProviderSettings): update assistant default model when model changes
Ensure assistant's default model is updated when the underlying model is modified to maintain consistency
* refactor(EditModelPopup): simplify assistant model update logic
Replace manual model updates with a single map operation to update both model and defaultModel fields. This makes the code more concise and easier to maintain.
* refactor(EditModelPopup): remove unused dispatch import and variable
* feat(EditModelPopup): add support for translate and quick model updates
Update the EditModelPopup component to handle updates for translate and quick models in addition to the default model. This ensures consistency across all model types when changes are made.
* Initial plan
* fix: improve file upload performance with batch processing and progress feedback
- Add batch processing (5 files concurrently) to uploadNotes function
- Use Promise.allSettled for parallel file processing
- Add setTimeout(0) between batches to yield to event loop
- Show loading toast when uploading more than 5 files
- Add translation keys for uploading progress (en, zh-cn, zh-tw)
Co-authored-by: DeJeune <67425183+DeJeune@users.noreply.github.com>
* feat: add batch upload and file watcher control functionalities
* feat: add hint node type and implement TreeNode component for notes
- Updated NotesTreeNode type to include 'hint' as a node type.
- Implemented TreeNode component to handle rendering of notes and folders, including hint nodes.
- Added drag-and-drop functionality for organizing notes.
- Created context hooks for managing notes actions, selection, editing, drag-and-drop, search, and UI state.
- Developed file upload handling for drag-and-drop and file selection.
- Enhanced menu options for notes with actions like create, rename, delete, and export.
- Integrated auto-renaming feature for notes based on content.
* clean comment
* feat: add pause and resume functionality to file watcher; enhance error handling in useInPlaceEdit hook
* fix: adjust padding in item container style for improved layout
---------
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: DeJeune <67425183+DeJeune@users.noreply.github.com>
Co-authored-by: suyao <sy20010504@gmail.com>
* refactor(types): rename OpenAISummaryText to OpenAIReasoningSummary for clarity
* refactor: move OpenAISettingsGroup to independent folder
* refactor(OpenAISettingsGroup): extract settings components into separate files
Move ReasoningSummarySetting, ServiceTierSetting and VerbositySetting into individual components to improve code organization and maintainability
* feat(stream-options): add stream options configuration for OpenAI completions
add includeUsage option to control token usage reporting in streamed responses
update provider config and settings UI to support new stream options
add migration for existing providers to set default stream options
extend toOptionValue utility to handle boolean values
* refactor(stream-options): move stream options includeUsage to settings store
- Remove streamOptions from Provider type and move includeUsage to settings.openAI
- Update migration to initialize streamOptions in settings
- Modify providerToAiSdkConfig to read includeUsage from settings
- Update StreamOptionsSetting component to use settings store
* feat(i18n): add missing translations for 'on' and stream options
Add translations for the 'on' state and stream options including token usage in multiple languages
* docs(select): update docs
* test(providerConfig): add tests for stream options includeUsage
add test cases to verify includeUsage stream option behavior for OpenAI provider
* Update src/renderer/src/i18n/translate/ru-ru.json
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Update src/renderer/src/pages/home/Tabs/components/OpenAISettingsGroup/VerbositySetting.tsx
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Update src/renderer/src/utils/select.ts
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* test(select): add tests for toOptionValue and toRealValue functions
* fix(providerConfig): handle undefined streamOptions in openAI settings
Prevent potential runtime errors by safely accessing nested streamOptions properties
* test(providerConfig): add tests for Copilot provider includeUsage settings
* fix(OpenAISettingsGroup): handle potential undefined streamOptions in selector
* docs(aiCoreTypes): add comment for OpenAICompletionsStreamOptions
* refactor(select): improve type safety in toOptionValue function
Use Exclude to prevent string literals from overlapping with special values
---------
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Initial plan
* fix: correct OVMS API URL path from '../v1/config' to 'config'
Co-authored-by: DeJeune <67425183+DeJeune@users.noreply.github.com>
* fix: update OVMSClient to use formatted API URL for model listing
---------
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: DeJeune <67425183+DeJeune@users.noreply.github.com>
Co-authored-by: suyao <sy20010504@gmail.com>
* refactor(FileStorage): extract file reading logic into reusable method
Move common file reading functionality from readFile and readExternalFile into a new private readFileCore method
Improve error logging by distinguishing between document and text file failures
Add comprehensive JSDoc documentation for all file reading methods
* feat(translate): support document files and increase size limit
Add support for document file types in translation file selection. Increase maximum file size limit to 20MB for documents while keeping text files at 5MB. Implement separate handling for document and text file reading.
* refactor(settings): move spell check languages to constants and add type
Add Slovak language option and define SpellCheckOption type for better type safety
* fix(settings): disable spell check selector on Mac platforms
The spell check selector should not be shown on Mac platforms as it's not supported. This change adds a platform check to hide the selector when running on macOS.
* fix(prompts): clarify language detection rules for edge cases
Update LANG_DETECT_PROMPT to explicitly handle cases where the input text describes a language but is written in a different language. Add examples to illustrate the expected behavior.
* fix(prompts): correct language code mapping for Chinese input
Update the language detection prompt to properly map '英语' to 'zh-cn' instead of 'en-us' since it's a Chinese word
* Initial plan
* Fix custom parameters placement for Vercel AI Gateway
For AI Gateway provider, custom parameters are now placed at the body level
instead of being nested inside providerOptions.gateway. This fixes the issue
where parameters like 'tools' were being incorrectly added to
providerOptions.gateway when they should be at the same level as providerOptions.
Fixes#4197
Co-authored-by: DeJeune <67425183+DeJeune@users.noreply.github.com>
* Revert "Fix custom parameters placement for Vercel AI Gateway"
This reverts commit b14e48dd78.
* fix: rename 'ai-gateway' to 'gateway' across the codebase and update related configurations
* fix: resolve PR review issues for custom parameters field
- Fix Migration 174: use string literal 'ai-gateway' instead of non-existent constant for historical compatibility
- Fix Migration 180: update model.provider references to prevent orphaned models when renaming provider ID
- Add logging in mapVertexAIGatewayModelToProviderId when unknown model type is encountered
- Replace `any` with `Record<string, unknown>` in buildAIGatewayOptions return type for better type safety
- Add gateway mapping to getAiSdkProviderId mock in options.test.ts to match production behavior
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* chore: version
* fix(options): enhance custom parameters handling for proxy providers
* fix(options): add support for cherryin provider with custom parameters handling
* chore
---------
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: DeJeune <67425183+DeJeune@users.noreply.github.com>
Co-authored-by: suyao <sy20010504@gmail.com>
Co-authored-by: Claude <noreply@anthropic.com>
* fix: update deepseek dependency to version 1.0.31 and improve provider creation logging
* chore
* feat: deepseek official hybrid infer
* fix: deepseek-v3.2-speciale tooluse and reasoning
* fix: 添加固定推理模型支持并更新相关逻辑
* refactor: simplify logic
* feat: aihubmix
* all system_providers
* feat: cherryin
* temp fix
* fix: address PR review feedback for DeepSeek v3.2 implementation
- Add default case in buildCherryInProviderOptions to fallback to genericProviderOptions
- Add clarifying comment for switch fall-through in reasoning.ts
- Add comprehensive test coverage for isFixedReasoningModel (negative cases)
- Add test coverage for new provider whitelist (deepseek, cherryin, new-api, aihubmix, sophnet, dmxapi)
- Add test coverage for isDeepSeekHybridInferenceModel prefix patterns
- Verify function calling logic works correctly via regex matching after removing provider-based checks
- Use includes() for deepseek-chat matching to support potential variants
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* fix: remove unnecessary fall-through case for unknown providers in getReasoningEffort
---------
Co-authored-by: Claude <noreply@anthropic.com>
* fix(a11y): improve screen reader support with aria-label attributes
Add aria-label attributes to all interactive buttons and toolbar elements
to improve accessibility for screen reader users (NVDA, etc.).
Changes:
- Add aria-label with i18n translations to all ActionIconButton components
- Add role="button", tabIndex, and keyboard handlers for non-semantic elements
- Fix hardcoded English aria-labels in WindowControls to use i18n
- Add aria-pressed for toggle buttons to indicate state
- Add aria-expanded for expandable menus
- Add aria-disabled for disabled buttons
Components updated:
- SendMessageButton, CopyButton, SelectionToolbar
- CodeToolbar, RichEditor toolbar, MinimalToolbar
- WindowControls
- 12 Inputbar tool buttons (WebSearch, Attachment, KnowledgeBase, etc.)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* fix(a11y): enhance accessibility in CodeToolbar snapshot
Added aria-label, role, and tabindex attributes to improve screen reader support for interactive elements in the CodeToolbar component. This change aligns with ongoing efforts to enhance accessibility across the application.
---------
Co-authored-by: Claude <noreply@anthropic.com>
* fix(inputbar): block enter send while generating
- reuse unified send disable state for keyboard and button
- prevent enter sending when loading or searching
* refactor: optimize InputbarCore component's useHotkeys hook
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* refactor(InputbarCore): rename cannotSend to noContent for clarity
---------
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* fix(apiServer): use 127.0.0.1 instead of localhost for better compatibility
- Change default host from localhost to 127.0.0.1 in config and settings
- Add buildApiServerUrl helper to properly construct API server URLs
- Update OpenAPI documentation server URL
- Update test files to use 127.0.0.1
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* fix(migration): migrate existing localhost config to 127.0.0.1
- Add migration 180 to automatically update localhost to 127.0.0.1
- Handle both plain host and hosts with http/https protocol
- Increment store version to 180
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* refactor(apiServer): simplify buildApiServerUrl implementation
- Remove complex URL parsing and protocol handling
- Use simple string concatenation for URL building
- Assume http protocol since API server is local
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* refactor: remove buildApiServerUrl helper and simplify migration
- Remove buildApiServerUrl helper function
- Use 127.0.0.1 directly in URL construction
- Simplify migration 180 to unconditionally set host to 127.0.0.1
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* refactor(apiServer): fix critical bugs and improve code structure
🔴 Critical Fixes:
- Fix config.ts to use stored host value instead of ignoring it
- Fix hardcoded 127.0.0.1 URLs to use apiServerConfig.host
🟡 Improvements:
- Extract API_SERVER_DEFAULTS to shared constants in packages/shared/config/constant.ts
- Apply consistent fallback pattern using API_SERVER_DEFAULTS.HOST and API_SERVER_DEFAULTS.PORT
- Update all imports to use shared constants across main and renderer processes
Files changed:
- packages/shared/config/constant.ts: Add API_SERVER_DEFAULTS constants
- src/main/apiServer/config.ts: Use stored host with fallback
- src/main/apiServer/middleware/openapi.ts: Use constants
- src/renderer/src/pages/settings/ToolSettings/ApiServerSettings/ApiServerSettings.tsx: Use config host and constants
- src/renderer/src/store/settings.ts: Use constants in initial state
- src/renderer/src/store/migrate.ts: Use constants in migration
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* update
* fix(apiServer): use relative URL in OpenAPI spec for better compatibility
- Change server URL from hardcoded defaults to relative path '/'
- This ensures Swagger UI "Try it out" works correctly regardless of configured host/port
- Remove unused API_SERVER_DEFAULTS import
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
---------
Co-authored-by: Claude <noreply@anthropic.com>
refactor(feishu-notify): simplify issue card layout by removing redundant elements
Remove unnecessary div elements and consolidate title display into the card header
* fix: update Inputbar components to support dynamic textarea height adjustment
* fix: align drag handler maxHeight with hook configuration (500px)
- Update hardcoded maxHeight from 400 to 500 in InputbarCore drag handler
- This ensures consistency with useTextareaResize hook maxHeight parameter
- Resolves PR comment about maxHeight inconsistency between hook and drag handler
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
---------
Co-authored-by: Claude <noreply@anthropic.com>
* fix(settings): fix wrong type caused by as assertion and migration
Add migration step 180 to properly handle 'undefined' string values in OpenAI settings
Update selector components to use value conversion helpers for summaryText and verbosity
* feat(models): add null as supported verbosity level for OpenAI models
Update model utils and types to include null as a valid verbosity level option alongside undefined. This provides more flexibility in controlling verbosity behavior, with null representing an explicit "off" state. Tests and UI components are updated to reflect this change.
* fix(verbosity): fix wrong verbosity type definition and handling in #11281
* style: format
* fix(store): correct verbosity check in migration config
The condition was incorrectly checking for 'undefined' string instead of undefined value, and was assigning to summaryText instead of verbosity. This fixes the migration logic to properly handle the verbosity setting.
* docs(aiCore): improve comments for verbosity and summary types
Update type comments to better explain the behavior of verbosity and summary parameters in OpenAI API requests
* fix: topic name remains after deleting last topic
- Fix logic error when deleting the last topic
- Only clear messages in the last topic before the commit
- Now creates new topic before deleting the original one to ensure proper topic name update
Signed-off-by: Do1e <i@do1e.cn>
* fix(topic): integrate the same code in `handleConfirmDelete`
Signed-off-by: Do1e <i@do1e.cn>
---------
Signed-off-by: Do1e <i@do1e.cn>
* fix: improve code block copy in collapsed state with virtual scroll
- Add saveSelection mechanism to track selection across virtual scroll updates
- Implement custom copy handler to extract complete content from raw data
- Auto-expand code block when multi-line selection is detected in collapsed state
- Only enable auto-expand when codeCollapsible setting is enabled
- Add comprehensive logging for debugging selection and copy issues
Fixes issue where copying code in collapsed state would lose content from
virtualized rows that are not rendered in DOM. The solution captures
selection position (line + offset) during scroll and uses it to extract
complete content from the original source when copying.
* fix(CodeViewer): scope selection and copy to viewer container to prevent multiple blocks appearing selected\n\n- Add selectionBelongsToViewer() to ensure selection anchors are within this viewer\n- Guard saveSelection, copy handler, and selectionchange auto-expand logic\n- Avoids cross-viewer selection bleed when multiple CodeViewer instances exist on a page\n\nFollow-up to 37c2b5ecb (virtual scroll selection/copy).
* fix(CodeViewer): clear saved selection when active selection belongs to another viewer\n\n- Early-return in selectionchange handler when selection is outside this viewer\n- Complements scoping guards to avoid misleading multi-selection states
* fix(CodeViewer): change logger info to debug for selection and copy events
- Adjust logging level from info to debug for various selection and copy operations to reduce log verbosity.
- Ensure selection belongs to the current viewer before processing.
* fix(CodeViewer): remove invisible character from import statement
* fix(CodeViewer): complete useCallback deps to avoid stale closure
- saveSelection deps -> [selectionBelongsToViewer]
- handleCopy deps -> [selectionBelongsToViewer, expanded, saveSelection, rawLines]
- no behavior change; satisfy exhaustive-deps; reduce risk of stale refs
* fix(CodeViewer): improve selection handling for virtual scrolling and enhance comments
* fix(CodeViewer): handle clipboardData unavailability and remove unused ref
- Add null check for event.clipboardData to prevent silent copy failure
- When clipboardData is unavailable, fall back to browser default copy behavior
- Remove unused isRestoringSelectionRef and its dead code check
- Improve copy reliability in edge cases where clipboard API may be unavailable
* fix: update @modelcontextprotocol/sdk to v1.23.0 and enhance MCP tool schemas
* fix: add dotenv type definitions and implement parseKeyValueString utility with tests
* docs(providerConfig): improve jsdoc for formatProviderApiHost function
* refactor(aiCore): improve provider handling with adaptProvider function
Introduce adaptProvider to centralize provider transformations and replace direct usage of handleSpecialProviders and formatProviderApiHost. This improves maintainability and provides consistent behavior across all provider usage scenarios.
* refactor(ProviderSettings): simplify api host formatting logic by using adaptProvider
Replace multiple format functions with a single adaptProvider utility to centralize host formatting logic and improve maintainability
* feat(api): add withoutTrailingSharp utility and update formatApiHost
add utility function to remove trailing # from URLs and update formatApiHost to use it
add comprehensive tests for new functionality
* feat(ProviderSetting): add help tooltip for api url selector
Add HelpTooltip component next to host selector to provide additional guidance about API URL configuration
docs: update CLAUDE.md with PR workflow details
Add critical section about Pull Request workflow requirements including reading the template, following all sections, never skipping, and proper formatting
* fix(ApiService): handle stream errors properly in checkApi
Ensure stream errors are properly caught and thrown when checking API availability
* docs(types): add type safety comment for ResponseError
Add FIXME comment highlighting weak type safety in ResponseError type
* Initial plan
* fix: set CLAUDE_CONFIG_DIR to avoid path encoding issues on Windows with non-ASCII usernames
Co-authored-by: DeJeune <67425183+DeJeune@users.noreply.github.com>
---------
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: DeJeune <67425183+DeJeune@users.noreply.github.com>
* feat(dom): extend scrollIntoView with Chromium-specific options
Add ChromiumScrollIntoViewOptions interface to support additional scroll container options
* refactor(hooks): optimize timer and scroll position hooks
- Use useMemo for scrollKey in useScrollPosition to avoid unnecessary recalculations
- Refactor useTimer to use useCallback for all functions to prevent unnecessary recreations
- Reorganize function order and improve cleanup logic in useTimer
* fix: stabilize home scroll behavior
* Update src/renderer/src/pages/home/Messages/ChatNavigation.tsx
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* fix(utils/dom): add null check for element in scrollIntoView
Prevent potential runtime errors by gracefully handling falsy elements with a warning log
* fix(hooks): use ref for scroll key to avoid stale closure
* fix(useScrollPosition): add cleanup for scroll handler to prevent memory leaks
---------
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* fix(i18n): remove image-generation translations and clarify endpoint type
Update English locale to specify OpenAI for image generation
Add comments to clarify image-generation endpoint type relationship
* fix(i18n): correct portuguese translations in pt-pt.json
fix(reasoning): handle reasoning effort none case properly
separate undefined and none reasoning effort cases
clean up redundant model checks and add fallback logging
Fix the issue where doubao provider could not infer models using the name field.
Refactored `isDeepSeekHybridInferenceModel` to use `withModelIdAndNameAsId`
utility function to check both model.id and model.name, avoiding duplicate
calls in `isReasoningModel`.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude <noreply@anthropic.com>
- Convert all image formats to PNG before writing to clipboard to ensure compatibility
- Refactor handleCopyImage to unify image source handling (Base64, File, URL)
- Add convertImageToPng utility function using canvas API for robust conversion
- Remove fallback logic that attempted to write unsupported JPEG format
* refactor(api): extract version regex into constant for reuse
Move the version matching regex pattern into a module-level constant to improve code reuse and maintainability. The functionality remains unchanged.
* refactor(api): rename regex constant and use dynamic regex construction
Use a string pattern for version regex to allow dynamic construction and improve maintainability. Rename constant to better reflect its purpose.
* feat(api): add getLastApiVersion utility function
Implement a utility function to extract the last API version segment from URLs. This is useful for handling cases where multiple version segments exist in the path and we need to determine the most specific version being used.
Add comprehensive test cases covering various URL patterns and edge cases.
* feat(api): add utility to remove trailing API version from URLs
Add withoutTrailingApiVersion function to clean up URLs by removing version segments
at the end of paths. This helps standardize API endpoint URLs when version is not needed.
* refactor(api): rename isSupportedAPIVerion to supportApiVersion for clarity
* fix(gemini): handle api version dynamically for non-vertex providers
Use getLastApiVersion utility to determine the latest API version for non-vertex providers instead of hardcoding to v1beta
* feat(api): add function to extract trailing API version from URL
Add getTrailingApiVersion utility function to specifically extract API version segments
that appear at the end of URLs. This complements existing version-related utilities
and helps handle cases where we only care about the final version in the path.
* refactor(gemini): use getTrailingApiVersion instead of getLastApiVersion
The function name was changed to better reflect its purpose of extracting the trailing API version from the URL. The logic was also simplified and made more explicit.
* refactor(api): remove unused getLastApiVersion function
The function was removed as it was no longer needed, simplifying the API version handling to only use trailing version detection. The trailing version regex was extracted to a constant for reuse.
* feat(options): implement deep merging for provider options
Add deep merge functionality to preserve nested properties when combining provider options. The new implementation handles object merging recursively while maintaining type safety.
* refactor(tsconfig): reorganize include paths in tsconfig files
Clean up and reorder include paths for better maintainability and consistency between tsconfig.node.json and tsconfig.web.json
* test: add aiCore test configuration and script
Add new test configuration for aiCore package and corresponding test script in package.json to enable running tests specifically for the aiCore module.
* fix: format
* fix(aiCore): resolve test failures and update test infrastructure
- Add vitest setup file with global mocks for @cherrystudio/ai-sdk-provider
- Fix context assertions: use 'model' instead of 'modelId' in plugin tests
- Fix error handling tests: update expected error messages to match actual behavior
- Fix streamText tests: use 'maxOutputTokens' instead of 'maxTokens'
- Fix schemas test: update expected provider list to match actual implementation
- Fix mock-responses: use AI SDK v5 format (inputTokens/outputTokens)
- Update vi.mock to use importOriginal for preserving jsonSchema export
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* fix(aiCore): add alias mock for @cherrystudio/ai-sdk-provider in tests
The vi.mock in setup file doesn't work for source code imports.
Use vitest resolve.alias to mock the external package properly.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* fix(aiCore): disable unused-vars warnings in mock file
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* fix(aiCore): use import.meta.url for ESM compatibility in vitest config
__dirname is not available in ESM modules, use fileURLToPath instead.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* fix(aiCore): use absolute paths in vitest config for workspace compatibility
- Use path.resolve for setupFiles and all alias paths
- Extend aiCore vitest.config.ts from root workspace config
- Change aiCore test environment to 'node' instead of 'jsdom'
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* docs(factory): improve mergeProviderOptions documentation
Add detailed explanation of merge behavior with examples
* test(factory): add tests for mergeProviderOptions behavior
Add test cases to verify mergeProviderOptions correctly handles primitive values, arrays, and nested objects during merging
* refactor(tests): clean up mock responses test fixtures
Remove unused mock streaming chunks and error responses to simplify test fixtures
Update warning details structure in mock complete responses
* docs(test): clarify comment in generateImage test
Update comment to use consistent 'model id' terminology instead of 'modelId'
* test(factory): verify array replacement in mergeProviderOptions
---------
Co-authored-by: suyao <sy20010504@gmail.com>
Co-authored-by: Claude <noreply@anthropic.com>
* feat: enhance support for AWS Bedrock and Azure OpenAI providers
* fix: resolve PR review issues for AWS Bedrock support
- Fix header.ts logic bug: change && to || for Vertex/Bedrock provider check
- Fix regex in reasoning.ts to match AWS Bedrock model format (anthropic.claude-*)
- Add test coverage for AWS Bedrock format in isClaude4SeriesModel
- Add Bedrock provider tests including anthropicBeta parameter
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
---------
Co-authored-by: Claude <noreply@anthropic.com>
* fix(provider): update service tier support logic for OpenAI and Azure providers
* fix(settings): enhance OpenAI settings visibility logic with verbosity support
Previously, JSON-type custom parameters were incorrectly parsed and stored
as objects in the UI layer, causing API requests to fail when getCustomParameters()
attempted to JSON.parse() an already-parsed object.
Changes:
- AssistantModelSettings.tsx: Remove JSON.parse() in onChange handler, store as string
- reasoning.ts: Add comments explaining JSON parsing flow
- BaseApiClient.ts: Add comments for legacy API clients
* feat(test): e2e framework
Add Playwright-based e2e testing framework for Electron app with:
- Custom fixtures for electronApp and mainWindow
- Page Object Model (POM) pattern implementation
- 15 example test cases covering app launch, navigation, settings, and chat
- Comprehensive README for humans and AI assistants
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* refactor(tests): update imports and improve code readability
- Changed imports from 'import { Page, Locator }' to 'import type { Locator, Page }' for better type clarity across multiple page files.
- Reformatted waitFor calls in ChatPage and HomePage for improved readability.
- Updated index.ts to correct the export order of ChatPage and SidebarPage.
- Minor adjustments in electron.fixture.ts and electron-app.ts for consistency in import statements.
These changes enhance the maintainability and clarity of the test codebase.
* chore: update linting configuration to include tests directory
- Added 'tests/**' to the ignore patterns in .oxlintrc.json and eslint.config.mjs to ensure test files are not linted.
- Minor adjustment in electron.fixture.ts to improve the fixture definition.
These changes streamline the linting process and enhance code organization.
* fix(test): select main window by title to fix flaky e2e tests on Mac
On Mac, the app may create miniWindow for QuickAssistant alongside mainWindow.
Using firstWindow() could randomly select the wrong window, causing test failures.
Now we wait for the window with title "Cherry Studio" to ensure we get the main window.
Also removed unused electron-app.ts utility file.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
---------
Co-authored-by: Claude <noreply@anthropic.com>
* refactor(models): improve verbosity level handling for GPT-5 models
Replace hardcoded verbosity configuration with validator functions
Add support for GPT-5.1 series models
* test(models): restructure model utility tests into logical groups
Improve test organization by grouping related test cases under descriptive describe blocks for better maintainability and readability. Each model utility function now has its own dedicated test section with clear subcategories for different behaviors.
* fix: add null check for model in getModelSupportedVerbosity
Handle null model case defensively by returning default verbosity
* refactor(config): remove redundant as const from MODEL_SUPPORTED_VERBOSITY array
* refactor(models): simplify validator function in MODEL_SUPPORTED_VERBOSITY
* test(model utils): add tests for undefined/null input handling
* fix(models): handle undefined/null input in getModelSupportedVerbosity
Remove ts-expect-error comments and update type signature to explicitly handle undefined/null inputs. Also add support for GPT-5.1 series models.
* test(models): add test case for gpt-5-pro variant model
- Add `chcp 65001` to Windows batch file to switch CMD.exe to UTF-8 code page,
fixing CLI tool launch failure when working directory contains Chinese or
other non-ASCII characters
- Add directory existence validation before launching terminal to provide
immediate error feedback instead of delayed failure
Closes#11483🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude <noreply@anthropic.com>
When updating assistant preset settings, if agent.settings was undefined,
it was assigned the DEFAULT_ASSISTANT_SETTINGS object directly. Since this
object is defined with `as const`, it is readonly and subsequent property
assignments would fail with "Cannot assign to read only property".
Fixed by creating a shallow copy of DEFAULT_ASSISTANT_SETTINGS instead of
referencing it directly.
Closes#11490🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude <noreply@anthropic.com>
Move color and font-size styles from p selector to container level
in UpdateNotesWrapper. This ensures all content (including li elements
not wrapped in p tags) uses consistent color.
The issue occurred because .replace(/\n/g, '\n\n') creates a "loose list"
in Markdown where most list items get wrapped in <p> tags, but the last
item (without trailing newline) may not, causing it to inherit a different
color from the parent .markdown class.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude <noreply@anthropic.com>
- Updated version to 1.7.0-rc.3 in package.json
- Added new features including support for Silicon provider and AIHubMix
- Consolidated bug fixes related to providers, models, UI, and settings
- Improved SDK integration with upgraded dependencies
* Initial plan
* feat: Add proper Poe API reasoning parameters support for GPT-5 and other models
Co-authored-by: DeJeune <67425183+DeJeune@users.noreply.github.com>
* test: Add comprehensive tests for Poe API reasoning support
Co-authored-by: DeJeune <67425183+DeJeune@users.noreply.github.com>
* fix: Add missing isGPT5SeriesModel import in reasoning.ts
Co-authored-by: DeJeune <67425183+DeJeune@users.noreply.github.com>
* fix: Use correct extra_body format for Poe API reasoning parameters
Per Poe API documentation, custom bot parameters like reasoning_effort
and thinking_budget should be passed directly in extra_body, not as
nested structures.
Changed from:
- reasoning_effort: 'low' -> extra_body: { reasoning_effort: 'low' }
- thinking: { type: 'enabled', budget_tokens: X } -> extra_body: { thinking_budget: X }
- extra_body: { google: { thinking_config: {...} } } -> extra_body: { thinking_budget: X }
Updated tests to match the corrected implementation.
Co-authored-by: DeJeune <67425183+DeJeune@users.noreply.github.com>
* fix: Update reasoning parameters and improve type definitions for GPT-5 support
* fix lint
* docs
* fix(reasoning): handle edge cases for models without token limit configuration
---------
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: DeJeune <67425183+DeJeune@users.noreply.github.com>
Co-authored-by: suyao <sy20010504@gmail.com>
* fix(anthropic): prevent duplicate /v1 in API endpoints
Anthropic SDK automatically appends /v1 to endpoints, so we should not add it in our formatting. This change ensures URLs are correctly formatted without duplicate path segments.
* fix(anthropic): strip /v1 suffix in getSdkClient to prevent duplicate in models endpoint
The issue was:
- AI SDK (for chat) needs baseURL with /v1 suffix
- Anthropic SDK (for listModels) automatically appends /v1 to all endpoints
Solution:
- Keep /v1 in formatProviderApiHost for AI SDK compatibility
- Strip /v1 in getSdkClient before passing to Anthropic SDK
- This ensures chat works correctly while preventing /v1/v1/models duplication
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* fix(anthropic): correct preview URL to match actual request behavior
The preview now correctly shows:
- Input: https://api.siliconflow.cn/v2
- Preview: https://api.siliconflow.cn/v2/messages (was incorrectly showing /v2/v1/messages)
- Actual: https://api.siliconflow.cn/v2/messages
This matches the actual behavior where getSdkClient strips /v1 suffix before
passing to Anthropic SDK, which then appends /v1/messages.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* fix(anthropic): strip all API version suffixes, not just /v1
The Anthropic SDK always appends /v1 to endpoints, regardless of the baseURL.
Previously we only stripped /v1 suffix, causing issues with custom versions like /v2.
Now we strip all version suffixes (/v1, /v2, /v1beta, etc.) before passing to Anthropic SDK.
Examples:
- Input: https://api.siliconflow.cn/v2/
- After strip: https://api.siliconflow.cn
- Actual request: https://api.siliconflow.cn/v1/messages✅🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* fix(anthropic): correct preview to show AI SDK behavior, not Anthropic SDK
The preview was showing the wrong URL because it was reflecting Anthropic SDK behavior
(which strips versions and uses /v1), but checkApi and chat use AI SDK which preserves
the user's version path.
Now preview correctly shows:
- Input: https://api.siliconflow.cn/v2/
- AI SDK (checkApi/chat): https://api.siliconflow.cn/v2/messages✅
- Preview: https://api.siliconflow.cn/v2/messages✅
Note: Anthropic SDK (for listModels) still strips versions to use /v1/models,
but this is not shown in preview since it's a different code path.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* refactor(checkApi): remove unnecessary legacy fallback
The legacy fallback logic in checkApi was:
1. Complex and hard to maintain
2. Never actually triggered in practice for Modern SDK supported providers
3. Could cause duplicate API requests
Since Modern AI SDK now handles all major providers correctly,
we can simplify by directly throwing errors instead of falling back.
This also removes unused imports: AiProvider and CompletionsParams.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* fix(anthropic): restore version stripping in getSdkClient for Anthropic SDK
The Anthropic SDK (used for listModels) always appends /v1 to endpoints,
so we need to strip version suffixes from baseURL to avoid duplication.
This only affects Anthropic SDK operations (like listModels).
AI SDK operations (chat/checkApi) use provider.apiHost directly via
providerToAiSdkConfig, which preserves the user's version path.
Examples:
- AI SDK (chat): https://api.siliconflow.cn/v1 -> /v1/messages ✅
- Anthropic SDK (models): https://api.siliconflow.cn/v1 -> strip v1 -> /v1/models ✅🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* fix(anthropic): ensure AI SDK gets /v1 in baseURL, strip for Anthropic SDK
The correct behavior is:
1. formatProviderApiHost: Add /v1 to apiHost (for AI SDK compatibility)
2. AI SDK (chat/checkApi): Use apiHost with /v1 -> /v1/messages ✅
3. Anthropic SDK (listModels): Strip /v1 from baseURL -> SDK adds /v1/models ✅
4. Preview: Show AI SDK behavior (main use case) -> /v1/messages ✅
Examples:
- Input: https://api.siliconflow.cn
- Formatted: https://api.siliconflow.cn/v1 (added by formatApiHost)
- AI SDK: https://api.siliconflow.cn/v1/messages✅
- Anthropic SDK: https://api.siliconflow.cn (stripped) + /v1/models ✅
- Preview: https://api.siliconflow.cn/v1/messages✅🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* refactor(ai): simplify AiProviderNew initialization and improve docs
Update AiProviderNew constructor to automatically format URLs by default
Add comprehensive documentation explaining constructor behavior and usage
* chore: remove unused play.ts file
* fix(anthropic): strip api version from baseURL to avoid endpoint duplication
---------
Co-authored-by: Claude <noreply@anthropic.com>
* feat: add silicon provider support for Anthropic API compatibility
* fix: update handling of ANTHROPIC_BASE_URL for silicon provider compatibility
* fix: update anthropicApiHost for silicon provider to use the correct endpoint
* fix: remove silicon from CLAUDE_OFFICIAL_SUPPORTED_PROVIDERS
* chore: add comment to clarify silicon model fallback logic in CLAUDE_OFFICIAL_SUPPORTED_PROVIDERS
- Bumped @types/react from ^19.0.12 to ^19.2.7
- Bumped @types/react-dom from ^19.0.4 to ^19.2.3
- Updated csstype dependency from ^3.0.2 to ^3.2.2 in yarn.lock
These updates ensure compatibility with the latest React types and improve type definitions.
* fix: add claude-opus-4-5 pattern to THINKING_TOKEN_MAP
Adds missing regex pattern for claude-opus-4-5 models (e.g., claude-opus-4-5-20251101)
to the THINKING_TOKEN_MAP configuration. Without this pattern, the model was not
recognized, causing findTokenLimit() to return undefined and leading to an
AI_InvalidArgumentError when using Google Vertex AI Anthropic provider.
The fix adds the pattern 'claude-opus-4-5.*$': { min: 1024, max: 64_000 } to
match the existing claude-4 thinking token configuration.
Fixes AI_InvalidArgumentError: invalid anthropic provider options caused by
budgetTokens receiving NaN instead of a number.
Signed-off-by: Shuchen Luo (personal linux) <nemo0806@gmail.com>
* refactor: make THINKING_TOKEN_MAP constant private
* fix(reasoning): update claude model token limit regex patterns
- Consolidate claude model regex patterns to be more consistent
- Add comprehensive test cases for various claude model variants
- Ensure case insensitivity and proper handling of edge cases
* fix: format
* feat(models): extend claude model regex patterns to support AWS and GCP formats
Update regex patterns in THINKING_TOKEN_MAP to support additional Claude model ID formats used in AWS Bedrock and GCP Vertex AI
Add comprehensive test cases for new model ID formats and reorganize test suite
* fix: format
---------
Signed-off-by: Shuchen Luo (personal linux) <nemo0806@gmail.com>
Co-authored-by: icarus <eurfelux@gmail.com>
- Updated links in CONTRIBUTING.md and README.md to point to the correct Chinese documentation paths.
- Removed outdated files including the English and Chinese versions of the branching strategy, contributing guide, and test plan documents.
- Cleaned up references to non-existent documentation in the project structure to streamline the contributor experience.
* Initial plan
* fix(aiCore): extract AI SDK standard params from custom params for Gemini
Custom parameters like topK, frequencyPenalty, presencePenalty,
stopSequences, and seed should be passed as top-level streamText()
parameters, not in providerOptions. This fixes the issue where these
parameters were being ignored by the AI SDK's @ai-sdk/google module.
Changes:
- Add extractAiSdkStandardParams function to separate standard params
- Update buildProviderOptions to return both providerOptions and standardParams
- Update buildStreamTextParams to spread standardParams into params object
- Update tests to reflect new return structure
Co-authored-by: DeJeune <67425183+DeJeune@users.noreply.github.com>
* refactor(aiCore): remove extractAiSdkStandardParams function and its tests, streamline parameter extraction logic
* chore: type
---------
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: DeJeune <67425183+DeJeune@users.noreply.github.com>
Co-authored-by: suyao <sy20010504@gmail.com>
* fix: update provider-utils and add patch for header merging logic
* fix: enhance header merging logic to deduplicate values
* fix: handle null values in header merging logic
* chore: update ai-sdk dependencies and remove obsolete patches
- Updated @ai-sdk/amazon-bedrock from 3.0.56 to 3.0.61
- Updated @ai-sdk/anthropic from 2.0.45 to 2.0.49
- Updated @ai-sdk/gateway from 2.0.13 to 2.0.15
- Updated @ai-sdk/google from 2.0.40 to 2.0.43
- Updated @ai-sdk/google-vertex from 3.0.72 to 3.0.79
- Updated @ai-sdk/openai from 2.0.71 to 2.0.72
- Updated @ai-sdk/provider-utils from patch version to 3.0.17
- Removed obsolete patches for @ai-sdk/openai and @ai-sdk/provider-utils
- Added reasoning_content field to OpenAIChat response and chunk schemas
- Enhanced OpenAIChatLanguageModel to handle reasoning content in responses
* chore
* feat(settings): show OpenAI settings for supported service tier providers
Add support for displaying OpenAI settings when provider supports service tiers.
This includes refactoring the condition check and fixing variable naming consistency.
* fix(settings): set openAI verbosity to undefined by default
* fix(store): bump version to 178 and disable verbosity for groq provider
Add migration to remove verbosity from groq provider and implement provider utility to check verbosity support
Update provider types to include verbosity support flag
* feat(provider): add verbosity option support for providers
Add verbosity parameter support in provider API options settings
* fix(aiCore): check provider support for verbosity before applying
Add provider validation and check for verbosity support to prevent errors when unsupported providers are used with verbosity settings
* feat(settings): add Groq settings group component and translations
add new GroqSettingsGroup component for managing Groq provider settings
update translations for Groq settings in both zh-cn and en-us locales
refactor OpenAISettingsGroup to separate Groq-specific logic
* feat(i18n): add groq settings and verbosity support translations
add translations for groq settings title and verbosity parameter support in multiple languages
* refactor(settings): simplify service tier mode fallback logic
Remove conditional service tier mode fallback and use provider-specific defaults directly
* fix(provider): remove redundant system provider check in verbosity support
* test(provider): add tests for verbosity support detection
* fix(OpenAISettingsGroup): add endpoint_type check for showSummarySetting condition
Add model.endpoint_type check to properly determine when to show summary setting for OpenAI models
* refactor(selector): simplify selector option types and add utility functions
remove undefined and null from selector option types
add utility functions to convert between option values and real values
update groq and openai settings groups to use new utilities
add new translation for "ignore" option
* fix(ApiOptionsSettings): correct checked state for verbosity toggle
* feat(i18n): add "ignore" translation for multiple languages
* refactor(groq): remove unused model prop and related checks
Clean up GroqSettingsGroup component by removing unused model prop and unnecessary service tier checks
refactor(models): improve text delta support check for qwen-mt models
Replace direct qwen-mt model check with regex pattern matching
Add comprehensive test cases for isNotSupportTextDeltaModel
Update all references to use new function name
The previous implementation used `a = preset` inside forEach, which only
reassigns the local variable and doesn't actually update the array element.
Changed to use findIndex + direct array assignment to properly update
the preset in the state.
Fixes#11451🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude <noreply@anthropic.com>
* fix: respect enableMaxTokens setting when maxTokens is not configured
When enableMaxTokens is disabled, getMaxTokens() should return undefined
to let the API use its own default value, instead of forcing 4096 tokens.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* fix(modelParameters): handle max tokens when feature is disabled
Check if max tokens feature is enabled before returning undefined to ensure proper API behavior
---------
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: icarus <eurfelux@gmail.com>
index 8cc6aaf0b25bcdf3c579ec95cde12d419fcb2a71..3b3b8beaea5ad2bbac26a15f792058306d0b059f 100755
index dea7766a3432a1e809f12d6daba4f2834a219689..e0b02ef73da177ba32b903887d7bbbeaa08cc6d3 100755
--- a/sdk.mjs
+++ b/sdk.mjs
@@ -6213,7 +6213,7 @@ function createAbortController(maxListeners = DEFAULT_MAX_LISTENERS) {
@@ -6250,7 +6250,7 @@ function createAbortController(maxListeners = DEFAULT_MAX_LISTENERS) {
}
// ../src/transport/ProcessTransport.ts
@ -11,16 +11,20 @@ index 8cc6aaf0b25bcdf3c579ec95cde12d419fcb2a71..3b3b8beaea5ad2bbac26a15f79205830
import { createInterface } from "readline";
// ../src/utils/fsOperations.ts
@@ -6505,14 +6505,11 @@ class ProcessTransport {
@@ -6644,18 +6644,11 @@ class ProcessTransport {
const errorMessage = isNativeBinary(pathToClaudeCodeExecutable) ? `Claude Code native binary not found at ${pathToClaudeCodeExecutable}. Please ensure Claude Code is installed via native installer or specify a valid path with options.pathToClaudeCodeExecutable.` : `Claude Code executable not found at ${pathToClaudeCodeExecutable}. Is options.pathToClaudeCodeExecutable set?`;
@ -10,15 +10,25 @@ This file provides guidance to AI coding assistants when working with code in th
- **Log centrally**: Route all logging through `loggerService` with the right context—no `console.log`.
- **Research via subagent**: Lean on `subagent` for external docs, APIs, news, and references.
- **Always propose before executing**: Before making any changes, clearly explain your planned approach and wait for explicit user approval to ensure alignment and prevent unwanted modifications.
- **Lint, test, and format before completion**: Coding tasks are only complete after running `yarn lint`, `yarn test`, and `yarn format` successfully.
@ -32,7 +32,7 @@ To help you get familiar with the codebase, we recommend tackling issues tagged
### Testing
Features without tests are considered non-existent. To ensure code is truly effective, relevant processes should be covered by unit tests and functional tests. Therefore, when considering contributions, please also consider testability. All tests can be run locally without dependency on CI. Please refer to the "Testing" section in the [Developer Guide](docs/dev.md).
Features without tests are considered non-existent. To ensure code is truly effective, relevant processes should be covered by unit tests and functional tests. Therefore, when considering contributions, please also consider testability. All tests can be run locally without dependency on CI. Please refer to the "Testing" section in the [Developer Guide](docs/zh/guides/development.md).
### Automated Testing for Pull Requests
@ -60,7 +60,7 @@ Maintainers are here to help you implement your use case within a reasonable tim
### Participating in the Test Plan
The Test Plan aims to provide users with a more stable application experience and faster iteration speed. For details, please refer to the [Test Plan](docs/testplan-en.md).
The Test Plan aims to provide users with a more stable application experience and faster iteration speed. For details, please refer to the [Test Plan](docs/en/guides/test-plan.md).
Updates translations in language files under `src/renderer/src/i18n/translate` at the object level, preserving existing translations and only updating new content.
**Not recommended** — prefer `auto:i18n` for translation tasks.
```bash
yarn update:i18n
yarn i18n:translate
```
### Workflow
1. During development, first add the required text in `zh-cn.json`
2. Confirm it displays correctly in the Chinese environment
3. Run `yarn sync:i18n` to propagate the keys to other language files
4. Run `yarn auto:i18n` to perform machine translation
3. Run `yarn i18n:sync` to propagate the keys to other language files
4. Run `yarn i18n:translate` to perform machine translation
5. Grab a coffee and let the magic happen!
## Best Practices
1. **Use Chinese as Source Language**: All development starts in Chinese, then translates to other languages.
2. **Run Check Script Before Commit**: Use `yarn check:i18n` to catch i18n issues early.
2. **Run Check Script Before Commit**: Use `yarn i18n:check` to catch i18n issues early.
3. **Translate in Small Increments**: Avoid accumulating a large backlog of untranslated content.
4. **Keep Keys Semantically Clear**: Keys should clearly express their purpose, e.g., `user.profile.avatar.upload.error`
@ -19,7 +19,7 @@ Users are welcome to submit issues or provide feedback through other channels fo
### Participating in the Test Plan
Developers should submit `PRs` according to the [Contributor Guide](../CONTRIBUTING.md) (and ensure the target branch is `main`). The repository maintainers will evaluate whether the `PR` should be included in the Test Plan based on factors such as the impact of the feature on the application, its importance, and whether broader testing is needed.
Developers should submit `PRs` according to the [Contributor Guide](../../CONTRIBUTING.md) (and ensure the target branch is `main`). The repository maintainers will evaluate whether the `PR` should be included in the Test Plan based on factors such as the impact of the feature on the application, its importance, and whether broader testing is needed.
If the `PR` is added to the Test Plan, the repository maintainers will:
All special view components share a common architecture for consistent user experience and functionality. For detailed information about these components and their implementation, see [Image Preview Components Documentation](./ImagePreview-en.md).
All special view components share a common architecture for consistent user experience and functionality. For detailed information about these components and their implementation, see [Image Preview Components Documentation](./image-preview.md).
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.