Commit Graph

5387 Commits

Author SHA1 Message Date
suyao
c430a37e55
chore: function pos 2026-01-07 01:36:42 +08:00
suyao
8d5c5bac84
Merge remote-tracking branch 'origin/main' into feat/proxy-api-server
Resolved conflict in providerConfig.ts:
- Kept shared aiCore implementation architecture from feat/proxy-api-server
- Added createDeveloperToSystemFetch function to shared/aiCore/providerConfig.ts
- Added isSupportDeveloperRoleProvider and isOpenAIReasoningModel context options
- Exported missing parseDataUrl, isDataUrl, isBase64ImageDataUrl from shared/utils
2026-01-07 01:33:59 +08:00
SuYao
6b0bb64795
fix: convert 'developer' role to 'system' for unsupported providers (#12325)
AI SDK v5 uses 'developer' role for reasoning models, but some providers
like Azure DeepSeek R1 only support 'system', 'user', 'assistant', 'tool'
roles, causing HTTP 422 errors.

This fix adds a custom fetch wrapper that converts 'developer' role back
to 'system' for providers that don't support it.

Fixes #12321

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

Co-authored-by: Claude <noreply@anthropic.com>
2026-01-07 01:03:37 +08:00
Shemol
116ee6f94b
fix: TokenFlux models list empty in drawing panel (#12326)
Use fixed base URL for TokenFlux image API instead of provider.apiHost.

After migration 191, apiHost was changed to include /openai/v1 suffix
for chat API compatibility, but image API needs the base URL without
this suffix, causing /openai/v1/v1/images/models (wrong path).

Fixes #12284

Signed-off-by: SherlockShemol <shemol@163.com>
2026-01-06 22:19:03 +08:00
George·Dong
af7896b900
fix(prompts): standardize tool use example format to use 'A:' label consistently (#12313)
- Changed all 'Assistant:' labels to 'A:' in tool use examples for consistency
- Added missing blank line before final response in both files
- Affects promptToolUsePlugin.ts and prompt.ts
- Resolves #12310
2026-01-06 21:45:27 +08:00
beyondkmp
bb9b73557b
fix: use ipinfo lite API with token for IP country detection (#12312)
* fix: use ipinfo lite API with token for IP country detection

Switch from ipinfo.io/json to api.ipinfo.io/lite/me endpoint with
authentication token to improve reliability and avoid rate limiting.

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

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

* fix: use country_code field from ipinfo lite API response

The lite API returns country_code instead of country field.

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

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

---------

Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-06 17:33:19 +08:00
Phantom
a5038ac844
fix: Add reasoning control for Deepseek hybrid inference models when reasoning effort is 'none' (#12314)
fix: Add reasoning control for Deepseek hybrid inference models when
reasoning effort is 'none'

It prevents warning
2026-01-06 17:28:34 +08:00
beyondkmp
9e45f801a8
chore: optimize build excludes to reduce package size (#12311)
- Exclude config, patches directories
- Exclude app-upgrade-config.json
- Exclude unnecessary node_modules files (*.cpp, node-addon-api, prebuild-install)

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

Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-06 15:30:22 +08:00
yudong
313dac0f64
fix: Changed the ID of the doubao-seed-1-8 from '251215' to '251228' (#12307)
Co-authored-by: wangyudong <wangyudong@qiyi.com>
2026-01-06 15:17:22 +08:00
suyao
4c43cca740
Merge remote-tracking branch 'origin/main' into feat/proxy-api-server 2026-01-06 14:14:25 +08:00
SuYao
76ee67d4d7
fix: prevent OOM when handling large base64 image data (#12244)
* fix: prevent OOM when handling large base64 image data

- Add memory-safe parseDataUrl utility using string operations instead of regex
- Truncate large base64 data in ErrorBlock detail modal to prevent freezing
- Update ImageViewer, FileStorage, messageConverter to use shared parseDataUrl
- Deprecate parseDataUrlMediaType in favor of shared utility
- Add GB support to formatFileSize
- Add comprehensive unit tests for parseDataUrl (18 tests)

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

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

* refactor: simplify parseDataUrl API to return DataUrlParts | null

- Change return type from discriminated union to simple nullable type
- Update all call sites to use optional chaining (?.)
- Update tests to use toBeNull() for failure cases
- More idiomatic and consistent with codebase patterns (e.g., parseJSON)

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

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

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-01-06 00:34:14 +08:00
George·Dong
2a31fa2ad5
refactor: switch yarn to pnpm (#12260)
* refactor: switch workflows from yarn to pnpm

Replace Yarn usage with pnpm in CI workflows to standardize package
management and leverage pnpm's store/cache behavior.

- Use pnpm/action-setup to install pnpm (v) instead of enabling corepack
  and preparing Yarn.
- Retrieve pnpm store path and update cache actions to cache the pnpm
  store and use pnpm-lock.yaml for cache keys and restores.
- Replace yarn commands with pnpm equivalents across workflows:
  install, i18n:sync/translate, format, build:* and tsx invocation.
- Avoid committing lockfile changes by resetting pnpm-lock.yaml instead
  of yarn.lock when checking for changes.
- Update install flags: use pnpm install --frozen-lockfile / --install
  semantics where appropriate.

These changes unify dependency tooling, improve caching correctness,
and ensure CI uses pnpm-specific lockfile and cache paths.

* build: switch pre-commit hook to pnpm lint-staged

Update .husky/pre-commit to run pnpm lint-staged instead of yarn.
This aligns the pre-commit hook with the project's package manager
and ensures lint-staged runs using pnpm's environment and caching.

* chore(ci): remove pinned pnpm version from GH Action steps

Remove the explicit `with: version: 9` lines from multiple GitHub Actions workflows
(auto-i18n.yml, nightly-build.yml, pr-ci.yml, update-app-upgrade-config.yml,
sync-to-gitcode.yml, release.yml). The workflows still call `pnpm/action-setup@v4`
but no longer hardcode a pnpm version.

This simplifies maintenance and allows the action to resolve an appropriate pnpm
version (or use its default) without needing updates whenever the pinned
version becomes outdated. It reduces churn when bumping pnpm across CI configs
and prevents accidental pin drift between workflow files.

* build: Update pnpm to 10.27.0 and add onlyBuiltDependencies config

* Update @cherrystudio/openai to 6.15.0 and consolidate overrides

* Add @langchain/core to overrides

* Add override for openai-compatible 1.0.27

* build: optimize pnpm config and add missing dependencies

- Comment out shamefully-hoist in .npmrc for better pnpm compatibility
- Add React-related packages to optimizeDeps in electron.vite.config.ts
- Add missing peer dependencies and packages that were previously hoisted

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

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

* build: refine pnpm configuration and dependency management

- Simplify .npmrc to only essential electron mirror config
- Move platform-specific dependencies to devDependencies
- Pin sharp version to 0.34.3 for consistency
- Update sharp-libvips versions to 1.2.4

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

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

* reduce app size

* format

* build: remove unnecessary disableOxcRecommendation option from react plugin configuration

* docs: Replace yarn commands with pnpm in documentation and scripts

* Revert "build: optimize pnpm config and add missing dependencies"

This reverts commit acffad31f8.

* build: import dependencies from yarn.lock

* build: Add some phantom dependencies and reorganize dependencies

* build: Keep consistent by removing types of semver

It's not in the previous package.json

* build: Add some phantom dependencies

Keep same version with yarn.lock

* build: Add form-data dependency version 4.0.4

* Add chalk dependency

* build: downgrade some dependencies

Reference: .yarn-state-copy.yml. These phantom dependencies should use top-level package of that version in node_modules

* build: Add phantom dependencies

* build: pin tiptap dependencies to exact versions

Ensure consistent dependency resolution by removing caret ranges and pinning all @tiptap packages to exact version 3.2.0

* chore: pin embedjs dependencies to exact versions

* build: pin @modelcontextprotocol/sdk to exact version 1.23.0

Remove caret from version specifier to prevent automatic upgrades and ensure consistent dependencies

* chore: update @types/node dependency to 22.17.2

Update package.json and pnpm-lock.yaml to use @types/node version 22.17.2 instead of 22.19.3 to maintain consistency across dependencies

* build: move some dependencies to dev deps and pin dependency versions to exact numbers

Remove caret (^) from version ranges to ensure consistent dependency resolution across environments

* chore: move dependencies from prod to dev and update lockfile

Move @ant-design/icons, chalk, form-data, and open from dependencies to devDependencies
Update pnpm-lock.yaml to reflect dependency changes

* build: update package dependencies

- Add new dependencies: md5, @libsql/win32-x64-msvc, @strongtz/win32-arm64-msvc, bonjour-service, emoji-picker-element-data, gray-matter, js-yaml
- Remove redundant dependencies from devDependencies

* build: add cors, katex and pako dependencies

add new dependencies to support cross-origin requests, mathematical notation rendering and data compression

* move some js deps to dev deps

* test: update snapshot tests for Spinner and InputEmbeddingDimension

* chore: exclude .zed directory from biome formatting

* Update @ai-sdk/openai-compatible patch hash

* chore: update @kangfenmao/keyv-storage to version 0.1.3 in package.json and pnpm-lock.yaml

---------

Co-authored-by: icarus <eurfelux@gmail.com>
Co-authored-by: beyondkmp <beyondkmp@gmail.com>
Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
Co-authored-by: kangfenmao <kangfenmao@qq.com>
2026-01-05 22:16:34 +08:00
SuYao
c4f372feba
fix(notes): prevent sticky folder z-index from overlapping webview (#12289)
Add `isolation: isolate` to NotesSidebar container to create a new
stacking context, preventing sticky folder elements (z-index: 1000+)
from overlapping MinApp webview when switching pages.

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

Co-authored-by: Claude <noreply@anthropic.com>
2026-01-05 18:16:08 +08:00
Nicolae Fericitu
ad164f2c1b
fix(i18n): update and refine Romanian translation (#12282)
I have corrected several typos and refined the terminology in the ro-ro.json file for better linguistic accuracy. This update ensures translation consistency throughout the user interface.
2026-01-05 15:23:49 +08:00
Phantom
ca3ddff00e
fix: replace nullish coalescing with logical OR in reasoning_content (#12281)
The change replaces ?? with || to avoid that reasoning_content is set as empty string
2026-01-05 14:42:58 +08:00
Calvin Wade
b4aeced1f9 fix: thinking time on stop (#11900)
* fix: preserve thinking time when stopping reply

Fixes #11886

Signed-off-by: Calvin <calvinvwei@gmail.com>

* fix: also preserve thinking time when stopping during thinking

This extends the previous fix to also handle the case when the user
stops the reply while thinking is still in progress (not just after
thinking is complete).

Signed-off-by: Calvin <calvinvwei@gmail.com>

* fix: auto-complete thinking when text output starts

This fixes the issue where the thinking timer continues running after
thinking is complete and text output begins. Some AI providers don't
send a reasoning-end event explicitly, so we now auto-complete thinking
when a text-start event is received with accumulated reasoning content.

Fixes #11796

Signed-off-by: Calvin <calvinvwei@gmail.com>

* refactor: extract emitThinkingCompleteIfNeeded to reduce duplication

Extract the shared logic for emitting THINKING_COMPLETE chunk into a
reusable method. This removes code duplication between text-start and
reasoning-end event handlers as suggested in code review.

Signed-off-by: Calvin <calvinvwei@gmail.com>

---------

Signed-off-by: Calvin <calvinvwei@gmail.com>
2026-01-04 19:44:25 +08:00
kangfenmao
d27d750bc5 feat(i18n): add "open" label for app data directory in multiple languages 2026-01-04 19:36:46 +08:00
suyao
06d4e286b3
chore: remove outdated comments regarding providerType handling 2026-01-04 18:55:22 +08:00
suyao
b52afe075f
refactor: message processing to unify streaming and non-streaming handling 2026-01-04 18:41:22 +08:00
kangfenmao
a2639053ef chore(release): v1.7.9
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-04 18:36:03 +08:00
suyao
3b44392e5a
feat: implement abort signal handling for streaming responses 2026-01-04 18:10:39 +08:00
George·Dong
68a75dc4e3
feat(code-tools): add 302.AI as Claude Code provider (#12254)
* feat(code-tools): add 302.AI as Claude Code provider

* feat(agent): add 302.AI anthropicApiHost to enable Agent support

302.AI now supports Claude Code (Agent) functionality by configuring
the anthropicApiHost endpoint. Users can use 302.AI's Claude models
(claude-sonnet-4-20250514, claude-opus-4-20250514) with Agent.

* feat(migrate): add migration 192 to set 302ai API host
2026-01-04 18:07:49 +08:00
suyao
dea4bad4ca
fix: add dispose method to prevent abort listener leak
Add dispose() method to StreamAbortController that explicitly removes
the abort event listener when stream ends normally. Previously, the
listener would only be removed when abort was triggered ({ once: true }),
but if the stream completed normally without abort, the listener would
remain attached until garbage collection.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-04 18:04:41 +08:00
suyao
af899c00f0
chore: format 2026-01-04 16:42:04 +08:00
suyao
30c98ccc02
Merge remote-tracking branch 'origin/main' into feat/proxy-api-server 2026-01-04 16:41:08 +08:00
kangfenmao
4c67e5b43a fix: update links in README and AboutSettings for correct documentation paths 2026-01-04 16:07:56 +08:00
Tsingv
2383fd06db
fix: resolve unexpected miniwindow loop closure on Mac (#12106)
fix: resolve unexpected miniwindow loop closure on MacOS 26+
2026-01-04 14:29:00 +08:00
Zhaolin Liang
f8519f0bf0
fix: HTML preview tab controls not working in fullscreen (#12152) 2026-01-04 13:49:40 +08:00
github-actions[bot]
2012378341
🤖 Weekly Auto I18N Sync: Jan 04, 2026 (#12262)
feat(bot): Weekly automated script run

Co-authored-by: EurFelux <59059173+EurFelux@users.noreply.github.com>
2026-01-04 13:47:59 +08:00
LiuVaayne
86adb2e11c
feat(browser): add user data persistence and multi-tab support (#12082)
- Add session-based user data persistence using Electron partitions
- Implement multi-tab support with tab management operations
- Add new tools: create_tab, list_tabs, close_tab, switch_tab
- Update existing tools (open, execute, fetch, reset) to support tabId parameter
- Refactor controller to manage sessions with multiple tabs
- Add comprehensive documentation in README.md
- Add TypeScript interfaces for SessionInfo and TabInfo

BREAKING CHANGE: Controller now manages sessions with tabs instead of single windows per session
2026-01-04 13:28:48 +08:00
Phantom
680bda3993
fix(translate): Fix ActionTranslate duplicate execution and getLanguageByLangcode logic (#12241)
* refactor(translate): remove default temperature setting

* refactor(translate): Remove temperature setting from language detection
prompt

* refactor: Set default translate languages from user settings

Initialize target language from user's language setting, falling back to
zh-CN if unknown. Set alter language to en-US by default. Remove
redundant logic that was duplicated in the effect.

* fix(translate): translate action won't trigger twice

* fix(translate): Fix getLanguageByLangcode to return built-in language
when not loaded

Previously, the function would always return UNKNOWN if the languages
were not loaded, even for built-in language codes. This change ensures
built-in languages are returned if found, regardless of the load state.

* fix: Expose translation languages loaded state and fix initialization

Add `isLoaded` flag to `useTranslate` hook to track when translation
languages are available. Use this flag to prevent premature
initialization in `ActionTranslate` component, ensuring language lookups
succeed before creating assistants and topics.

Add error logging for failed custom language loading and update fallback
warning messages for better debugging.

* fix: set initialized when finished
2026-01-04 13:25:08 +08:00
dependabot[bot]
acd1ecc09c
ci(deps): bump peter-evans/create-pull-request from 6 to 8 (#12224)
Bumps [peter-evans/create-pull-request](https://github.com/peter-evans/create-pull-request) from 6 to 8.
- [Release notes](https://github.com/peter-evans/create-pull-request/releases)
- [Commits](https://github.com/peter-evans/create-pull-request/compare/v6...v8)

---
updated-dependencies:
- dependency-name: peter-evans/create-pull-request
  dependency-version: '8'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-01-04 08:49:16 +08:00
beyondkmp
e3d1996254
fix: prevent zoom reset during in-page navigation (#12257)
Fixes an Electron bug where zoom factor resets during route changes by listening to the 'did-navigate-in-page' event and reapplying the configured zoom factor.

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

Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-03 22:07:53 +08:00
Nicolae Fericitu
56cf347909
feat(i18n): add professional Romanian localization (ro-RO) (#12216)
* feat(i18n): add Romanian localization (ro-RO)

Added the ro-ro.json file to provide Romanian language support for the Cherry Studio interface.

This commit introduces a high-quality, professional translation for the Romanian language. The localization has been carefully reviewed to ensure linguistic accuracy and terminology consistency, so no further adjustments from other contributors are required at this stage. Thank you!

* chore: move ro-ro.json to translate folder and register in index.ts

Moved the Romanian translation file to the translate directory and updated the i18n index to support the automated workflow as requested.

* Delete src/renderer/src/i18n/locales/ro-ro.json

* chore: add ro-ro.json to translate folder

Finalized the relocation of the Romanian translation file to the translate directory to support the automated i18n workflow.

* chore(i18n): remove trailing comma in index.ts

Biome formatter removed trailing comma for consistency.

* feat(i18n): add Romanian (ro-RO) to language selector

Add Romanian language option in settings with Română label and 🇷🇴 flag.

* fix(i18n): add Romanian language support

- Add ro-RO to LanguageVarious type
- Add Romanian to language selector in settings
- Add emoji picker fallback to English (no Romanian CLDR data)

* feat: Add Romanian to auto-translation language map

* fix: Add Romanian language support in main

* fix: Add Romanian (ro-RO) locale support for AntdProvider

* fix: Add Romanian language support to smooth stream segmenter

* fix: Add Romanian translations for assistant preset groups

---------

Co-authored-by: George·Dong <GeorgeDong32@qq.com>
Co-authored-by: icarus <eurfelux@gmail.com>
2026-01-03 21:22:19 +08:00
Zhaolin Liang
2a3955919e
fix: prevent crash when switching between agent and assistant (#12252)
Some checks failed
Auto I18N Weekly / Auto I18N (push) Has been cancelled
2026-01-03 17:20:52 +08:00
suyao
40fee5de40
chore: format 2026-01-03 16:38:06 +08:00
suyao
2a6dcec120
Merge remote-tracking branch 'origin/main' into feat/proxy-api-server 2026-01-03 16:37:43 +08:00
fullex
ca2b0ac28d refactor: merge messageThunk.v2.ts into messageThunk.ts
Remove the confusing V2 naming from message thunk functions to avoid conflicts with the upcoming real V2 data refactoring.

  Changes:
  - Inline V2 function implementations directly into messageThunk.ts
  - Replace V2 function calls with direct dbService calls
  - Remove messageThunk.v2.ts file
  - Remove misleading "V2 DATA&UI REFACTORING" header comments

  The V2 suffix was originally added for agent session support, not for a data layer refactoring. This cleanup clears the naming space for the actual V2 refactoring work.
2026-01-03 16:36:53 +08:00
suyao
f4387d22a6
fix: openrouter bug 2026-01-03 16:24:28 +08:00
suyao
d35346f5ad
chore: lint 2026-01-03 16:17:26 +08:00
Hizome
078cf39313
fix: implement navigation in agent mode (#12238)
fix: add navigation in agentm mode

Co-authored-by: harry <harry@mock.com>
2026-01-03 16:14:12 +08:00
suyao
8525646889
chore: add comment 2026-01-03 16:12:37 +08:00
suyao
1755fd9bcb
refactor: streaming adapter 2026-01-03 16:11:54 +08:00
suyao
56dfd1de1e
fix: lint 2026-01-03 05:47:12 +08:00
suyao
00177d26cb
refactor: again 2026-01-03 05:31:19 +08:00
suyao
78f60deb91
refactor: reorganize @shared files 2026-01-03 05:27:42 +08:00
suyao
d74506ac3b
Merge remote-tracking branch 'origin/main' into feat/proxy-api-server 2026-01-03 04:56:24 +08:00
SuYao
48a582820f
feat: update-t2i-image (#12236)
* chore: comment

* chore: comment 2

* fix: comment

* chore: var name
2026-01-02 16:26:28 +08:00
Northword
77e024027c
fix(miniapps): switch to new google ai studio logo (#12229) 2026-01-01 19:13:24 +08:00
Phantom
d391e55a8a
refactor(ovms): lazy-load OVMS support check with SWR (#12226) 2026-01-01 16:40:12 +08:00