* 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>
* 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
- Renamed `MultiPreferencesResultType` to `PreferenceMultipleResultType` for clarity and consistency.
- Updated `getMultipleRaw` method in `PreferenceService` to reflect the new type name.
- Adjusted related components and services to utilize the updated type, ensuring consistent usage across the application.
- Updated ApiServerService and ClaudeCodeService to use the new `getMultiple` method for fetching API server configuration from the preference service.
- Simplified the structure of the returned configuration object, enhancing readability and maintainability.
- Removed deprecated raw preference retrieval methods in favor of the new mapping approach.
- Renamed `Preference_GetMultiple` to `Preference_GetMultipleRaw` in IpcChannel for clarity.
- Introduced `MultiPreferencesResultType` to better map requested keys to their values or undefined in preferenceTypes.
- Updated `PreferenceService` to implement `getMultipleRaw` for synchronous access to multiple preferences.
- Adjusted related components and services to utilize the new method for fetching multiple preferences.
- Cleaned up imports and ensured consistent usage across the application.
- Removed the config module and replaced its usage with preferenceService across the API server implementation.
- Updated the auth middleware to retrieve the API key from preferenceService instead of the config.
- Adjusted the ApiServerService to ensure a valid API key is generated and stored in preferences.
- Refactored the useApiServer hook to utilize the new preference system for API server configuration.
- Updated related tests to mock preferenceService instead of config.
- Cleaned up unused imports and adjusted related components to align with the new configuration approach.
- Replace local imports of Input and Switch components with imports from the @cherrystudio/ui package for consistency.
- Minor adjustment to the Switch story to include a button type for the toggle state functionality.
* refactor(ui): migrate switch component from heroui to radix-ui
replace heroui switch implementation with radix-ui for better maintainability
update package.json and yarn.lock to include new dependency
* fix(eslint): enable heroui import restriction for deprecated Switch component
* refactor(ui): update Switch component props from isSelected/onValueChange to checked/onCheckedChange
Standardize Switch component props across the codebase to use checked/onCheckedChange instead of isSelected/onValueChange for better consistency with common React patterns. Also updates loading state prop from isLoading to loading and removes size prop where unnecessary.
The changes include:
- Replacing isSelected with checked
- Replacing onValueChange with onCheckedChange
- Updating isLoading to loading
- Removing redundant size props
- Adjusting styling to accommodate new loading state
* refactor(switch): improve switch component styling and structure
- Add default values for loading and disabled props
- Update styling classes and add group cursor pointer
- Restructure loading indicator and thumb positioning
- Wrap DescriptionSwitch children in flex container
* refactor(ui): improve switch component structure and usage
- Restructure DescriptionSwitch to use explicit props instead of children
- Add label, description, and position props for better customization
- Update all switch usages in SettingsTab to use new props format
* refactor(primitives): simplify switch props by omitting children
Remove redundant children prop from CustomSwitchProps since it's already omitted from the parent type
* fix(switch): add useId for label accessibility in DescriptionSwitch
Ensure proper label association with switch input by generating unique ID using React's useId hook
* refactor(settings): remove commented out SettingRowTitleSmall components
* refactor(SettingsTab): add todo comment for memoization optimization
* feat(switch): add size prop to customize switch dimensions
Add sm, md, and lg size options to the Switch component with corresponding styles. This allows for better visual consistency across different UI contexts.
* style(ui): adjust switch component styling and theme colors
update switch component layout and spacing to improve consistency
modify secondary-foreground color variable to use correct semantic token
* feat(switch): add new switch component styles and animations
- Add new switch.css file with gradient and transition styles
- Update switch.tsx component with new styling classes and animations
- Remove loader icon in favor of animated gradient effect
* fix(i18n): Auto update translations for PR #11061
* style(primitives): remove redundant border style from switch component
* refactor(switch): remove switch.css and update switch component styles
Remove deprecated switch.css file and migrate styles to inline tailwind classes. Update disabled state styling to use opacity instead of linear gradient for better consistency.
* refactor(switch): simplify switch thumb implementation
Replace complex div structure with svg for loading state
Adjust disabled opacity and loading state styling
* style(switch): adjust thumb size and positioning for better consistency
* feat(switch): add storybook documentation for switch component
Add comprehensive Storybook documentation for the Switch component, including:
- Basic usage examples
- Different states (checked, disabled, loading)
- Size variations
- DescriptionSwitch variant
- Real-world usage scenarios
- Accessibility examples
- Form integration examples
Also remove redundant box-content class from switch styles
* fix(switch): adjust thumb positioning for md and lg sizes
* style(primitives): improve switch component styling and spacing
- Add padding to the container
- Simplify label height logic
- Update typography classes for better consistency
- Adjust switch container alignment
* feat(switch): add size prop to DescriptionSwitch component
Add support for sm, md, and lg sizes to DescriptionSwitch component with responsive text sizing. Also includes comprehensive Storybook documentation with examples of all sizes and states.
* style(switch): align label text to right when isLeftSide is true
* refactor(stories): clean up DescriptionSwitch stories by removing unused imports and simplifying JSX
* refactor(ui): rename CustomizedSwitch to Switch for consistency
Simplify component naming by removing redundant 'Customized' prefix and aligning with common naming conventions
* refactor(switch): extract switch root styles into cva variants
Improve maintainability by using class-variance-authority to manage switch root styles and variants
* refactor(switch): extract thumb variants into separate cva function
Improve maintainability by moving switch thumb styling logic into a dedicated variants configuration. This makes the component more readable and easier to modify.
* feat(switch): add classNames prop for custom styling
Allow custom class names to be applied to switch root, thumb, and thumbSvg elements for more flexible styling options.
* feat(switch): add loading animation variants for switch thumb
Extract loading animation logic into separate cva variants for better maintainability and reusability
---------
Co-authored-by: GitHub Action <action@github.com>
* 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
Updated the Inputbar and AgentSessionInputbar components to use the new cacheService for managing draft persistence and mentioned models, ensuring consistency across the application.
* 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.
- Add data-classify tools for data inventory extraction and code generation
- Include consolidated Chinese documentation (README.md)
- Update generated file path references
This temporary directory will be removed after V2 refactor is complete.
- Replace direct Redux state access for memory preferences with preferenceService calls in multiple components.
- Introduce new preference mappings for memory settings, including 'feature.memory.auto_dimensions'.
- Remove deprecated preference mappings and update default preferences accordingly.
- Regenerate preference schemas to reflect the latest changes in memory configuration.
* 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>