Skip to content

Conversation

@zerob13
Copy link
Collaborator

@zerob13 zerob13 commented Jun 21, 2025

Release 0.2.4

  • 新增模型配置设置界面,可以自己配置模型的各类参数了
  • 适配了 macOS 26 Tahoe
  • 优化了更新流程,新增托盘菜单版本检查功能和提示对话框
  • 支持设置显示/隐藏窗口的快捷键
  • 新增对 Minimax 和 Gemini 模型列表 API 的优化
  • 支持 OpenRouter 和 PPIO 模型配置 API,不再需要更新软件才获取最新配置了
  • 新增对 E2B 沙箱的支持,增强工具箱里面可以选择用E2B来执行代码。
  • 新增 Vitest 测试框架支持
  • 支持 Bun 和 UV 运行时环境,MCP体验更丝滑
  • 全面使用 Oxlint 保障
  • 包管理正式切换为 pnpm
  • 修复模型选择框的一系列展示问题
  • 修复窗口最大化的时候的一些不正常的情况
  • 取消了 MCP Server 启停后的排序修改逻辑
  • 优化了 IPC 通道的信息,减少了开销

Summary by CodeRabbit

  • New Features

    • Added support for configuring custom model parameters (max tokens, context length, temperature, vision, function call, reasoning, model type) via a new model configuration dialog.
    • Introduced E2B sandbox integration for secure Python code execution in Powerpack servers, with UI support for enabling and configuring E2B.
    • Added new LLM providers: Minimax and Together.
    • Dynamic model list fetching for Gemini, PPIO, and OpenRouter providers with improved auto-enabling logic.
    • Enhanced session recovery for MCP client with automatic error handling and runtime support for Bun and UV.
    • Tray menu now includes a "Check for Updates" option.
    • Added shortcut for toggling window visibility.
  • Improvements

    • Unified package management and scripts to pnpm; updated documentation and workflows accordingly.
    • Expanded and refined default and provider-specific model settings.
    • Enhanced model selection UI to support multiple model types (e.g., Chat, ImageGeneration).
    • Improved error handling and event notification across backup, import, and update flows.
    • Localizations updated for new features in multiple languages.
  • Bug Fixes

    • Fixed typos and method naming inconsistencies.
    • Addressed migration issues for provider URLs and ensured correct model filtering.
  • Documentation

    • Added new documentation for MCP session recovery.
    • Updated guides and READMEs for new features, provider changes, and package manager migration.
    • Expanded localization files for new UI elements and features.
  • Chores

    • Removed obsolete configuration and documentation files.
    • Updated dependencies and cleaned up configuration files for linting and formatting.

zhangmo8 and others added 30 commits June 3, 2025 13:40
refactor: migration to pnpm
fix: fix sharp on mac arm build by x64
added togetherAI provider

:

TogetherAI provider
feat: show laste-version-dialog tips for user
Co-authored-by: duskzhen <zerob13@gmail.com>
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jun 21, 2025

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Walkthrough

This update introduces centralized model configuration management with persistent storage, dynamic model type filtering, and batch status retrieval. It adds new LLM providers (Minimax, Together), dynamic model discovery for Gemini, and OpenRouter/PPIO API-driven model metadata. The Powerpack server now supports E2B sandboxed Python execution. UI components and localization are extended for model configuration and E2B integration. The build system migrates to pnpm, and session recovery logic is enhanced for MCP clients.

Changes

File(s) / Group Change Summary
.github/workflows/build.yml, .github/workflows/prcheck.yml, package.json, CONTRIBUTING*, README*, .prettierignore, .oxlintrc.json, pnpm-workspace.yaml, scripts/install-sharp-for-platform.js Migrated build and workflow tooling from npm to pnpm, updated Node.js versions, added pnpm-specific scripts and configuration, and enhanced documentation for pnpm usage.
src/main/presenter/configPresenter/modelConfig.ts, src/main/presenter/configPresenter/index.ts Introduced ModelConfigHelper for persistent model configuration management, batch status retrieval, import/export, and refactored ConfigPresenter to delegate model config logic.
src/main/presenter/configPresenter/modelDefaultSettings.ts, src/main/presenter/configPresenter/providerModelSettings.ts Updated and extended default and provider-specific model settings, added new models, standardized naming, and included new types (e.g., Embedding, ImageGeneration).
src/main/presenter/llmProviderPresenter/providers/geminiProvider.ts Refactored Gemini provider to fetch models dynamically from API, added fuzzy matching for recommended models, and improved auto-enabling logic.
src/main/presenter/llmProviderPresenter/providers/openRouterProvider.ts, src/main/presenter/llmProviderPresenter/providers/ppioProvider.ts Added API-driven model metadata fetching and config synchronization for OpenRouter and PPIO providers.
src/main/presenter/llmProviderPresenter/providers/minimaxProvider.ts, src/main/presenter/llmProviderPresenter/providers/togetherProvider.ts, src/main/presenter/configPresenter/providers.ts, src/main/presenter/llmProviderPresenter/index.ts Added new LLM providers (Minimax, Together) with completion, summary, and model fetching capabilities.
src/main/presenter/llmProviderPresenter/baseProvider.ts, src/main/presenter/threadPresenter/index.ts Refined tool call record handling and description, changed function call record key, and clarified tool call result structure.
src/main/presenter/llmProviderPresenter/providers/openAICompatibleProvider.ts Changed visibility of isNoModelsApi to protected and improved fallback ID generation for function calls.
src/main/presenter/mcpPresenter/inMemoryServers/powerpackServer.ts, src/renderer/src/components/mcp-config/mcpServerForm.vue Integrated E2B sandbox support for secure Python execution in Powerpack server, with UI for enabling and configuring E2B.
src/main/presenter/mcpPresenter/mcpClient.ts, src/main/presenter/mcpPresenter/serverManager.ts, docs/mcp-session-recovery.md Added robust session error detection and automatic recovery for MCP clients, extended runtime support, and documented the session recovery mechanism.
src/renderer/src/components/settings/ModelConfigDialog.vue, src/renderer/src/components/settings/ModelConfigItem.vue, src/renderer/src/components/settings/ProviderModelManager.vue, src/renderer/src/components/settings/ProviderModelList.vue, src/renderer/src/components/settings/ModelProviderSettingsDetail.vue Added dialog and UI flows for configuring model parameters, propagating config changes, and updating provider/model lists.
src/renderer/src/components/ModelSelect.vue, src/renderer/src/components/NewThread.vue, src/renderer/src/components/TitleView.vue, src/renderer/src/components/settings/CommonSettings.vue Enhanced model selection to support type-based filtering (Chat, ImageGeneration, etc.), updated default selection logic, and imported necessary enums.
src/renderer/src/i18n/*/settings.json, src/renderer/src/i18n/*/update.json Added comprehensive localization for model configuration, E2B sandbox, and update status messages across multiple languages.
src/main/presenter/syncPresenter/index.ts Included model-config.json in backup/import flows for model config persistence.
src/main/presenter/mcpPresenter/inMemoryServers/builder.ts, src/main/presenter/mcpPresenter/serverManager.ts, src/main/presenter/mcpPresenter/index.ts Updated server instantiation and event emission to support new Powerpack/E2B flows and unified event dispatching.
src/main/presenter/filePresenter/CsvFileAdapter.ts, src/main/presenter/filePresenter/FilePresenter.ts, src/main/presenter/sqlitePresenter/importData.ts, src/main/presenter/mcpPresenter/inMemoryServers/filesystem.ts, src/main/presenter/threadPresenter/contentEnricher.ts, src/main/presenter/threadPresenter/messageManager.ts Minor error handling and formatting adjustments, removed error parameter from catch blocks, and improved error messages.
src/main/presenter/llmProviderPresenter/providers/anthropicProvider.ts, src/main/presenter/llmProviderPresenter/providers/deepseekProvider.ts, src/main/presenter/llmProviderPresenter/providers/siliconcloudProvider.ts, src/main/presenter/llmProviderPresenter/providers/openAIResponsesProvider.ts, src/main/presenter/llmProviderPresenter/providers/githubCopilotProvider.ts, src/main/presenter/mcpPresenter/inMemoryServers/customPromptsServer.ts Formatting and indentation changes only.
src/main/presenter/llamaCppPresenter/llama.ts Added a single debug log statement.
src/main/presenter/shortcutPresenter.ts, src/renderer/src/components/settings/ShortcutSettings.vue Added new shortcut mapping for toggling window visibility.
src/main/presenter/proxyConfig.ts, src/renderer/src/components/settings/CommonSettings.vue Refined proxy URL validation regex pattern.
src/main/presenter/llmProviderPresenter/oauthHelper.ts Minor formatting in constructor.
src/main/presenter/notifactionPresenter.ts, src/main/presenter/upgradePresenter/index.ts, src/main/presenter/threadPresenter/messageManager.ts Reformatted multi-line object literals in event emissions.
src/main/presenter/tabPresenter.ts Refactored window resize/maximize event handling for tab views.
src/main/presenter/configPresenter/mcpConfHelper.ts, src/main/presenter/mcpPresenter/index.ts, src/main/presenter/mcpPresenter/mcpClient.ts Unified event emission to use eventBus.send with explicit targets.
src/main/eventbus.ts, src/main/presenter/windowPresenter/index.ts Fixed method name typo (sendTodefaultTabsendToDefaultTab).
src/main/events.ts, src/main/index.ts, src/main/presenter/trayPresenter.ts Added new tray event for update checks and corresponding event handler.
src/renderer/src/components/settings/PromptSetting.vue, src/renderer/src/components/editor/mention/MentionList.vue, src/renderer/src/components/editor/mention/PromptParamsDialog.vue, src/renderer/src/components/editor/mention/suggestion.ts, src/renderer/src/components/settings/ProviderApiConfig.vue Formatting and style improvements.
src/renderer/src/components/ui/UpdateDialog.vue Improved update dialog to handle "already up to date" state.
src/renderer/src/components/settings/AboutUsSettings.vue, src/renderer/src/components/SideBar.vue Updated update check calls to accept a boolean argument.
src/renderer/src/assets/style.css, src/renderer/src/i18n/*/contextMenu.json Removed trailing whitespace and added newlines for formatting.
docs/developer-guide.md, docs/user-guide.md Renamed MCP acronym to "Model Context Protocol".
docs/mcp-session-recovery.md Added documentation for MCP session recovery mechanism.
docs/config-presenter-design.md, eslint.config.mjs, .cursor/rules/build-deploy.mdc Deleted obsolete documentation and configuration files.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant UI (ModelConfigDialog)
    participant Main Process (ConfigPresenter)
    participant ModelConfigHelper (Store)

    User->>UI (ModelConfigDialog): Open dialog for model config
    UI (ModelConfigDialog)->>Main Process (ConfigPresenter): getModelConfig(modelId, providerId)
    Main Process (ConfigPresenter)->>ModelConfigHelper (Store): getModelConfig(modelId, providerId)
    ModelConfigHelper (Store)-->>Main Process (ConfigPresenter): Return config (user/provider/default)
    Main Process (ConfigPresenter)-->>UI (ModelConfigDialog): Return config
    User->>UI (ModelConfigDialog): Edit and save config
    UI (ModelConfigDialog)->>Main Process (ConfigPresenter): setModelConfig(modelId, providerId, config)
    Main Process (ConfigPresenter)->>ModelConfigHelper (Store): setModelConfig(modelId, providerId, config)
    ModelConfigHelper (Store)-->>Main Process (ConfigPresenter): Ack
    Main Process (ConfigPresenter)-->>UI (ModelConfigDialog): Ack (emit config changed event)
Loading
sequenceDiagram
    participant MCP Client
    participant MCP Server

    MCP Client->>MCP Server: Tool call / List / Get
    MCP Server-->>MCP Client: Error (session invalid)
    MCP Client->>MCP Client: Detect session error
    MCP Client->>MCP Client: Restart service, clear cache
    MCP Client->>MCP Server: Retry operation
    MCP Server-->>MCP Client: (If error again) Error (session invalid)
    MCP Client->>MCP Client: Stop service, emit stopped event
Loading
sequenceDiagram
    participant User
    participant UI (mcpServerForm)
    participant Main Process (PowerpackServer)

    User->>UI (mcpServerForm): Enable E2B, enter API key
    UI (mcpServerForm)->>Main Process (PowerpackServer): Start server with USE_E2B and E2B_API_KEY
    Main Process (PowerpackServer)->>Main Process (PowerpackServer): Setup E2B config
    Main Process (PowerpackServer)->>Main Process (PowerpackServer): Expose run_code tool for E2B
    User->>UI (mcpServerForm): Run Python code
    UI (mcpServerForm)->>Main Process (PowerpackServer): Execute run_code
    Main Process (PowerpackServer)->>E2B Sandbox: Run code
    E2B Sandbox-->>Main Process (PowerpackServer): Return result
    Main Process (PowerpackServer)-->>UI (mcpServerForm): Show execution result
Loading

Possibly related PRs

  • ThinkInAIXYZ/deepchat#540: Implements session error detection and automatic recovery logic for MCP HTTP 400 errors in McpClient, directly matching the session recovery enhancements here.
  • ThinkInAIXYZ/deepchat#516: Introduces centralized model configuration management, persistent storage, and UI for custom model parameters, closely related to the model config refactoring and dialog features in this PR.
  • ThinkInAIXYZ/deepchat#533: Adds/enhances model selection filtering by type (Chat, ImageGeneration, Embedding), directly related to the type-based filtering and ModelSelect changes here.

Poem

(\(\
( -.-)
o_(")(")

A rabbit hops with nimble flair,
Model configs stored with care.
Gemini learns new tricks today,
E2B runs Python far away!
MCP recovers, never stuck—
With pnpm, we build with luck!
Hooray for code that’s bold and bright—
This warren’s future’s looking right!


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@zerob13
Copy link
Collaborator Author

zerob13 commented Jun 21, 2025

@coderabbitai review

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jun 21, 2025

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 7

🧹 Nitpick comments (21)
src/main/presenter/llamaCppPresenter/llama.ts (1)

147-147: Remove or replace the stray console.log.

This line appears to be a leftover debug statement that will log 'llama' on every load. Please remove it or replace it with a structured logger at the appropriate level.

pnpm-workspace.yaml (1)

1-5: Consider the implications of using "current" architecture only.

The configuration restricts support to the current OS and CPU architecture only. While this works for single-platform development, it may cause issues in:

  • Cross-platform development scenarios
  • CI/CD pipelines running on different architectures
  • Team members using different system architectures

Consider if this restriction aligns with your project's deployment and development needs.

If broader architecture support is needed, you could specify explicit architectures:

 supportedArchitectures:
   os:
-    - current
+    - win32
+    - darwin
+    - linux
   cpu:
-    - current
+    - x64
+    - arm64
electron-builder.yml (1)

8-8: Remove duplicate test directory exclusion.

The test directory exclusion is correctly added, but there's a duplicate entry on line 19. Having the same exclusion pattern twice is unnecessary.

Apply this diff to remove the duplicate:

  - '!electron-builder.yml'
  - '!electron-builder-macx64.yml'
- - '!test/*'
  - '!*.config.ts'
src/renderer/src/components/editor/mention/MentionList.vue (2)

19-19: Inconsistent <Icon> formatting.
You’ve inlined this <Icon> component, whereas others use multi-line props. Consider standardizing either single-line for short tags or multi-line when there are multiple props.


74-80: Simplify hasFiles check.
You can shrink the boolean logic to a one-liner using optional chaining and Array.isArray:

return Array.isArray(item.mcpEntry?.files) && item.mcpEntry.files.length > 0
electron-builder-macx64.yml (1)

7-9: Duplicate and too narrow exclusion pattern for tests.
The pattern !test/* appears twice and only excludes top-level test files. Consolidate into one entry and use a recursive glob, e.g.:

-  - '!test/*'
-  - '!test/*'
+  - '!**/test/**'

Also applies to: 18-20

README.md (1)

272-273: Fix grammatical issue in Windows note.

The note is helpful for Windows users, but there's a minor grammatical issue identified by static analysis.

Apply this diff to fix the grammar:

-* For Windows: To allow non-admin users to create symlinks and hardlinks, enable `Developer Mode` in Settings or use an administrator account. Otherwise `pnpm` ops will fail.
+* For Windows: To allow non-admin users to create symlinks and hardlinks, enable `Developer Mode` in Settings or use an administrator account. Otherwise, `pnpm` ops will fail.
README.jp.md (1)

268-268: Fix markdown formatting issues.

Static analysis identified minor markdown formatting inconsistencies that should be addressed for better compliance.

Apply these fixes:

-* For Windows: 非管理者ユーザーがシンボリックリンクやハードリンクを作成できるようにするには、設定で「開発者モード」を有効にするか、管理者アカウントを使用してください。それ以外の場合、pnpm の操作は失敗します。
+- For Windows: 非管理者ユーザーがシンボリックリンクやハードリンクを作成できるようにするには、設定で「開発者モード」を有効にするか、管理者アカウントを使用してください。それ以外の場合、pnpm の操作は失敗します。

And for consistency with markdown best practices, consider adding output examples for shell commands where appropriate.

Also applies to: 273-273

src/renderer/src/components/NewThread.vue (1)

236-248: Improve model selection logic efficiency

The current implementation flattens all models from all providers and then searches for the first matching type. This approach works but could be optimized.

Consider this more efficient approach that avoids unnecessary array operations:

-    const model = settingsStore.enabledModels
-      .flatMap((provider) =>
-        provider.models.map((m) => ({ ...m, providerId: provider.providerId }))
-      )
-      .find((m) => m.type === ModelType.Chat || m.type === ModelType.ImageGeneration)
+    let model = null
+    outerLoop: for (const provider of settingsStore.enabledModels) {
+      for (const m of provider.models) {
+        if (m.type === ModelType.Chat || m.type === ModelType.ImageGeneration) {
+          model = { ...m, providerId: provider.providerId }
+          break outerLoop
+        }
+      }
+    }

This approach stops searching once the first matching model is found, avoiding unnecessary iterations.

scripts/install-sharp-for-platform.js (1)

28-35: Minor formatting and consistency issue in Linux configuration.

There's a missing space after the comma in the Linux ARM64 configuration and an inconsistent comment about WebAssembly support.

Apply this diff to fix the formatting:

  'linux-arm64': {
-    os: ['current','linux'],
+    os: ['current', 'linux'],
    cpu: ['current', 'wasm32'],
  },

Also, consider clarifying why wasm32 is included for Linux platforms but not others, or make the comment more specific about Sharp's WebAssembly requirements for Linux.

src/renderer/src/components/settings/ModelConfigDialog.vue (1)

254-284: Validation logic is sound but consider consolidating error checking.

The validation function checks all constraints properly, but the computed isValid property calls validateForm() every time it's accessed, which could be inefficient.

Consider using a reactive approach to validation:

-// 表单是否有效
-const isValid = computed(() => {
-  validateForm()
-  return Object.keys(errors.value).length === 0
-})
+// 表单是否有效
+const isValid = computed(() => {
+  return Object.keys(errors.value).length === 0
+})
+
+// 在 config 变化时自动验证
+watch(config, () => {
+  validateForm()
+}, { deep: true })
src/main/presenter/llmProviderPresenter/providers/minimaxProvider.ts (2)

6-9: Remove the unnecessary constructor.

The constructor doesn't add any functionality beyond calling the parent constructor.

Apply this diff to remove the unnecessary constructor:

-  constructor(provider: LLM_PROVIDER, configPresenter: ConfigPresenter) {
-    // 初始化智谱AI模型配置
-    super(provider, configPresenter)
-  }

47-64: Consider localization consistency for summary prompts.

The summary prompt is hardcoded in English, which may not align with the application's localization strategy. Consider making this configurable or using the user's language preference.

src/main/presenter/llmProviderPresenter/providers/togetherProvider.ts (1)

6-8: Remove the unnecessary constructor.

The constructor doesn't add any functionality beyond calling the parent constructor.

Apply this diff to remove the unnecessary constructor:

-  constructor(provider: LLM_PROVIDER, configPresenter: ConfigPresenter) {
-    super(provider, configPresenter)
-  }
src/main/presenter/llmProviderPresenter/providers/ppioProvider.ts (1)

144-229: Consider removing or conditionalizing the console.log statement.

The implementation looks solid with proper feature extraction and configuration updates. However, line 222 contains an active console.log that might be too verbose for production.

Consider wrapping the log in a debug condition:

-console.log(`Processed ${models.length} PPIO models with dynamic configuration updates`)
+if (process.env.DEBUG_PPIO) {
+  console.log(`Processed ${models.length} PPIO models with dynamic configuration updates`)
+}
docs/mcp-session-recovery.md (1)

1-241: Add language specifiers to fenced code blocks.

The documentation is comprehensive and well-written. However, some code blocks are missing language specifiers which would improve syntax highlighting.

Add language specifiers to the code blocks:

  • Line 7: Add language specifier
  • Line 175: Add text or log specifier
  • Line 181: Add text or log specifier

Example:

-```
+```text
Error POSTing to endpoint (HTTP 400): Bad Request: No valid session ID provided
src/main/presenter/llmProviderPresenter/index.ts (1)

647-863: Well-structured refactoring of tool call handling.

The distinction between native and non-native function calling scenarios is clearly implemented. The approach of formatting tool records as XML for non-native providers aligns well with the prompt changes in baseProvider.ts.

Consider internationalizing the Chinese prompt texts for broader applicability.

Consider making the prompt texts configurable or translatable:

-const userPromptText = '以上是你刚执行的工具调用及其响应信息,已帮你插入,请仔细阅读工具响应,并继续你的回答。'
+const locale = this.configPresenter.getLanguage?.() || 'zh-CN'
+const userPromptText = this.getToolResponsePrompt(locale)
src/main/presenter/llmProviderPresenter/providers/openRouterProvider.ts (1)

191-191: Remove commented debug statements

Debug logging statements should be removed from production code to reduce noise and improve maintainability.

-      // console.log('OpenRouter models response:', JSON.stringify(response, null, 2))
-

         // Update configuration if changed
         if (configChanged) {
-          // console.log(`Updating OpenRouter configuration for model ${modelId}:`, {
-          //   old: {
-          //     contextLength: existingConfig.contextLength,
-          //     maxTokens: existingConfig.maxTokens,
-          //     functionCall: existingConfig.functionCall,
-          //     vision: existingConfig.vision,
-          //     reasoning: existingConfig.reasoning
-          //   },
-          //   new: newConfig
-          // })
-
           this.configPresenter.setModelConfig(modelId, this.provider.id, newConfig)
         }

Also applies to: 245-254

src/main/presenter/llmProviderPresenter/providers/geminiProvider.ts (1)

335-349: Add logging for auto-enabled models

Consider adding more detailed logging about which specific matching strategy was used for each auto-enabled model to help with debugging and monitoring.

       const modelsToEnable = this.models.filter((model) => {
-        return this.isModelRecommended(model.id, recommendedModelIds)
+        const isRecommended = this.isModelRecommended(model.id, recommendedModelIds)
+        if (isRecommended) {
+          console.debug(`Model ${model.id} matched as recommended model`)
+        }
+        return isRecommended
       })
src/main/presenter/mcpPresenter/mcpClient.ts (2)

281-281: Use debug level for verbose logging.

Consider using console.debug instead of console.info and console.log for verbose logging that's primarily useful during development.

Apply this diff:

-    console.info('runtimeBasePath', runtimeBasePath)
+    console.debug('runtimeBasePath', runtimeBasePath)
-        console.log('mcp env', command)
+        console.debug('mcp env', command)

Also applies to: 518-518


667-716: Robust session recovery implementation.

The session recovery mechanism is well-designed with proper safeguards against infinite loops. The single retry approach is simple and effective.

Consider future enhancements:

  • Exponential backoff for multiple retry attempts
  • Configurable retry limits
  • Metrics/telemetry for recovery attempts
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between af98026 and 38516b2.

📒 Files selected for processing (107)
  • .cursor/rules/build-deploy.mdc (0 hunks)
  • .cursor/rules/development-setup.mdc (1 hunks)
  • .github/workflows/build.yml (4 hunks)
  • .github/workflows/prcheck.yml (1 hunks)
  • .oxlintrc.json (1 hunks)
  • .prettierignore (1 hunks)
  • CONTRIBUTING.md (3 hunks)
  • CONTRIBUTING.zh.md (3 hunks)
  • README.jp.md (1 hunks)
  • README.md (1 hunks)
  • README.zh.md (1 hunks)
  • docs/config-presenter-design.md (0 hunks)
  • docs/developer-guide.md (5 hunks)
  • docs/mcp-session-recovery.md (1 hunks)
  • docs/user-guide.md (1 hunks)
  • electron-builder-macx64.yml (1 hunks)
  • electron-builder.yml (1 hunks)
  • eslint.config.mjs (0 hunks)
  • package.json (4 hunks)
  • pnpm-workspace.yaml (1 hunks)
  • scripts/install-sharp-for-platform.js (1 hunks)
  • src/main/eventbus.ts (1 hunks)
  • src/main/events.ts (2 hunks)
  • src/main/index.ts (1 hunks)
  • src/main/presenter/configPresenter/index.ts (8 hunks)
  • src/main/presenter/configPresenter/mcpConfHelper.ts (1 hunks)
  • src/main/presenter/configPresenter/modelConfig.ts (1 hunks)
  • src/main/presenter/configPresenter/modelDefaultSettings.ts (3 hunks)
  • src/main/presenter/configPresenter/providerModelSettings.ts (2 hunks)
  • src/main/presenter/configPresenter/providers.ts (1 hunks)
  • src/main/presenter/filePresenter/CsvFileAdapter.ts (1 hunks)
  • src/main/presenter/filePresenter/FilePresenter.ts (1 hunks)
  • src/main/presenter/githubCopilotDeviceFlow.ts (4 hunks)
  • src/main/presenter/llamaCppPresenter/llama.ts (1 hunks)
  • src/main/presenter/llmProviderPresenter/baseProvider.ts (2 hunks)
  • src/main/presenter/llmProviderPresenter/index.ts (9 hunks)
  • src/main/presenter/llmProviderPresenter/oauthHelper.ts (1 hunks)
  • src/main/presenter/llmProviderPresenter/providers/anthropicProvider.ts (3 hunks)
  • src/main/presenter/llmProviderPresenter/providers/deepseekProvider.ts (2 hunks)
  • src/main/presenter/llmProviderPresenter/providers/geminiProvider.ts (8 hunks)
  • src/main/presenter/llmProviderPresenter/providers/githubCopilotProvider.ts (0 hunks)
  • src/main/presenter/llmProviderPresenter/providers/minimaxProvider.ts (1 hunks)
  • src/main/presenter/llmProviderPresenter/providers/openAICompatibleProvider.ts (2 hunks)
  • src/main/presenter/llmProviderPresenter/providers/openAIResponsesProvider.ts (1 hunks)
  • src/main/presenter/llmProviderPresenter/providers/openRouterProvider.ts (7 hunks)
  • src/main/presenter/llmProviderPresenter/providers/ppioProvider.ts (4 hunks)
  • src/main/presenter/llmProviderPresenter/providers/siliconcloudProvider.ts (1 hunks)
  • src/main/presenter/llmProviderPresenter/providers/togetherProvider.ts (1 hunks)
  • src/main/presenter/mcpPresenter/inMemoryServers/builder.ts (1 hunks)
  • src/main/presenter/mcpPresenter/inMemoryServers/customPromptsServer.ts (1 hunks)
  • src/main/presenter/mcpPresenter/inMemoryServers/filesystem.ts (1 hunks)
  • src/main/presenter/mcpPresenter/inMemoryServers/powerpackServer.ts (11 hunks)
  • src/main/presenter/mcpPresenter/index.ts (2 hunks)
  • src/main/presenter/mcpPresenter/mcpClient.ts (25 hunks)
  • src/main/presenter/mcpPresenter/serverManager.ts (4 hunks)
  • src/main/presenter/notifactionPresenter.ts (1 hunks)
  • src/main/presenter/proxyConfig.ts (1 hunks)
  • src/main/presenter/shortcutPresenter.ts (0 hunks)
  • src/main/presenter/sqlitePresenter/importData.ts (1 hunks)
  • src/main/presenter/syncPresenter/index.ts (13 hunks)
  • src/main/presenter/tabPresenter.ts (1 hunks)
  • src/main/presenter/threadPresenter/contentEnricher.ts (2 hunks)
  • src/main/presenter/threadPresenter/index.ts (1 hunks)
  • src/main/presenter/threadPresenter/messageManager.ts (2 hunks)
  • src/main/presenter/trayPresenter.ts (1 hunks)
  • src/main/presenter/upgradePresenter/index.ts (4 hunks)
  • src/main/presenter/windowPresenter/index.ts (1 hunks)
  • src/renderer/src/assets/style.css (2 hunks)
  • src/renderer/src/components/ModelSelect.vue (3 hunks)
  • src/renderer/src/components/NewThread.vue (3 hunks)
  • src/renderer/src/components/SideBar.vue (2 hunks)
  • src/renderer/src/components/TitleView.vue (2 hunks)
  • src/renderer/src/components/editor/mention/MentionList.vue (4 hunks)
  • src/renderer/src/components/editor/mention/PromptParamsDialog.vue (1 hunks)
  • src/renderer/src/components/editor/mention/suggestion.ts (1 hunks)
  • src/renderer/src/components/mcp-config/mcpServerForm.vue (10 hunks)
  • src/renderer/src/components/settings/AboutUsSettings.vue (1 hunks)
  • src/renderer/src/components/settings/CommonSettings.vue (3 hunks)
  • src/renderer/src/components/settings/ModelConfigDialog.vue (1 hunks)
  • src/renderer/src/components/settings/ModelConfigItem.vue (3 hunks)
  • src/renderer/src/components/settings/ModelProviderSettingsDetail.vue (2 hunks)
  • src/renderer/src/components/settings/PromptSetting.vue (7 hunks)
  • src/renderer/src/components/settings/ProviderApiConfig.vue (3 hunks)
  • src/renderer/src/components/settings/ProviderModelList.vue (4 hunks)
  • src/renderer/src/components/settings/ProviderModelManager.vue (2 hunks)
  • src/renderer/src/components/settings/ShortcutSettings.vue (2 hunks)
  • src/renderer/src/components/ui/UpdateDialog.vue (1 hunks)
  • src/renderer/src/i18n/en-US/contextMenu.json (1 hunks)
  • src/renderer/src/i18n/en-US/settings.json (3 hunks)
  • src/renderer/src/i18n/en-US/update.json (1 hunks)
  • src/renderer/src/i18n/fa-IR/settings.json (3 hunks)
  • src/renderer/src/i18n/fa-IR/update.json (1 hunks)
  • src/renderer/src/i18n/fr-FR/contextMenu.json (1 hunks)
  • src/renderer/src/i18n/fr-FR/index.ts (1 hunks)
  • src/renderer/src/i18n/fr-FR/settings.json (3 hunks)
  • src/renderer/src/i18n/fr-FR/update.json (1 hunks)
  • src/renderer/src/i18n/ja-JP/contextMenu.json (1 hunks)
  • src/renderer/src/i18n/ja-JP/settings.json (3 hunks)
  • src/renderer/src/i18n/ja-JP/update.json (1 hunks)
  • src/renderer/src/i18n/ko-KR/contextMenu.json (1 hunks)
  • src/renderer/src/i18n/ko-KR/settings.json (3 hunks)
  • src/renderer/src/i18n/ko-KR/update.json (1 hunks)
  • src/renderer/src/i18n/ru-RU/settings.json (3 hunks)
  • src/renderer/src/i18n/ru-RU/update.json (1 hunks)
  • src/renderer/src/i18n/zh-CN/contextMenu.json (1 hunks)
  • src/renderer/src/i18n/zh-CN/settings.json (3 hunks)
  • src/renderer/src/i18n/zh-CN/update.json (1 hunks)
⛔ Files not processed due to max files limit (22)
  • src/renderer/src/i18n/zh-HK/settings.json
  • src/renderer/src/i18n/zh-HK/update.json
  • src/renderer/src/i18n/zh-TW/contextMenu.json
  • src/renderer/src/i18n/zh-TW/settings.json
  • src/renderer/src/i18n/zh-TW/update.json
  • src/renderer/src/stores/mcp.ts
  • src/renderer/src/stores/settings.ts
  • src/renderer/src/stores/upgrade.ts
  • src/renderer/src/views/WelcomeView.vue
  • src/shared/i18n.ts
  • src/shared/model.ts
  • src/shared/presenter.d.ts
  • test/README.md
  • test/main/eventbus/eventbus.test.ts
  • test/main/presenter/llmProviderPresenter.test.ts
  • test/main/presenter/mcpClient.test.ts
  • test/main/presenter/modelConfig.test.ts
  • test/renderer/shell/main.test.ts
  • test/setup.renderer.ts
  • test/setup.ts
  • vitest.config.renderer.ts
  • vitest.config.ts
💤 Files with no reviewable changes (5)
  • .cursor/rules/build-deploy.mdc
  • src/main/presenter/llmProviderPresenter/providers/githubCopilotProvider.ts
  • src/main/presenter/shortcutPresenter.ts
  • eslint.config.mjs
  • docs/config-presenter-design.md
🧰 Additional context used
🪛 markdownlint-cli2 (0.17.2)
docs/developer-guide.md

13-13: Link fragments should be valid
null

(MD051, link-fragments)

README.jp.md

268-268: Unordered list style
Expected: dash; Actual: asterisk

(MD004, ul-style)


273-273: Dollar signs used before commands without showing output
null

(MD014, commands-show-output)

docs/mcp-session-recovery.md

7-7: Fenced code blocks should have a language specified
null

(MD040, fenced-code-language)


175-175: Fenced code blocks should have a language specified
null

(MD040, fenced-code-language)


181-181: Fenced code blocks should have a language specified
null

(MD040, fenced-code-language)

🪛 LanguageTool
README.md

[uncategorized] ~272-~272: A comma may be missing after the conjunctive/linking adverb ‘Otherwise’.
Context: ...ttings or use an administrator account. Otherwise pnpm ops will fail. ### Start Develo...

(SENT_START_CONJUNCTIVE_LINKING_ADVERB_COMMA)

docs/mcp-session-recovery.md

[uncategorized] ~158-~158: 动词的修饰一般为‘形容词(副词)+地+动词’。您的意思是否是:新"地"连接
Context: ...用者知道需要重试 5. 重新调用: 上层调用者重新发起请求,此时会建立新的连接和session 6. 持续错误检测: 如果重启后再次出现sessi...

(wb4)

🪛 YAMLlint (1.37.1)
.github/workflows/prcheck.yml

[error] 49-49: no new line character at the end of file

(new-line-at-end-of-file)

🪛 Biome (1.9.4)
src/main/presenter/llmProviderPresenter/providers/minimaxProvider.ts

[error] 6-11: This constructor is unnecessary.

Unsafe fix: Remove the unnecessary constructor.

(lint/complexity/noUselessConstructor)

src/main/presenter/llmProviderPresenter/providers/togetherProvider.ts

[error] 6-8: This constructor is unnecessary.

Unsafe fix: Remove the unnecessary constructor.

(lint/complexity/noUselessConstructor)

🔇 Additional comments (195)
src/main/presenter/llmProviderPresenter/providers/openAIResponsesProvider.ts (1)

568-573: Formatting consistency for usage type
The multi-line type annotation for usage is now properly indented, improving readability without affecting behavior.

src/renderer/src/i18n/ko-KR/contextMenu.json (1)

17-17: Remove trailing space and add newline at EOF.

This change is purely formatting—no content modifications. Ensures consistency across localization files by ending with a newline.

src/renderer/src/assets/style.css (2)

80-82: Approve whitespace cleanup in default :root.

Removed trailing spaces after CSS variable definitions for --usage-low, --usage-mid, and --usage-high. No functional impact, just formatting.


120-122: Approve whitespace cleanup in .dark theme.

Removed trailing spaces after CSS variable definitions for --usage-low, --usage-mid, and --usage-high in the dark theme. Purely formatting change.

src/renderer/src/i18n/zh-CN/contextMenu.json (1)

17-17: Skip formatting-only update
Removed trailing whitespace and added a newline. No changes to JSON keys or values.

src/renderer/src/i18n/fr-FR/contextMenu.json (1)

17-17: Skip formatting-only update
Removed trailing whitespace and added a newline. No changes to JSON keys or values.

src/renderer/src/i18n/en-US/contextMenu.json (1)

17-17: Skip formatting-only update
Removed trailing whitespace and added a newline. No changes to JSON keys or values.

src/main/presenter/llmProviderPresenter/oauthHelper.ts (1)

16-16: Skip formatting-only adjustment
Removed an extra space inside the constructor’s braces. No functional changes introduced.

docs/user-guide.md (1)

141-141: ```shell
#!/bin/bash

Search the entire repository for any exact occurrences of the old MCP expansion

rg -n "Model Controller Platform"

Also perform a case-insensitive search to catch any variations

rg -i -n "Model Controller Platform"


</details>
<details>
<summary>src/main/presenter/filePresenter/CsvFileAdapter.ts (1)</summary>

`23-23`: **Improved CSV row filtering logic.**

The change correctly refines the filtering condition to only exclude rows where all cells are empty, rather than excluding empty arrays. This better handles CSV parsing edge cases where rows might contain empty string cells but still be structurally valid.

</details>
<details>
<summary>src/main/presenter/filePresenter/FilePresenter.ts (1)</summary>

`208-211`: **Clean code improvement by removing unused error parameter.**

The error parameter was not being used in the catch block, so removing it improves code clarity while maintaining the same functionality.

</details>
<details>
<summary>src/renderer/src/i18n/en-US/update.json (1)</summary>

`13-15`: **Well-structured localization additions for update status.**

The new localization keys provide clear, user-friendly messages for update scenarios:
- `"restarting"` for restart status
- `"alreadyUpToDate"` for concise status indication  
- `"alreadyUpToDateDesc"` for detailed explanation

The text is clear and provides good user experience for update status feedback.

</details>
<details>
<summary>src/renderer/src/i18n/ko-KR/update.json (1)</summary>

`14-15`: **LGTM! Korean localization strings are accurate and well-translated.**

The Korean translations are grammatically correct and contextually appropriate for update status messaging. The consistency with similar additions across other localization files demonstrates good internationalization practices.

</details>
<details>
<summary>src/main/presenter/threadPresenter/contentEnricher.ts (2)</summary>

`333-333`: **Good cleanup: Removed unused error parameter.**

The simplified catch block improves code clarity while maintaining the same fallback behavior for URL construction failures.

---

`351-351`: **Good cleanup: Removed unused error parameter.**

Consistent with the previous catch block, this simplification maintains functionality while improving code readability.

</details>
<details>
<summary>docs/developer-guide.md (1)</summary>

`13-13`: **LGTM! Correct terminology update for MCP.**

The change from "Model Controller Platform" to "Model Context Protocol" is accurate and consistent across all references in the documentation.



However, please verify that the table of contents link fragment on line 13 correctly targets the updated heading:

```shell
#!/bin/bash
# Description: Verify the TOC link fragment matches the updated heading
# Expected: The link fragment should match the corrected heading format

# Check if the heading exists and matches the link fragment
rg -A 2 -B 2 "Model Context Protocol.*MCP" docs/developer-guide.md

Also applies to: 61-61, 74-74, 76-76, 88-88, 131-131

src/renderer/src/components/editor/mention/suggestion.ts (1)

32-45: Excellent formatting improvement for complex type annotation.

The multiline format significantly improves readability of the complex function type without changing its functionality. This aligns well with the overall code quality improvements in this release.

.prettierignore (1)

9-23: Well-structured Prettier ignore additions.

The new ignore patterns appropriately exclude:

  • Project directories that shouldn't be formatted (docs, build, resources)
  • Configuration files with specific formatting requirements (tailwind.config.js, electron.vite.config.ts)
  • UI component libraries that should maintain original formatting
  • Environment and container files with their own conventions
  • IDE/tooling directories

These additions align well with the project's tooling standardization and maintain clear formatting boundaries.

.oxlintrc.json (1)

1-17: Configuration looks solid.
The ignorePatterns cover all the major build and tooling directories. No issues detected.

src/renderer/src/i18n/ja-JP/contextMenu.json (1)

1-17: No functional changes.
Only formatting (newline added). Nothing to review here.

src/main/presenter/notifactionPresenter.ts (1)

39-43: Formatting alignment approved.
The multi-line eventBus.sendToRenderer now matches other presenter calls and explicitly uses SendTarget.ALL_WINDOWS.

src/renderer/src/components/settings/AboutUsSettings.vue (1)

190-190: LGTM! API signature update maintains consistency.

The addition of the boolean parameter to upgrade.checkUpdate(false) aligns with the broader API update pattern seen across UI components. The false parameter correctly indicates this is a user-initiated update check rather than a silent background check.

src/renderer/src/components/SideBar.vue (1)

100-100: LGTM! Clear semantic distinction in update check parameters.

The boolean parameters provide logical separation:

  • checkUpdate(false) for user-initiated checks (line 100)
  • checkUpdate(true) for automatic/silent checks (line 121)

This approach maintains consistency with the broader API update and provides clear intent for different update check scenarios.

Also applies to: 121-121

src/main/presenter/llmProviderPresenter/providers/siliconcloudProvider.ts (2)

105-105: LGTM! Header key formatting improvement.

Removing quotes from the Authorization header key improves code readability while maintaining functionality. This is consistent with modern JavaScript/TypeScript style practices.


112-114: LGTM! Error message formatting enhancement.

The multi-line template literal formatting improves readability of the error message without changing the functional behavior. This makes debugging easier when API key checks fail.

src/main/presenter/mcpPresenter/inMemoryServers/customPromptsServer.ts (1)

88-91: LGTM! Indentation improvement enhances readability.

The improved indentation of object properties within the map callback enhances code readability and maintains consistent formatting standards without affecting functionality.

src/main/presenter/trayPresenter.ts (2)

43-43: LGTM! Menu label simplification.

Removing the shortcut hint from the tray menu label improves visual clarity while maintaining functionality. The label remains descriptive with labels.open || '打开/隐藏'.


48-53: LGTM! Well-integrated update check menu item.

The new "检查更新" menu item provides convenient access to update functionality directly from the system tray. The implementation correctly:

  • Uses localized labels with fallback
  • Triggers the appropriate CHECK_FOR_UPDATES event via eventBus
  • Follows the established event-driven architecture pattern

This integrates seamlessly with the broader update check system enhancements.

src/renderer/src/components/editor/mention/PromptParamsDialog.vue (1)

114-116: LGTM! Clean formatting improvements.

The added blank line and parentheses around the arrow function parameter improve code readability and consistency without changing the logic.

src/renderer/src/i18n/fr-FR/update.json (1)

14-15: LGTM! Proper French localization additions.

The new keys provide clear messaging for when the application is already up-to-date. The French translations are grammatically correct and consistent with the existing localization pattern.

src/renderer/src/i18n/fr-FR/index.ts (1)

31-31: LGTM! Improved string readability.

Changing from single quotes with escaping to double quotes makes the disclaimer text much more readable without affecting functionality.

src/main/eventbus.ts (1)

51-51: LGTM! Critical method name fix.

Correcting sendTodefaultTab to sendToDefaultTab fixes the camelCase naming and ensures proper event dispatching to the default tab window.

CONTRIBUTING.zh.md (1)

23-23: LGTM! Consistent package manager migration.

The documentation has been correctly updated to reflect the migration from npm to pnpm across all command examples. The changes are consistent with the PR objective of officially switching package management to pnpm.

Also applies to: 87-88, 93-93, 113-115

src/renderer/src/components/TitleView.vue (2)

77-77: LGTM! Proper import of ModelType enum.

The import statement correctly brings in the ModelType enum from the shared model module, which is needed for the type filtering functionality.


30-33: LGTM! Well-implemented model type filtering.

The addition of the type prop to the ModelSelect component properly restricts the selectable models to Chat and ImageGeneration types, which is appropriate for the title view context. The implementation follows Vue prop syntax correctly and aligns with the broader UI enhancement for model filtering across components.

src/renderer/src/i18n/ja-JP/update.json (1)

14-15: LGTM! Accurate Japanese translations added.

The new localization keys alreadyUpToDate and alreadyUpToDateDesc provide natural and appropriate Japanese translations for the "already up to date" state. The translations are accurate and consistent with the existing localization pattern.

src/renderer/src/i18n/zh-CN/update.json (1)

14-15: LGTM! Accurate Chinese translations added.

The new localization keys provide clear and natural Chinese translations for the "already up to date" state. The translations are appropriate for Chinese users and follow the established localization patterns.

src/renderer/src/i18n/fa-IR/update.json (1)

14-15: LGTM! Persian translations added consistently.

The new localization keys follow the same pattern as other language files and provide appropriate Persian translations for the "already up to date" messaging. The translations appear contextually correct and maintain consistency with the established localization structure.

src/main/presenter/proxyConfig.ts (1)

149-150: Good cleanup: Removed unnecessary escape characters.

The removal of escape characters before forward slashes in the regex pattern is correct. In JavaScript string literals, forward slashes don't need to be escaped, so this change improves readability without affecting functionality.

src/renderer/src/components/settings/ModelProviderSettingsDetail.vue (2)

41-41: Good reactive event handling.

Adding the config-changed event listener ensures the component stays synchronized with configuration changes from the model manager.


348-352: Clean implementation of config change handler.

The handler properly reinitializes data when configuration changes occur. The async/await pattern is correctly used with the existing initData() function.

src/main/presenter/mcpPresenter/inMemoryServers/filesystem.ts (1)

178-178: Acceptable removal of unused error parameter.

The error parameter removal is appropriate here since the catch block is specifically handling the expected case where fs.realpath() fails for new files that don't exist yet, and the error details aren't needed for the fallback logic.

src/main/presenter/llmProviderPresenter/providers/anthropicProvider.ts (3)

240-242: Good formatting improvement.

The improved indentation enhances readability of the chained method calls for filtering and mapping text content.


316-322: Consistent formatting for object literal.

The improved indentation makes the image source object structure more readable and maintains consistency with the similar code block later in the file.


392-399: Consistent formatting applied.

The formatting improvement matches the style used in the earlier similar code block, maintaining consistency throughout the file.

src/renderer/src/i18n/ru-RU/update.json (1)

14-15: LGTM!

The Russian translations for the update status messages are properly formatted and follow the existing naming conventions. The content is appropriate for indicating that the application is already up to date.

src/main/presenter/windowPresenter/index.ts (1)

916-916: LGTM!

Good fix for the camelCase naming convention. The method name sendToDefaultTab is now properly formatted and consistent with standard naming practices.

Verify that all call sites have been updated to use the corrected method name:

#!/bin/bash
# Description: Search for any remaining calls to the old method name
# Expected: Should only find the new corrected method name

rg "sendTodefaultTab" --type ts --type js
rg "sendToDefaultTab" --type ts --type js -A 2
src/main/presenter/mcpPresenter/inMemoryServers/builder.ts (1)

34-34: LGTM!

The addition of the env parameter to the PowerpackServer constructor is consistent with other in-memory servers and enables E2B sandbox integration. This follows the established pattern used by other servers in the switch statement.

src/renderer/src/components/settings/PromptSetting.vue (2)

183-470: LGTM!

The formatting improvements enhance code readability and consistency. The changes include proper indentation, line breaks, and template expression formatting while maintaining the same functionality.


1005-1005: Good syntax improvement.

Adding parentheses around the forEach callback parameter improves code consistency and follows JavaScript/TypeScript best practices.

src/main/presenter/threadPresenter/index.ts (1)

1969-1969: LGTM: Improved naming for function call record key.

The renaming from function_call_result to function_call_record improves clarity and aligns with the enhanced tool call record handling mentioned in the AI summary.

Please verify that this key name change is consistent across the codebase:

#!/bin/bash
# Description: Check for any remaining usage of the old key name and verify consistency of the new key name.

# Search for any remaining usage of the old key name
echo "Searching for old key name 'function_call_result':"
rg "function_call_result" --type ts --type js

echo -e "\nSearching for new key name 'function_call_record':"
rg "function_call_record" --type ts --type js
src/main/presenter/threadPresenter/messageManager.ts (2)

99-104: LGTM: Improved code formatting for better readability.

The multi-line formatting of the eventBus.sendToRenderer call improves code readability without changing functionality.


286-286: LGTM: Removed unused exception variable.

Good practice to remove the unused exception variable in the catch clause, which helps avoid linting warnings and keeps the code clean.

src/renderer/src/components/ui/UpdateDialog.vue (4)

5-5: LGTM: Dynamic dialog title improves user experience.

The conditional title based on upgrade.hasUpdate provides clear context to users about whether an update is available or if they're already up to date.


8-28: LGTM: Conditional content rendering enhances dialog functionality.

The conditional rendering properly displays:

  • Update details (version, release date, notes, download progress) when an update is available
  • "Already up to date" message when no update is found and not in silent mode

The download progress display with formatted size and speed information provides good user feedback during updates.


33-34: LGTM: Dynamic button labeling improves user interaction.

The button label appropriately changes between "Later" and "Close" based on update availability, providing clearer context for the user action.


38-38: LGTM: Conditional install button display.

The install button properly shows only when upgrade.isReadyToInstall is true, preventing premature installation attempts.

README.md (2)

266-267: LGTM! Package manager migration to pnpm.

The commands have been correctly updated to use pnpm instead of npm, including the new installRuntime script. This aligns with the broader project migration to pnpm.


277-277: LGTM! Build commands updated for pnpm.

All development and build commands have been correctly updated to use pnpm across all platforms and architectures.

Also applies to: 284-284, 287-287, 290-299

src/main/presenter/configPresenter/mcpConfHelper.ts (1)

251-255: LGTM! Improved event communication with explicit targeting.

The change from eventBus.emit to eventBus.send with SendTarget.ALL_WINDOWS improves the reliability and clarity of event propagation to all renderer windows. This aligns with the broader refactoring of the event system mentioned in the AI summary.

src/main/presenter/llmProviderPresenter/providers/deepseekProvider.ts (1)

80-81: LGTM! Code formatting improvements enhance readability.

These formatting changes improve code consistency and readability:

  • Header keys use unquoted identifiers (more common TypeScript style)
  • Error message uses multi-line template string for better readability
  • Balance info selection uses explicit parentheses and line breaks for clarity

No functional changes were introduced.

Also applies to: 87-89, 99-102

README.jp.md (3)

262-263: LGTM! Dependency commands updated to pnpm.

The Japanese documentation correctly updates the dependency installation commands to use pnpm, maintaining consistency with the English version.


268-269: LGTM! Windows Developer Mode note added.

The Japanese translation of the Windows-specific pnpm requirements is clear and helpful for Japanese users.


273-273: LGTM! Build commands updated across all platforms.

All development and build commands have been correctly updated to use pnpm across all platforms and architectures in the Japanese documentation.

Also applies to: 280-280, 283-283, 286-286, 289-294

CONTRIBUTING.md (4)

23-23: LGTM! Development start command updated to pnpm.

The basic functionality check instruction correctly uses pnpm run dev instead of npm.


87-88: LGTM! Dependency installation commands updated.

The installation instructions correctly use pnpm install and include the new pnpm run installRuntime command, maintaining consistency with other documentation.


93-93: LGTM! Development server command updated.

The development startup command correctly uses pnpm run dev.


113-115: LGTM! Code style verification commands updated.

All code quality commands (lint, build, i18n) have been correctly updated to use pnpm, ensuring contributors follow the proper development workflow.

src/renderer/src/components/settings/ProviderModelManager.vue (3)

39-39: LGTM: Provider ID prop addition enables provider-aware configuration.

The addition of the provider-id prop to ModelConfigItem correctly enables tracking configuration changes at the provider level, which aligns with the enhanced model configuration management described in the PR objectives.


47-47: LGTM: Configuration change event propagation implemented correctly.

The config-changed event emission from ModelConfigItem follows Vue's event bubbling pattern and enables parent components to react to configuration updates.


74-74: LGTM: Event definition properly declared.

The config-changed event is correctly added to the component's emit definitions, maintaining type safety in the component interface.

src/renderer/src/components/settings/ProviderModelList.vue (3)

14-14: LGTM: Consistent provider-aware configuration for custom models.

The addition of provider-id prop and config-changed event emission for custom models correctly implements the provider-aware configuration pattern.

Also applies to: 23-23


111-111: LGTM: Consistent provider-aware configuration for provider models.

The same pattern is correctly applied to provider models, ensuring uniform configuration management across both custom and official model sections.

Also applies to: 118-118


163-163: LGTM: Event definition maintains component interface consistency.

The config-changed event is properly declared in the emit definitions, maintaining the same pattern as other components in this configuration management system.

.cursor/rules/development-setup.mdc (3)

4-4: LGTM: Configuration flag properly set.

The alwaysApply: true flag ensures these development rules are consistently applied across the project.


7-11: LGTM: Simplified prerequisites align with project modernization.

The concise list of prerequisites (OxLint, pnpm, English for logs/comments, Node.js >= 22, pnpm >= 9) reflects the project's migration to modern tooling as outlined in the PR objectives.


13-26: LGTM: Standardized pnpm commands streamline development workflow.

The migration from npm to pnpm commands across all development tasks (install, lint, format, dev, build) is consistent with the project-wide package manager standardization mentioned in the PR summary.

README.zh.md (3)

262-263: LGTM: Installation commands updated for pnpm migration.

The migration from npm install to pnpm install and addition of pnpm run installRuntime aligns with the project's standardization on pnpm as the package manager.


268-268: LGTM: Important Windows-specific guidance for pnpm.

The note about enabling Developer Mode or using administrator accounts for Windows users is crucial for pnpm's symbolic link functionality. This prevents common installation failures on Windows systems.


273-273: LGTM: Consistent pnpm command migration across all development tasks.

All development and build commands have been correctly updated from npm to pnpm, maintaining consistency with the project's package manager standardization.

Also applies to: 280-294

src/main/presenter/upgradePresenter/index.ts (2)

94-96: LGTM: Improved code formatting for event payload objects.

The conversion from single-line to multi-line object literals improves code readability and maintainability without affecting functionality. This formatting style is more consistent with the project's coding standards.

Also applies to: 241-243, 306-308


327-332: LGTM: Consistent multi-line formatting for return object.

The return object formatting matches the style applied to event payloads throughout the file, creating visual consistency and improving readability.

src/main/presenter/githubCopilotDeviceFlow.ts (4)

49-50: Improved error handling with logging.

Good addition of error logging before throwing a generic error. This will help with debugging while maintaining a clean error interface for callers.


270-272: Better error handling clarity.

Replacing the empty catch block with an explicit // ignore comment improves code readability and makes it clear that errors are intentionally being suppressed.


308-311: Good addition of polling safety limit.

The polling count limit prevents potential infinite loops and provides a clear failure path. This is a solid improvement for robustness.


387-389: Consistent error handling approach.

Same improvement as the earlier catch block - explicit ignore comment for clarity.

src/renderer/src/components/settings/ShortcutSettings.vue (2)

61-70: Simplified rendering with enhanced styling.

The change from template v-for to direct span rendering is cleaner and the conditional styling for the '0' key (font-mono tracking-widest) will improve visual distinction. The index-based keys are appropriate here since the array is stable.


160-163: New shortcut functionality added.

The ShowHideWindow shortcut mapping follows the established pattern and uses an appropriate icon. This enhances the application's keyboard accessibility.

src/renderer/src/components/ModelSelect.vue (2)

63-68: Well-designed optional prop with proper typing.

The type prop is properly typed with PropType<ModelType[]> and defaults to undefined for backward compatibility. The explicit default comment adds clarity.


111-116: Robust filtering implementation.

The conditional filtering logic properly handles both the presence/absence of the type prop and empty arrays. The type checking with model.type !== undefined prevents runtime errors.

src/renderer/src/components/settings/CommonSettings.vue (2)

80-83: Appropriate model type restriction.

Limiting the model selection to Chat and ImageGeneration types makes sense for a search assistant model configuration. This prevents users from selecting inappropriate model types.


489-489: Minor regex improvement.

Removing the unnecessary escape character before the forward slash in the URL pattern is a small but correct cleanup.

src/main/presenter/mcpPresenter/index.ts (2)

224-227: Improved error logging readability.

The multi-line error logging format is more readable and consistent with other error logging patterns in the codebase.


384-384: Consistent event emission pattern.

Using eventBus.send with explicit SendTarget.ALL_WINDOWS targeting aligns with the event dispatching pattern used elsewhere in the codebase and provides better control over event propagation.

src/main/events.ts (2)

27-30: LGTM! Well-structured event constants for model configuration.

The new model configuration events follow the established naming convention and provide comprehensive coverage for configuration changes, resets, and batch imports. These align well with the centralized model configuration management mentioned in the PR objectives.


158-158: Good addition for tray-based update functionality.

The new CHECK_FOR_UPDATES event enables user-initiated update checks from the system tray, which enhances the user experience by providing easy access to update functionality.

.github/workflows/prcheck.yml (3)

23-28: Excellent migration to pnpm with proper version pinning.

The migration from npm to pnpm is well-executed with specific version pinning for both Node.js (22.13.1) and pnpm (10.12.1), which ensures consistent builds across environments.


33-40: Good platform-specific configuration handling.

The approach to configure pnpm workspace for different platforms and architectures is well-structured, with proper environment variable usage for TARGET_OS and TARGET_ARCH.


42-43: Great addition of lint checking.

Adding the lint step to the PR check workflow will help maintain code quality and catch issues early in the development process.

src/main/presenter/tabPresenter.ts (2)

39-50: Excellent refactoring with centralized bounds update logic.

The new onWindowSizeChange method effectively centralizes the logic for updating tab view bounds when window dimensions change. This improves maintainability and reduces code duplication.


57-66: Smart timing approach for window state changes.

The 100ms delay using setTimeout for maximize/unmaximize events is a good practice that ensures the window state has fully settled before updating tab view bounds, preventing potential timing issues.

src/renderer/src/components/settings/ProviderApiConfig.vue (1)

7-15: Great formatting improvements for better readability.

The multi-line formatting of Vue component attributes significantly improves code readability and maintainability. These changes follow Vue.js best practices for template organization without altering any functionality.

Also applies to: 17-24, 35-40, 45-53, 55-64, 65-75, 77-82, 89-92, 180-183

src/renderer/src/i18n/ru-RU/settings.json (3)

104-160: Comprehensive model configuration localization.

The extensive Russian localization for model configuration features is well-structured and comprehensive. It covers all aspects including labels, descriptions, validation messages, and dialog confirmations, properly supporting the new model configuration management features.


381-386: Good localization support for E2B sandbox integration.

The Russian translations for the E2B sandbox feature are complete and informative, providing clear descriptions and help text for users. The validation message for required API key is appropriately included.


460-460: Appropriate shortcut localization addition.

The Russian translation for the "showHideWindow" shortcut is correctly added and aligns with the new shortcut functionality mentioned in the PR objectives.

src/renderer/src/components/NewThread.vue (2)

61-64: LGTM: Model type filtering implementation

The addition of the type prop to restrict model selection to Chat and ImageGeneration models is a good enhancement that aligns with the broader model filtering improvements across the application.


120-120: LGTM: ModelType import

The import of ModelType enum is correctly added to support the new model type filtering functionality.

src/main/presenter/llmProviderPresenter/providers/openAICompatibleProvider.ts (2)

53-53: LGTM: Improved provider extensibility

Changing isNoModelsApi from private to protected allows subclasses to access this property, enhancing the extensibility of the OpenAI-compatible provider pattern. This aligns well with the introduction of new providers like MinimaxProvider and TogetherProvider.


1117-1121: LGTM: Enhanced function call ID generation

The improved fallback ID generation logic creates more descriptive and unique IDs by incorporating the function name, index, and timestamp. This enhancement will significantly improve debugging and identification of function calls when parsedCall.id is missing.

The format ${functionName}-${index}-${Date.now()} provides:

  • Function context for easier debugging
  • Index for ordering within the same response
  • Timestamp for global uniqueness
src/renderer/src/components/settings/ModelConfigItem.vue (3)

42-50: LGTM: Well-implemented configuration button

The "Configure Model" button is properly implemented with:

  • Consistent styling matching other action buttons
  • Accessible title attribute using internationalization
  • Clear visual representation with settings icon

63-70: LGTM: Clean dialog integration

The ModelConfigDialog integration follows Vue 3 best practices with:

  • Proper v-model binding for open state
  • All necessary props passed down
  • Event handling for configuration changes

84-84: LGTM: Proper prop and event handling

The addition of providerId prop and configChanged event provides the necessary interface for parent components to:

  • Pass provider context to the configuration dialog
  • React to configuration updates by refreshing data

The event emission in onConfigSaved ensures parent components can stay synchronized with configuration changes.

Also applies to: 101-101, 104-114

.github/workflows/build.yml (4)

35-35: LGTM: Consistent Node.js version pinning

Pinning Node.js to version 22.13.1 across all platforms ensures consistent build environments and reduces potential version-related issues.

Also applies to: 92-92, 146-146


37-40: LGTM: Proper pnpm setup

The pnpm setup with version 10.12.1 is correctly configured across all platforms, ensuring consistent package management behavior.

Also applies to: 94-97, 148-151


45-50: LGTM: Platform-specific sharp configuration

The platform-specific sharp installation configuration is well-designed:

  • Uses environment variables to specify target OS and architecture
  • Handles native dependency compilation correctly
  • Maintains separation of concerns between workspace configuration and dependency installation

Also applies to: 102-107, 156-161


180-180: LGTM: macOS memory optimization

Adding NODE_OPTIONS: '--max-old-space-size=4096' for macOS builds is a good practice to prevent out-of-memory errors during the build process, especially for resource-intensive operations.

scripts/install-sharp-for-platform.js (1)

1-96: LGTM! Well-structured platform configuration script.

The script is well-implemented with:

  • Proper environment variable handling with fallbacks
  • Comprehensive platform support
  • Good error handling and user feedback
  • Atomic file operations with proper YAML formatting

The approach of dynamically updating the workspace configuration based on target platform is sound and integrates well with the pnpm migration.

src/main/presenter/configPresenter/providerModelSettings.ts (2)

106-174: LGTM! Comprehensive Gemini model configuration updates.

The updates to Gemini models are well-structured:

  • Model IDs and names are properly updated to reflect new versions
  • Context lengths and token limits are reasonable for the respective models
  • The addition of reasoning capabilities for newer models is appropriate
  • The new ImageGeneration model type for gemini-2.0-flash-preview-image-generation is properly configured

The parameter values (context lengths up to 1M+ tokens, reasoning enabled for 2.x models) align with Google's documented Gemini capabilities.


460-470: LGTM! Proper addition of Minimax M1 80K model.

The new PPIO model configuration is correctly implemented:

  • Reasonable parameters for a high-context model (128K context, 40K max tokens)
  • Appropriate capabilities (function calls and reasoning enabled)
  • Proper match pattern for model ID resolution
src/main/presenter/syncPresenter/index.ts (4)

28-28: LGTM! Proper constant definition for model config path.

The addition of MODEL_CONFIG_PATH follows the established pattern and uses the correct file location in userData directory.


167-171: LGTM! Complete model config backup and restore implementation.

The model config file handling is properly integrated:

  • Backup creation during import (lines 167-171)
  • Restore from backup during import (lines 226-230)
  • Rollback on failure (lines 256-260)

The implementation follows the same patterns as other config files and includes proper error handling.

Also applies to: 226-230, 256-260


331-341: LGTM! Comprehensive backup process integration.

The model config file is properly integrated into the backup process:

  • Temporary backup file creation with timestamp
  • Atomic file replacement to prevent corruption
  • Proper cleanup of old backup files before creating new ones

The implementation is consistent with other config files and maintains data integrity.

Also applies to: 381-439


285-288: LGTM! Proper cleanup of temporary model config files.

The temporary file cleanup includes the model config file, ensuring no orphaned temporary files remain after import operations.

src/renderer/src/i18n/en-US/settings.json (3)

104-160: LGTM! Comprehensive model configuration localization.

The new modelConfig section provides excellent UI localization:

  • Clear labels and descriptions for all model parameters
  • Comprehensive validation messages with specific limits
  • User-friendly confirmation dialogs for destructive actions
  • Proper categorization of model types

The text is clear, professional, and provides sufficient guidance for users configuring model parameters.


389-394: LGTM! Complete E2B sandbox localization.

The E2B integration strings are well-structured:

  • Clear feature description and purpose
  • Helpful placeholder text and guidance
  • Proper validation messaging
  • Link to documentation for API key acquisition

460-460: LGTM! Appropriate shortcut key description.

The new showHideWindow shortcut description is clear and follows the established pattern for other shortcut descriptions.

src/renderer/src/i18n/ja-JP/settings.json (3)

104-160: LGTM! Complete Japanese model configuration localization.

The Japanese translation of the modelConfig section maintains the same comprehensive structure as the English version:

  • All model parameter labels and descriptions are translated
  • Validation messages with proper numeric limits
  • Confirmation dialogs and button text
  • Model type options properly localized

The structure is consistent and complete.


381-386: LGTM! Complete E2B sandbox Japanese localization.

The E2B feature localization is properly translated:

  • Feature descriptions and help text
  • API key field labels and placeholders
  • Validation requirements
  • External documentation references

460-460: LGTM! Consistent shortcut key translation.

The Japanese translation of the showHideWindow shortcut description is appropriately localized and consistent with the pattern.

src/renderer/src/components/settings/ModelConfigDialog.vue (2)

1-151: LGTM! Well-structured Vue component with comprehensive model configuration UI.

The component follows Vue best practices with proper reactive data management, form validation, and internationalization. The template structure is clean and accessible with proper semantic HTML.


268-268: Let’s search the entire repo (without relying on unsupported --type vue) for both the hard-coded 100_000_000 limit and all contextLength references:

#!/bin/bash
# Search for the magic number across .vue and .ts files
rg -g "*.vue" -g "*.ts" -n "100_000_000" -A3 -B3

# Search for all contextLength usage to see if defaults or other limits exist
rg -g "*.vue" -g "*.ts" -n "contextLength" -A3 -B3
src/main/presenter/mcpPresenter/serverManager.ts (4)

20-20: Good addition of uvRegistry property.

The new private property follows the existing pattern and naming conventions in the class.


85-91: Conditional uvRegistry assignment is well-implemented.

The logic correctly sets the Tsinghua mirror URL when using the npmmirror registry, providing a Chinese-specific UV registry for improved performance in that region.


100-104: Clean getter implementation.

The getter method follows the same pattern as the existing getNpmRegistry() method and maintains consistency.


183-188: Verify McpClient constructor signature change.

The code passes uvRegistry as a fourth parameter to the McpClient constructor. Ensure that the McpClient class has been updated to accept this parameter.

#!/bin/bash
# Check McpClient constructor to verify it accepts the uvRegistry parameter
ast-grep --pattern $'class McpClient {
  $$$
  constructor($_, $_, $_, $_) {
    $$$
  }
  $$$
}'
src/renderer/src/i18n/zh-CN/settings.json (3)

104-160: Comprehensive and well-structured model configuration translations.

The Chinese translations for the model configuration section are thorough, covering all UI elements, validation messages, and user interactions. The translation quality appears accurate and user-friendly.


387-394: Clear E2B sandbox translations with helpful guidance.

The E2B sandbox translations provide clear descriptions and helpful guidance for users, including proper placeholders and validation messages.


460-460: Appropriate shortcut translation.

The "显示/隐藏窗口" translation for the showHideWindow shortcut is clear and concise.

src/renderer/src/i18n/ko-KR/settings.json (3)

104-160: Well-translated Korean model configuration section.

The Korean translations maintain the same structure as the Chinese version and provide clear, user-friendly text for all model configuration elements.


380-387: Clear Korean E2B sandbox translations.

The E2B sandbox feature translations are well-localized with appropriate Korean terminology and helpful user guidance.


460-460: Appropriate Korean shortcut translation.

The "창을 표시/숨기기" translation correctly conveys the show/hide window functionality.

src/renderer/src/i18n/fa-IR/settings.json (3)

104-160: Comprehensive Persian model configuration translations.

The Persian translations provide complete coverage of the model configuration interface with appropriate terminology. The structure matches other language files for consistency.


388-395: Well-localized Persian E2B sandbox translations.

The E2B sandbox feature translations use appropriate Persian terminology and provide clear user guidance for the sandbox functionality.


460-460: Appropriate Persian shortcut translation.

The "نمایش/مخفی کردن پنجره" translation accurately represents the show/hide window functionality in Persian.

src/renderer/src/i18n/fr-FR/settings.json (3)

104-160: LGTM! Comprehensive French translations for model configuration.

The new modelConfig section provides thorough French localization for the model configuration interface, including all necessary UI elements, validation messages, and descriptions. The translations are consistent and appropriately localized.


381-386: LGTM! E2B sandbox localization is complete.

The French translations for E2B sandbox functionality are well-structured and provide clear guidance for users, including proper help text and validation messages.


460-460: LGTM! New shortcut translation added.

The translation for the new "showHideWindow" shortcut is appropriate and consistent with other shortcut translations.

src/main/presenter/llmProviderPresenter/providers/minimaxProvider.ts (2)

11-36: LGTM! Model metadata definition is comprehensive.

The hardcoded model metadata provides appropriate default configurations for MiniMax models with consistent parameter values.


38-84: LGTM! Method implementations are clean and consistent.

All three methods properly delegate to the shared openAICompletion function with appropriate message formatting.

src/main/presenter/llmProviderPresenter/providers/togetherProvider.ts (2)

65-82: Verify fixed model parameters for accuracy.

The implementation uses fixed contextLength: 4096 and maxTokens: 2048 for all Together AI models, which may not accurately represent the actual capabilities of different models.

Consider using the actual model specifications from the Together AI API response if available, or verify these values are appropriate defaults for all Together AI models.


56-63: LGTM! Dynamic model fetching implementation is well-structured.

The dynamic model fetching using the Together SDK with appropriate filtering for chat/language models is a good approach.

src/main/presenter/configPresenter/modelConfig.ts (5)

9-16: LGTM! Clean initialization with appropriate store naming.

The constructor properly initializes the electron-store with a descriptive name for model configurations.


24-67: LGTM! Excellent priority-based configuration resolution.

The getModelConfig method implements a logical priority system:

  1. User-defined config (highest priority)
  2. Provider-specific defaults
  3. Pattern-matched defaults
  4. Safe fallback (lowest priority)

This approach provides flexibility while ensuring the system always has valid configuration.


75-81: LGTM! Clean configuration persistence.

The setModelConfig method properly stores configurations with a clear key structure using the special concatenation character.


138-150: LGTM! Robust import functionality with overwrite control.

The import method provides both incremental and overwrite modes, which is essential for synchronization and backup restoration scenarios.


105-120: LGTM! Efficient provider-specific configuration retrieval.

The method efficiently filters configurations by provider using the concatenation character as a delimiter.

src/main/presenter/configPresenter/modelDefaultSettings.ts (5)

340-382: LGTM! Gemini model standardization is well-executed.

The updates to Gemini models provide consistent naming, standardized context lengths (1M tokens), increased max tokens (65536), and proper reasoning flags. The model ID updates align with Google's API patterns.


395-408: LGTM! Explicit model type for image generation.

The addition of type: ModelType.ImageGeneration for the Gemini 2.0 Flash Preview Image Generation model properly categorizes this specialized model.


1345-1355: LGTM! New MiniMax model configuration is comprehensive.

The new MiniMax M1 80K model entry includes appropriate parameters with function call and reasoning support enabled.


1672-1684: LGTM! Embedding model type specification is correct.

The addition of explicit ModelType.Embedding for embedding models properly categorizes these specialized models for UI filtering and functionality.


343-356: Verify the large context lengths are accurate.

Several Gemini models specify very large context lengths (1,048,576 tokens). Please verify these values match the actual model capabilities from Google's documentation.

What are the actual context length limits for Gemini 2.5 Pro, Gemini 2.5 Flash, and Gemini 2.0 Flash models according to Google's latest documentation?
src/main/presenter/llmProviderPresenter/providers/ppioProvider.ts (2)

10-23: LGTM! Well-structured interface for PPIO API response.

The interface properly defines all necessary fields for model metadata with appropriate types.


89-89: ```shell
#!/bin/bash

Inspect the ppioProvider implementation around the authorization header

FILE=src/main/presenter/llmProviderPresenter/providers/ppioProvider.ts
if [ -f "$FILE" ]; then
echo "Inspecting $FILE (lines 80–100):"
sed -n '80,100p' "$FILE"
else
echo "File not found: $FILE"
fi


</details>
<details>
<summary>package.json (3)</summary>

`1-12`: **Version update and package manager migration look good.**

The migration to pnpm with proper version constraints and package manager locking is well implemented. Node.js 20.12.2+ requirement ensures compatibility with modern features.

---

`13-54`: **Script updates are well-structured for pnpm migration.**

The consistent replacement of npm with pnpm, addition of Vitest testing commands, and runtime management improvements are all properly implemented.

---

`56-90`: **New dependencies align with PR objectives.**

The addition of @e2b/code-interpreter for sandbox support and together-ai for the new provider are appropriate. The minor version updates for existing packages look safe.

</details>
<details>
<summary>src/main/presenter/llmProviderPresenter/baseProvider.ts (2)</summary>

`243-244`: **Excellent security enhancement for tool call handling.**

The explicit rules preventing exposure of function_call XML tags and structures help prevent potential prompt injection or information leakage attacks.

---

`257-337`: **Clear improvements to tool call documentation and constraints.**

The reorganized constraints with clearer explanations about external system insertion of tool records, response format flexibility (JSON or string), and explicit language handling improve the robustness of the prompt system.

</details>
<details>
<summary>src/main/presenter/llmProviderPresenter/index.ts (3)</summary>

`29-36`: **New provider integrations look good.**

The MinimaxProvider and TogetherProvider are properly imported and integrated into the provider creation logic following the established pattern.



Also applies to: 95-97, 146-147

---

`200-209`: **Robust error handling for provider initialization.**

The sequential initialization with try-catch blocks ensures that a single provider failure doesn't prevent other providers from initializing. Good defensive programming.

---

`1031-1042`: **Good defensive programming with fallback mechanism.**

The try-catch with fallback to configPresenter ensures that custom models can still be retrieved even if the provider instance isn't properly initialized. The warning log provides useful debugging information.

</details>
<details>
<summary>src/main/presenter/llmProviderPresenter/providers/openRouterProvider.ts (2)</summary>

`21-52`: **Well-structured interface definition**

The `OpenRouterModelResponse` interface comprehensively captures the OpenRouter API response structure with proper typing and optional field markers.

---

`117-119`: **Clean formatting improvements**

The formatting changes improve code readability and error message clarity.



Also applies to: 124-127, 141-141, 146-146

</details>
<details>
<summary>src/renderer/src/components/mcp-config/mcpServerForm.vue (5)</summary>

`66-69`: **Proper E2B state management and validation**

The E2B configuration state is correctly initialized and validated, ensuring the API key is required when E2B is enabled.



Also applies to: 283-288

---

`833-834`: **Enhanced model type filtering**

Supporting multiple model types in the selection component improves flexibility and aligns with the new model categorization system.

---

`462-470`: **Secure E2B configuration handling**

The E2B configuration is properly injected into environment variables with appropriate conditional logic for the API key.

---

`596-602`: **Robust E2B configuration parsing**

The configuration parsing correctly handles type conversion and is properly scoped to the powerpack server.

---

`967-970`: **Secure API key handling in UI**

Good security practice using password input type for the E2B API key field.

</details>
<details>
<summary>src/main/presenter/configPresenter/index.ts (4)</summary>

`172-181`: **Correct data migration for minimax provider**

The migration properly fixes the minimax baseUrl for older versions and uses proper version comparison.

---

`322-332`: **Efficient batch model status retrieval**

The batch retrieval method improves performance by reducing multiple store operations to a single batch operation.

---

`428-434`: **Performance improvement in getAllEnabledModels**

Excellent use of batch retrieval to optimize the filtering of enabled models.

---

`839-849`: **Clean delegation pattern with proper event handling**

The model configuration methods correctly delegate to the helper class and emit appropriate events to keep all windows synchronized.



Also applies to: 856-865, 903-906

</details>
<details>
<summary>src/main/presenter/mcpPresenter/inMemoryServers/powerpackServer.ts (5)</summary>

`120-132`: **Robust E2B configuration validation**

The configuration parsing correctly validates the API key presence and provides appropriate warnings when misconfigured.

---

`134-176`: **Comprehensive runtime detection**

The unified runtime setup correctly handles platform-specific paths and provides clear logging about available runtimes.

---

`286-344`: **Secure E2B sandbox execution with proper cleanup**

The E2B execution implementation correctly handles sandbox lifecycle with guaranteed cleanup in the finally block, preventing resource leaks.

---

`370-410`: **Clear separation of execution modes**

The tool exposure logic properly separates E2B and local execution modes, preventing mixing of execution environments.

---

`506-508`: **Proper enforcement of E2B-exclusive execution**

Good security practice disabling local code execution when E2B is enabled, ensuring consistent sandbox isolation.



Also applies to: 534-536

</details>
<details>
<summary>src/main/presenter/llmProviderPresenter/providers/geminiProvider.ts (4)</summary>

`51-137`: **Comprehensive static model list with latest Gemini models**

The updated model list includes all current Gemini models with accurate capabilities and proper typing for the image generation model.

---

`309-350`: **Well-designed auto-enable logic respecting user preferences**

The implementation correctly auto-enables only recommended models while respecting any existing manual configurations or custom models.

---

`444-449`: **Improved model type detection**

Good refactoring to use dynamic model type detection instead of hardcoded model IDs, improving maintainability.



Also applies to: 873-873

---

`188-200`: **Consider maintaining capability detection heuristics**

The capability detection relies on model name patterns which may become outdated as new models are released. Consider implementing a more maintainable approach or documenting these heuristics for regular updates.


```web
What are the latest Gemini model capabilities and naming patterns?
src/main/presenter/mcpPresenter/mcpClient.ts (4)

6-6: LGTM! Event dispatching pattern update.

The change from eventBus.emit to eventBus.send with SendTarget is consistent with the broader refactoring across MCP-related modules.


47-84: Well-designed session error detection mechanism.

The session error detection logic is comprehensive with appropriate pattern matching for both session-specific and HTTP-related errors. The distinction between high and low confidence patterns is a good approach.


227-237: Correct implementation of UV registry support.

The UV registry handling properly adds the --index parameter when a registry is configured, maintaining compatibility with UV's command-line interface.


278-337: Comprehensive runtime detection logic.

The runtime path initialization properly checks for executable existence across different platforms and gracefully handles missing runtimes.

Comment on lines +93 to +104
// 托盘 检测更新
eventBus.on(TRAY_EVENTS.CHECK_FOR_UPDATES, () => {
const allWindows = presenter.windowPresenter.getAllWindows()

// 查找目标窗口 (焦点窗口或第一个窗口)
const targetWindow = presenter.windowPresenter.getFocusedWindow() || allWindows![0]
presenter.windowPresenter.show(targetWindow.id)
targetWindow.focus() // 确保窗口置顶

// 触发更新
presenter.upgradePresenter.checkUpdate()
})
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Good implementation, but fix potential null reference issue.

The event listener logic correctly handles window management and update checking. However, there's a potential issue on line 98.

Apply this diff to fix the potential null reference:

-    const targetWindow = presenter.windowPresenter.getFocusedWindow() || allWindows![0]
+    const targetWindow = presenter.windowPresenter.getFocusedWindow() || allWindows[0]

The non-null assertion operator (!) is unnecessary and could cause runtime errors if getAllWindows() returns null or undefined.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
// 托盘 检测更新
eventBus.on(TRAY_EVENTS.CHECK_FOR_UPDATES, () => {
const allWindows = presenter.windowPresenter.getAllWindows()
// 查找目标窗口 (焦点窗口或第一个窗口)
const targetWindow = presenter.windowPresenter.getFocusedWindow() || allWindows![0]
presenter.windowPresenter.show(targetWindow.id)
targetWindow.focus() // 确保窗口置顶
// 触发更新
presenter.upgradePresenter.checkUpdate()
})
// 托盘 检测更新
eventBus.on(TRAY_EVENTS.CHECK_FOR_UPDATES, () => {
const allWindows = presenter.windowPresenter.getAllWindows()
// 查找目标窗口 (焦点窗口或第一个窗口)
const targetWindow = presenter.windowPresenter.getFocusedWindow() || allWindows[0]
presenter.windowPresenter.show(targetWindow.id)
targetWindow.focus() // 确保窗口置顶
// 触发更新
presenter.upgradePresenter.checkUpdate()
})
🤖 Prompt for AI Agents
In src/main/index.ts around lines 93 to 104, remove the non-null assertion
operator (!) after getAllWindows() on line 98 to avoid potential runtime errors
if getAllWindows() returns null or undefined. Instead, add a check to ensure
allWindows is not null or undefined before accessing its first element, and
handle the case where no windows are available to prevent null reference
exceptions.

Comment on lines +102 to +104
} catch {
// 事务会自动回滚,直接抛出错误
throw error
throw new Error('Failed to import data')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Consider preserving original error information.

The change removes the original error details by throwing a generic error message instead of re-throwing the caught error. This obscures valuable debugging information.

Consider preserving the original error context:

-    } catch {
-      // 事务会自动回滚,直接抛出错误
-      throw new Error('Failed to import data')
+    } catch (error) {
+      // 事务会自动回滚,直接抛出错误
+      throw new Error(`Failed to import data: ${error instanceof Error ? error.message : String(error)}`)
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
} catch {
// 事务会自动回滚,直接抛出错误
throw error
throw new Error('Failed to import data')
} catch (error) {
// 事务会自动回滚,直接抛出错误
throw new Error(`Failed to import data: ${error instanceof Error ? error.message : String(error)}`)
}
🤖 Prompt for AI Agents
In src/main/presenter/sqlitePresenter/importData.ts around lines 102 to 104, the
catch block throws a new generic error, losing the original error details.
Modify the catch block to capture the original error object and either re-throw
it directly or include its message and stack trace in the new error to preserve
debugging information.

run: pnpm run i18n

- name: Build
run: pnpm run build
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Fix missing newline at end of file.

The file is missing a newline character at the end, which violates YAML formatting standards.

-        run: pnpm run build
+        run: pnpm run build
+
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
run: pnpm run build
run: pnpm run build
🧰 Tools
🪛 YAMLlint (1.37.1)

[error] 49-49: no new line character at the end of file

(new-line-at-end-of-file)

🤖 Prompt for AI Agents
In .github/workflows/prcheck.yml at line 49, add a newline character at the end
of the file to comply with YAML formatting standards and avoid potential parsing
issues.

Comment on lines +19 to +36
async summaries(
text: string,
modelId: string,
temperature?: number,
maxTokens?: number
): Promise<LLMResponse> {
return this.openAICompletion(
[
{
role: 'user',
content: `请总结以下内容,使用简洁的语言,突出重点:\n${text}`
}
],
modelId,
temperature,
maxTokens
)
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Fix language inconsistency in summary prompt.

The summary prompt is in Chinese while the MinimaxProvider uses English. This inconsistency should be addressed for a cohesive user experience.

Consider standardizing the language or making it configurable:

-          content: `请总结以下内容,使用简洁的语言,突出重点:\n${text}`
+          content: `Please summarize the following content using concise language and highlighting key points:\n${text}`
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
async summaries(
text: string,
modelId: string,
temperature?: number,
maxTokens?: number
): Promise<LLMResponse> {
return this.openAICompletion(
[
{
role: 'user',
content: `请总结以下内容,使用简洁的语言,突出重点:\n${text}`
}
],
modelId,
temperature,
maxTokens
)
}
async summaries(
text: string,
modelId: string,
temperature?: number,
maxTokens?: number
): Promise<LLMResponse> {
return this.openAICompletion(
[
{
role: 'user',
content: `Please summarize the following content using concise language and highlighting key points:\n${text}`
}
],
modelId,
temperature,
maxTokens
)
}
🤖 Prompt for AI Agents
In src/main/presenter/llmProviderPresenter/providers/togetherProvider.ts between
lines 19 and 36, the summary prompt is currently hardcoded in Chinese, causing
inconsistency with other providers like MinimaxProvider that use English. To fix
this, update the prompt text to English or make the prompt language configurable
via a parameter or configuration setting, ensuring consistent language usage
across providers for a cohesive user experience.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants