Commit Graph

5264 Commits

Author SHA1 Message Date
tylinux
cccf9bb7be
feat: add latest zhipu models (#12169) 2025-12-28 19:11:08 +08:00
kangfenmao
c242860abc chore(release): v1.7.8
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-28 17:40:41 +08:00
fullex
cb93eee29d chore: mark multiple services and components as 'will deprecated' for v2 refactor
- Added deprecation notices to various services and components, indicating they are scheduled for removal in v2.0.0.
- Noted that feature PRs affecting these files are currently blocked, and only critical bug fixes will be accepted during the migration phase.
- Provided context and status links for ongoing v2 refactoring efforts.

This change is part of the preparation for the upcoming major version update.
2025-12-28 17:38:37 +08:00
SuYao
5ff173fcc7
fix(ollama): improve reasoningEffort handling in providerOptions (#12089)
* fix(ollama): improve reasoningEffort handling in providerOptions

* fix(ollama): update reasoning effort handling and add support for gpt-oss models

* fix(ollama): update think option to support 'low', 'medium', and 'high' values

* fix(ollama): update comment to clarify accepted reasoning effort values for gpt-oss models
2025-12-28 17:04:45 +08:00
Phantom
b78df05f28
fix(AssistantsTab): prevent deleting last assistant and add error message (#12162)
feat(AssistantsTab): prevent deleting last assistant and add error message

Add validation to prevent deleting the last assistant and show an error message when attempted. Also simplify the active assistant assignment logic when deleting an assistant.
2025-12-28 15:30:01 +08:00
Zhaolin Liang
c13dc6eab5
fix: shortcut icons sorting disorder (#12151)
Some checks failed
Auto I18N Weekly / Auto I18N (push) Has been cancelled
2025-12-27 20:04:51 +08:00
Shemol
2008d70707
fix(memory): fix global memory settings submit failure (#12147) 2025-12-27 18:00:20 +08:00
Shemol
723fa11647
perf(ModelList): use Map for O(1) model status lookup (#12161)
- Replace Array.find() with Map.get() for modelStatus lookup
- Add useMemo to create modelStatusMap from modelStatuses array
- Stabilize onEditModel callback with useCallback to prevent memo invalidation

Fixes #12035

Signed-off-by: SherlockShemol <shemol@163.com>
2025-12-27 13:57:33 +08:00
Phantom
9586f38157
build: upgrade electron-vite to 5.0.0 with HMR support (#12120) 2025-12-27 12:27:11 +08:00
fullex
401d66f3dd
fix(windows): remember size not working for SelectionAction window (#12132)
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-26 23:43:38 +08:00
defi-failure
99b431ec92
fix: remove trailing api version in ANTHROPIC_BASE_URL (#12145) 2025-12-26 17:37:58 +08:00
Shemol
ab3bce33b8
docs: fix copy -> cp in development guide (#12142)
Signed-off-by: SherlockShemol <shemol@163.com>
2025-12-26 17:05:45 +08:00
kangfenmao
0f0e18231d fix: update ollama provider type and increment store version to 190
- Changed ollama provider type from 'openai' to 'ollama' in SYSTEM_PROVIDERS_CONFIG.
- Incremented persisted reducer version from 189 to 190.
- Added migration logic for version 190 to update existing provider types in state.
2025-12-26 11:44:51 +08:00
jardel
4ae9bf8ff4
fix: allow more file extensions (#12099)
Co-authored-by: icarus <eurfelux@gmail.com>
2025-12-25 16:59:13 +08:00
kangfenmao
05dfb459a6 chore: release v1.7.7 2025-12-25 14:41:52 +08:00
Caelan
0669253abb
feat:dmx-painting-add-extend_params (#12098)
* dmx-painting-add-extend_params

* format-code

* 更新类型
2025-12-25 13:46:33 +08:00
fullex
4ba0f2d25c
fix: correct aihubmix anthropic API path (#12115)
Remove incorrect /anthropic suffix from aihubmix provider's anthropicApiHost configuration.
The correct API endpoint should be https://aihubmix.com/v1/messages, not https://aihubmix.com/anthropic/v1/messages.

Fixes issue where Claude API requests to aihubmix provider were failing due to incorrect URL path.
2025-12-25 13:26:32 +08:00
Kejiang Ma
f7312697e7
feat: close ovms process when app quit (#12101)
* feat:close ovms process while app quit

* add await for execAsync

* update 'will-quit' event
2025-12-24 15:26:19 +08:00
Phantom
d9171e0596
fix(openrouter): support GPT-5.1/5.2 reasoning effort 'none' for OpenRouter and improve error handling (#12088) 2025-12-24 14:18:41 +08:00
beyondkmp
89a6d817f1
fix(display): improve font selector for long font names (#12100)
* fix(display): improve font selector for long font names

- Increase Select width from 200px to 280px
- Increase SelectRow container width from 300px to 380px
- Add Tooltip to show full font name on hover
- Add text-overflow ellipsis for long font names

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* refactor(DisplaySettings): replace span with div and use CSS class for truncation

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Co-authored-by: icarus <eurfelux@gmail.com>
2025-12-24 13:25:37 +08:00
SuYao
09e58d3756
fix: interleaved thinking support (#12084)
* fix: update @ai-sdk/openai-compatible to version 1.0.28 and adjust related patches

* fix: add sendReasoning option to OpenAICompatibleProviderOptions and update message conversion logic

* fix: add interval thinking model support and related tests

* fix: add sendReasoning option to OpenAICompatibleProviderOptions and update related logic

* fix: remove MiniMax reasoning model support and update interval thinking model regex

* chore: add comment

* fix: rename interval thinking model references to interleaved thinking model
2025-12-23 20:08:53 +08:00
kangfenmao
e093a18deb refactor(settings): update MCP logo opacity and remove unused notes settings
- Adjust MCP logo opacity in MCPSettings and McpTool components for improved visual consistency.
- Remove notes settings entry from SettingsPage to streamline the settings interface.
2025-12-23 15:01:58 +08:00
亢奋猫
265934be5a
refactor(notes): move notes settings to popup in NotesPage (#12075)
* refactor(notes): move notes settings to popup in NotesPage

- Move NotesSettings.tsx from settings directory to notes directory
- Add "More Settings" menu item to notes dropdown menu
- Show settings in GeneralPopup when clicking "More Settings"
- Remove notes settings entry from SettingsPage sidebar and routes

* fix(notes): adjust margin in NotesSidebar component for improved layout

- Update margin-bottom from 20px to 12px in the NotesSidebar component to enhance visual spacing.

* refactor(notes): simplify styles object in HeaderNavbar component

- Consolidate styles object for body padding in HeaderNavbar to improve readability and maintainability.

---------

Co-authored-by: Claude <noreply@anthropic.com>
2025-12-23 14:57:03 +08:00
亢奋猫
5f0006dced
refactor(websearch): redesign settings with two-column layout (#12068)
- Refactor WebSearchSettings to use two-column layout (left sidebar + right content)
- Add local search provider settings with internal browser window support
- Add "Set as Default" button in provider settings page
- Show default indicator tag in provider list
- Prevent selection of providers without API key configured
- Add logos for local search providers (Google, Bing, Baidu)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude <noreply@anthropic.com>
2025-12-23 13:22:02 +08:00
亢奋猫
6815ab65d1
fix(memory): fix retrieval issues and enable database backup (#12073)
* fix(memory): fix retrieval issues and enable database backup

- Fix memory retrieval by storing model references instead of API client configs
  (baseURL was missing v1 suffix causing retrieval failures)
- Move memory database to DATA_PATH/Memory for proper backup support
- Add migration to convert legacy embedderApiClient/llmApiClient to model references
- Simplify IPC handlers by removing unnecessary async/await wrappers
- Rename and relocate MemorySettingsModal for better organization

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

* refactor(UserSelector): simplify user label rendering and remove unused dependencies

- Update UserSelector component to directly use user IDs as labels instead of rendering them through a function.
- Remove unnecessary dependency on the renderLabel function to streamline the code.

* refactor(UserSelector): remove unused dependencies and simplify user avatar logic

- Eliminate the getUserAvatar function and directly use user IDs for rendering.
- Remove the HStack and Avatar components from the renderLabel function to streamline the UserSelector component.

* refactor(ipc): simplify IPC handler for deleting all memories for a user and streamline error logging

- Remove unnecessary async/await from the Memory_DeleteAllMemoriesForUser handler.
- Simplify error logging in useAppInit hook for memory service configuration updates.
- Update persisted reducer version from 191 to 189 in the store configuration.

---------

Co-authored-by: Claude <noreply@anthropic.com>
2025-12-23 13:21:29 +08:00
George·Dong
6bdaba8a15
feat: add GLM-4.7 and MiniMax-M2.1 model support (#12071) 2025-12-23 12:16:03 +08:00
SuYao
d1c93e4eae
fix: update default assistant settings to disable temperature (#12069)
* fix: update default assistant settings to disable temperature

* fix: typecheck

* fix: typecheck

* refactor(settings): use DEFAULT_ASSISTANT_SETTINGS constant for reset

Replace hardcoded default settings with DEFAULT_ASSISTANT_SETTINGS constant to improve maintainability

* fix(AssistantService): set default maxTokens to DEFAULT_MAX_TOKENS

* docs(AssistantService): add jsdoc for getAssistantSettings function

* refactor(AssistantService): use default settings constants for fallback values

* refactor(AssistantService): update default assistant settings type

Add defaultModel field and mark settings as const satisfies AssistantSettings

* refactor(AssistantService): reorder and add new default assistant settings

Add reasoning_effort_cache and qwenThinkMode fields

* docs(AssistantService): add jsdoc comments for default assistant settings

Explain purpose of DEFAULT_ASSISTANT_SETTINGS template and clarify difference between template values and actual settings

* docs(AssistantService): move default assistant settings docs to function

The documentation about current settings inheritance was moved from createTranslateAssistant to the dedicated getDefaultAssistantSettings function where it belongs. This improves code organization and makes the documentation more accurate by placing it with the relevant function.

* docs(AssistantService): clarify getDefaultAssistant behavior in jsdoc

Explain the difference between this temporary instance and the actual default assistant from Redux store

* fix: change default enableTemperature value to false

The default value for enableTemperature was incorrectly set to true, which could lead to unexpected behavior. This change aligns it with the intended default behavior.

---------

Co-authored-by: icarus <eurfelux@gmail.com>
2025-12-23 12:13:01 +08:00
SuYao
7a862974c2
fix(options): add support for persistent server configuration in OpenAI provider options (#12058)
* fix(options): add support for persistent server configuration in OpenAI provider options
* fix(options): disable storing in OpenAI provider options
2025-12-22 16:13:31 +08:00
SuYao
26a3bd0259
feat: add openrouter support and update migration version to 188 (#12059)
* feat: add openrouter support and update migration version to 188
2025-12-21 20:15:17 +08:00
亢奋猫
e16413de76
feat(icons): add MCP logo and replace Hammer icon (#12061)
Replace the generic Hammer icon with the official MCP (Model Context
Protocol) logo in settings sidebar, tab container, and MCP settings page.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude <noreply@anthropic.com>
2025-12-21 20:01:41 +08:00
槑囿脑袋
fc3e92e2f7
refactor: change qrcode landrop to lantransfer (#11968)
* refactor: change qrcode landrop to lantransfer

* chore: update docs and tests

* fix: pr review

* fix: pr review

* chore: remove qrcode dependency

* fix: pr review

* fix: format

* fix: test
2025-12-21 17:39:23 +08:00
atoz03
9a435b8abb
feat(history-search): show keyword-adjacent snippets and align matching text (#12034)
* fix(history-search): show keyword-adjacent snippets and align matching text

  - Limit search results to title plus nearby lines with ellipses
  - Merge multi-keyword hit ranges and truncate long lines
  - Match against sanitized visible text to avoid URL/image false hits

* fix(history): 针对review 的改进:避免搜索高亮嵌套并优化命名与省略逻辑注释
2025-12-21 17:32:32 +08:00
Kejiang Ma
c4f94848e8
feat:upgrade ovms to 2025.4, add preset-model Qwen3-4B-int4-ov (#12045) 2025-12-21 17:22:59 +08:00
Phantom
c747b8e2a4
fix(prompt): remove unprofessional reward text and improve language instruction clarity (#12054)
* fix(toolUsePlugin): correct prompt formatting and instructions

- Remove misleading reward statement from tool use prompt
- Fix typo in XML tag format instruction ("MARK" to "MAKE")
- Reorganize response rules section for better clarity

* refactor(tool-use): consolidate default system prompt into shared module

Move DEFAULT_SYSTEM_PROMPT to core plugin module and reuse it in renderer
Update prompt to allow multiple tool uses per message and add response language rule
2025-12-21 17:20:16 +08:00
GeekMr
a35bf4afa1
fix(azure-openai): normalize Azure endpoint (#12055)
Co-authored-by: William Wang <WilliamOnline1721@hotmail.com>
2025-12-21 17:15:17 +08:00
sxjeru
9f948e1ce7
fix(parameterBuilder): enhance urlContext validation for supported providers and models (#12046)
Some checks failed
Auto I18N Weekly / Auto I18N (push) Has been cancelled
* fix(parameterBuilder): enhance urlContext validation for supported providers and models

Signed-off-by: sxjeru <sxjeru@gmail.com>

* fix(parameterBuilder): improve urlContext validation logic for supported models

Signed-off-by: sxjeru <sxjeru@gmail.com>

---------

Signed-off-by: sxjeru <sxjeru@gmail.com>
2025-12-20 20:14:40 +08:00
LiuVaayne
4508fe2877
🐛 fix(mcp): check system npx/uvx before falling back to bundled binaries (#12018) 2025-12-20 18:22:33 +08:00
Phantom
3045f924ce
fix(models): include GPT5.2 series in verbosity check (#12003) 2025-12-19 12:13:56 +08:00
kangfenmao
a6ba5d34e0 chore(release): v1.7.6 2025-12-18 22:19:11 +08:00
George·Dong
8ab375161d
fix: disable reasoning mode for translation to improve efficiency (#11998)
* fix: disable reasoning mode for translation to improve efficiency

- 修改 getDefaultTranslateAssistant 函数,将默认推理选项设置为 'none'
- 避免 PR #11942 引入的 'default' 选项导致翻译重新启用思考模式
- 显著提升翻译速度和性能
- 符合翻译场景不需要复杂推理的业务逻辑

* fix(AssistantService): adjust reasoning effort

Set reasoning effort to 'none' only if supported by model, otherwise use 'default'.

---------

Co-authored-by: icarus <eurfelux@gmail.com>
2025-12-18 20:16:09 +08:00
GeekMr
42260710d8
fix(azure): restore deployment-based URLs for non-v1 apiVersion and add tests (#11966)
* fix: support Azure OpenAI deployment URLs

* test: stabilize renderer setup

---------

Co-authored-by: William Wang <WilliamOnline1721@hotmail.com>
2025-12-18 18:12:26 +08:00
kangfenmao
5e8646c6a5 fix: update API path for image generation requests in OpenAIBaseClient 2025-12-18 14:45:30 +08:00
Phantom
7e93e8b9b2
feat(gemini): add support for Gemini 3 Flash and Pro model detection (#11984)
* 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
2025-12-18 14:35:36 +08:00
SuYao
eb7a2cc85a
feat: add support for Xiaomi MiMo model (#11961)
* 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
2025-12-18 13:49:09 +08:00
dependabot[bot]
fd6986076a
chore(deps): bump jws from 4.0.0 to 4.0.1 (#11977)
Bumps [jws](https://github.com/brianloveswords/node-jws) from 4.0.0 to 4.0.1.
- [Release notes](https://github.com/brianloveswords/node-jws/releases)
- [Changelog](https://github.com/auth0/node-jws/blob/master/CHANGELOG.md)
- [Commits](https://github.com/brianloveswords/node-jws/compare/v4.0.0...v4.0.1)

---
updated-dependencies:
- dependency-name: jws
  dependency-version: 4.0.1
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-12-18 13:34:39 +08:00
LiuVaayne
6309cc179d
feat(mcp): add Nowledge Mem builtin MCP server (#11875)
*  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
2025-12-18 13:34:06 +08:00
SuYao
c04529a23c
refactor: improve budget calculation logic (#11973)
* 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>
2025-12-18 13:30:41 +08:00
George·Dong
0f1b3afa72
feat: 添加火山引擎 Doubao-Seed-1.8 模型支持 (#11972)
- 新增模型定义: doubao-seed-1-8-251215
- 支持思考模式: reasoning_effort (minimal/low/medium/high)
- 支持 Function Call
- 支持图像理解 (Vision)
- 更新正则表达式支持 seed-1.8 变体
- 添加完整测试覆盖

修改文件:
- src/renderer/src/config/models/default.ts
- src/renderer/src/config/models/reasoning.ts
- src/renderer/src/aiCore/utils/reasoning.ts
- src/renderer/src/config/models/vision.ts
- src/renderer/src/config/models/tooluse.ts
- src/renderer/src/config/models/__tests__/reasoning.test.ts
2025-12-18 13:30:23 +08:00
Phantom
0cf0072b51
feat: add default reasoning effort option to resolve confusion between undefined and none (#11942)
* 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)
2025-12-18 13:00:23 +08:00
beyondkmp
150bb3e3a0
fix: auto-discover and persist Git Bash path on Windows for scoop (#11921)
* 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>
2025-12-18 09:57:23 +08:00