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