Skip to content

Conversation

@zerob13
Copy link
Collaborator

@zerob13 zerob13 commented Oct 30, 2025

Summary by CodeRabbit

  • New Features

    • Settings window now persists position/size across sessions.
    • Custom prompts support with renderer-wide change notifications and automatic reloads.
    • New localized "Prompt not found" and related error messages added for many languages.
  • Improvements

    • Chat input context-length is now reactive for better runtime updates.
    • Settings window blocks non-http(s) external URLs and applies content protection.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 30, 2025

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

📥 Commits

Reviewing files that changed from the base of the PR and between 535341a and a827542.

📒 Files selected for processing (12)
  • src/main/events.ts (1 hunks)
  • src/renderer/src/i18n/en-US/mcp.json (1 hunks)
  • src/renderer/src/i18n/fa-IR/mcp.json (1 hunks)
  • src/renderer/src/i18n/fr-FR/mcp.json (1 hunks)
  • src/renderer/src/i18n/ja-JP/mcp.json (1 hunks)
  • src/renderer/src/i18n/ko-KR/mcp.json (1 hunks)
  • src/renderer/src/i18n/pt-BR/mcp.json (1 hunks)
  • src/renderer/src/i18n/ru-RU/mcp.json (1 hunks)
  • src/renderer/src/i18n/zh-CN/mcp.json (1 hunks)
  • src/renderer/src/i18n/zh-HK/mcp.json (1 hunks)
  • src/renderer/src/i18n/zh-TW/mcp.json (1 hunks)
  • src/renderer/src/stores/mcp.ts (2 hunks)
 ___________________________________________
< Crossing the tensor streams to find bugs. >
 -------------------------------------------
  \
   \   \
        \ /\
        ( )
      .( o ).

Walkthrough

The changes add custom prompts support with reactive state management and IPC synchronization, Settings window persistence, reactive context length tracking in ChatInput, and error messages across multiple locales for missing prompts.

Changes

Cohort / File(s) Summary
Event Definitions
src/main/events.ts, src/renderer/src/events.ts
Added CUSTOM_PROMPTS_CHANGED event key to both main and renderer CONFIG_EVENTS objects for synchronizing custom prompt changes across IPC.
Configuration & Cache Management
src/main/presenter/configPresenter/index.ts
Removed explicit cache invalidation from individual prompt mutation methods; consolidated via setCustomPrompts with renderer notification including updated count.
Window State Persistence
src/main/presenter/windowPresenter/index.ts
Settings window now uses windowStateManager to persist and restore position/size, handles external URL filtering (http/https only), and manages state cleanup on close.
Settings UI
src/renderer/settings/components/prompt/CustomPromptSettingsSection.vue
Added documentation comment noting main window notification via CONFIG_EVENTS.CUSTOM_PROMPTS_CHANGED after prompt loading.
ChatInput Reactivity
src/renderer/src/components/ChatView.vue, src/renderer/src/components/chat-input/ChatInput.vue, src/renderer/src/components/chat-input/composables/useContextLength.ts, src/renderer/src/components/chat-input/composables/useSendButtonState.ts
Converted contextLength prop from static number to reactive MaybeRef<number | undefined> using toRef and unref across ChatInput and composables for dynamic context length tracking.
MCP Store Custom Prompts
src/renderer/src/stores/mcp.ts
Added custom prompt resolution in getPrompt with parameter substitution; deferred MCP-enabled check for custom prompts; added IPC listener to reload prompts on CUSTOM_PROMPTS_CHANGED event.
Localization - Error Messages
src/renderer/src/i18n/{en-US,fa-IR,fr-FR,ja-JP,ko-KR,pt-BR,ru-RU,zh-CN,zh-HK,zh-TW}/mcp.json
Added promptNotFound error message key across 10 locale files with translations for missing custom prompts.

Sequence Diagram

sequenceDiagram
    participant MainProc as Main Process
    participant Config as ConfigPresenter
    participant Renderer as Renderer Process
    participant Store as MCP Store
    participant UI as ChatView

    MainProc->>Config: setCustomPrompts(prompts, count)
    Config->>Renderer: emit CONFIG_EVENTS.CUSTOM_PROMPTS_CHANGED
    Renderer->>Store: IPC listener receives event
    Store->>Store: reload custom prompts
    
    Note over UI: User selects custom prompt
    UI->>Store: getPrompt(promptName)
    Store->>Store: check if custom-prompts-server source
    alt Custom Prompt Found
        Store->>Store: substitute parameters from args
        Store-->>UI: return user-content message
    else Custom Prompt Not Found
        Store-->>UI: throw promptNotFound error
    end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

  • Areas requiring extra attention:
    • src/renderer/src/stores/mcp.ts — Complex custom prompt resolution logic with parameter substitution and error handling; verify MCP-enabled deferment doesn't introduce regressions
    • src/main/presenter/windowPresenter/index.ts — State persistence and external URL filtering logic across window lifecycle; confirm state cleanup and URL validation edge cases
    • src/renderer/src/components/chat-input/composables/{useContextLength,useSendButtonState}.ts — Reactivity pattern changes using MaybeRef and unref; validate all downstream consumers properly unwrap values

Possibly related PRs

Suggested labels

codex

Suggested reviewers

  • deepinfect

Poem

🐰 A rabbit hops through changing configs,
Custom prompts now dance with refs,
Settings windows remember their place,
Context lengths flow with grace,
Errors whisper in ten tongues—
IPC bells ring, synchronization stings,
Cached and fresh, the future swings! 🌟

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The pull request title "fix: custom prompt sync after setting" is specific and clearly related to a significant portion of the changeset. The PR does implement custom prompt synchronization by adding a new CUSTOM_PROMPTS_CHANGED event that notifies the renderer when custom prompts are modified, establishing IPC listeners to reload prompts, and handling custom prompt fetching with proper error handling in the MCP store. The title effectively communicates the primary fix for custom prompt synchronization after saving. While the PR also includes supporting changes for window state management and context length reactivity, the core objective centers on fixing custom prompt synchronization, which the title accurately describes.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

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

Comment @coderabbitai help to get the list of available commands and usage tips.

@zerob13
Copy link
Collaborator Author

zerob13 commented Oct 30, 2025

@coderabbitai review

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 30, 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: 2

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 745ac7c and 535341a.

📒 Files selected for processing (20)
  • src/main/events.ts (1 hunks)
  • src/main/presenter/configPresenter/index.ts (1 hunks)
  • src/main/presenter/windowPresenter/index.ts (3 hunks)
  • src/renderer/settings/components/prompt/CustomPromptSettingsSection.vue (1 hunks)
  • src/renderer/src/components/ChatView.vue (1 hunks)
  • src/renderer/src/components/chat-input/ChatInput.vue (2 hunks)
  • src/renderer/src/components/chat-input/composables/useContextLength.ts (2 hunks)
  • src/renderer/src/components/chat-input/composables/useSendButtonState.ts (3 hunks)
  • src/renderer/src/events.ts (1 hunks)
  • src/renderer/src/i18n/en-US/mcp.json (1 hunks)
  • src/renderer/src/i18n/fa-IR/mcp.json (1 hunks)
  • src/renderer/src/i18n/fr-FR/mcp.json (1 hunks)
  • src/renderer/src/i18n/ja-JP/mcp.json (1 hunks)
  • src/renderer/src/i18n/ko-KR/mcp.json (1 hunks)
  • src/renderer/src/i18n/pt-BR/mcp.json (1 hunks)
  • src/renderer/src/i18n/ru-RU/mcp.json (1 hunks)
  • src/renderer/src/i18n/zh-CN/mcp.json (1 hunks)
  • src/renderer/src/i18n/zh-HK/mcp.json (1 hunks)
  • src/renderer/src/i18n/zh-TW/mcp.json (1 hunks)
  • src/renderer/src/stores/mcp.ts (2 hunks)
🧰 Additional context used
📓 Path-based instructions (24)
src/renderer/src/**/*

📄 CodeRabbit inference engine (.cursor/rules/i18n.mdc)

src/renderer/src/**/*: All user-facing strings must use i18n keys (avoid hardcoded user-visible text in code)
Use the 'vue-i18n' framework for all internationalization in the renderer
Ensure all user-visible text in the renderer uses the translation system

Files:

  • src/renderer/src/i18n/zh-CN/mcp.json
  • src/renderer/src/i18n/pt-BR/mcp.json
  • src/renderer/src/i18n/zh-HK/mcp.json
  • src/renderer/src/events.ts
  • src/renderer/src/components/chat-input/composables/useContextLength.ts
  • src/renderer/src/i18n/zh-TW/mcp.json
  • src/renderer/src/i18n/ko-KR/mcp.json
  • src/renderer/src/components/ChatView.vue
  • src/renderer/src/i18n/fa-IR/mcp.json
  • src/renderer/src/stores/mcp.ts
  • src/renderer/src/i18n/ru-RU/mcp.json
  • src/renderer/src/i18n/en-US/mcp.json
  • src/renderer/src/i18n/ja-JP/mcp.json
  • src/renderer/src/i18n/fr-FR/mcp.json
  • src/renderer/src/components/chat-input/composables/useSendButtonState.ts
  • src/renderer/src/components/chat-input/ChatInput.vue
src/renderer/src/**

📄 CodeRabbit inference engine (AGENTS.md)

Place Vue 3 app source under src/renderer/src (components, stores, views, i18n, lib)

Files:

  • src/renderer/src/i18n/zh-CN/mcp.json
  • src/renderer/src/i18n/pt-BR/mcp.json
  • src/renderer/src/i18n/zh-HK/mcp.json
  • src/renderer/src/events.ts
  • src/renderer/src/components/chat-input/composables/useContextLength.ts
  • src/renderer/src/i18n/zh-TW/mcp.json
  • src/renderer/src/i18n/ko-KR/mcp.json
  • src/renderer/src/components/ChatView.vue
  • src/renderer/src/i18n/fa-IR/mcp.json
  • src/renderer/src/stores/mcp.ts
  • src/renderer/src/i18n/ru-RU/mcp.json
  • src/renderer/src/i18n/en-US/mcp.json
  • src/renderer/src/i18n/ja-JP/mcp.json
  • src/renderer/src/i18n/fr-FR/mcp.json
  • src/renderer/src/components/chat-input/composables/useSendButtonState.ts
  • src/renderer/src/components/chat-input/ChatInput.vue
src/renderer/src/i18n/**/*.{ts,json,yml,yaml}

📄 CodeRabbit inference engine (AGENTS.md)

Store i18n resources under src/renderer/src/i18n

Files:

  • src/renderer/src/i18n/zh-CN/mcp.json
  • src/renderer/src/i18n/pt-BR/mcp.json
  • src/renderer/src/i18n/zh-HK/mcp.json
  • src/renderer/src/i18n/zh-TW/mcp.json
  • src/renderer/src/i18n/ko-KR/mcp.json
  • src/renderer/src/i18n/fa-IR/mcp.json
  • src/renderer/src/i18n/ru-RU/mcp.json
  • src/renderer/src/i18n/en-US/mcp.json
  • src/renderer/src/i18n/ja-JP/mcp.json
  • src/renderer/src/i18n/fr-FR/mcp.json
**/*.{ts,tsx,js,jsx,vue,css,scss,md,json,yml,yaml}

📄 CodeRabbit inference engine (AGENTS.md)

Prettier style: single quotes, no semicolons, print width 100; run pnpm run format

Files:

  • src/renderer/src/i18n/zh-CN/mcp.json
  • src/renderer/src/i18n/pt-BR/mcp.json
  • src/renderer/src/i18n/zh-HK/mcp.json
  • src/renderer/src/events.ts
  • src/renderer/src/components/chat-input/composables/useContextLength.ts
  • src/renderer/src/i18n/zh-TW/mcp.json
  • src/renderer/src/i18n/ko-KR/mcp.json
  • src/renderer/src/components/ChatView.vue
  • src/renderer/src/i18n/fa-IR/mcp.json
  • src/renderer/src/stores/mcp.ts
  • src/renderer/src/i18n/ru-RU/mcp.json
  • src/main/presenter/windowPresenter/index.ts
  • src/renderer/src/i18n/en-US/mcp.json
  • src/renderer/src/i18n/ja-JP/mcp.json
  • src/renderer/src/i18n/fr-FR/mcp.json
  • src/main/events.ts
  • src/renderer/src/components/chat-input/composables/useSendButtonState.ts
  • src/renderer/settings/components/prompt/CustomPromptSettingsSection.vue
  • src/main/presenter/configPresenter/index.ts
  • src/renderer/src/components/chat-input/ChatInput.vue
**/*.{js,jsx,ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/development-setup.mdc)

**/*.{js,jsx,ts,tsx}: 使用 OxLint 进行代码检查
Log和注释使用英文书写

Files:

  • src/renderer/src/events.ts
  • src/renderer/src/components/chat-input/composables/useContextLength.ts
  • src/renderer/src/stores/mcp.ts
  • src/main/presenter/windowPresenter/index.ts
  • src/main/events.ts
  • src/renderer/src/components/chat-input/composables/useSendButtonState.ts
  • src/main/presenter/configPresenter/index.ts
src/{main,renderer}/**/*.ts

📄 CodeRabbit inference engine (.cursor/rules/electron-best-practices.mdc)

src/{main,renderer}/**/*.ts: Use context isolation for improved security
Implement proper inter-process communication (IPC) patterns
Optimize application startup time with lazy loading
Implement proper error handling and logging for debugging

Files:

  • src/renderer/src/events.ts
  • src/renderer/src/components/chat-input/composables/useContextLength.ts
  • src/renderer/src/stores/mcp.ts
  • src/main/presenter/windowPresenter/index.ts
  • src/main/events.ts
  • src/renderer/src/components/chat-input/composables/useSendButtonState.ts
  • src/main/presenter/configPresenter/index.ts
**/*.{ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/error-logging.mdc)

**/*.{ts,tsx}: 始终使用 try-catch 处理可能的错误
提供有意义的错误信息
记录详细的错误日志
优雅降级处理
日志应包含时间戳、日志级别、错误代码、错误描述、堆栈跟踪(如适用)、相关上下文信息
日志级别应包括 ERROR、WARN、INFO、DEBUG
不要吞掉错误
提供用户友好的错误信息
实现错误重试机制
避免记录敏感信息
使用结构化日志
设置适当的日志级别

Files:

  • src/renderer/src/events.ts
  • src/renderer/src/components/chat-input/composables/useContextLength.ts
  • src/renderer/src/stores/mcp.ts
  • src/main/presenter/windowPresenter/index.ts
  • src/main/events.ts
  • src/renderer/src/components/chat-input/composables/useSendButtonState.ts
  • src/main/presenter/configPresenter/index.ts
src/renderer/**/*.{vue,ts,js,tsx,jsx}

📄 CodeRabbit inference engine (.cursor/rules/project-structure.mdc)

渲染进程代码放在 src/renderer

Files:

  • src/renderer/src/events.ts
  • src/renderer/src/components/chat-input/composables/useContextLength.ts
  • src/renderer/src/components/ChatView.vue
  • src/renderer/src/stores/mcp.ts
  • src/renderer/src/components/chat-input/composables/useSendButtonState.ts
  • src/renderer/settings/components/prompt/CustomPromptSettingsSection.vue
  • src/renderer/src/components/chat-input/ChatInput.vue
src/renderer/src/**/*.{vue,ts,tsx,js,jsx}

📄 CodeRabbit inference engine (.cursor/rules/vue-best-practices.mdc)

src/renderer/src/**/*.{vue,ts,tsx,js,jsx}: Use the Composition API for better code organization and reusability
Implement proper state management with Pinia
Utilize Vue Router for navigation and route management
Leverage Vue's built-in reactivity system for efficient data handling

Files:

  • src/renderer/src/events.ts
  • src/renderer/src/components/chat-input/composables/useContextLength.ts
  • src/renderer/src/components/ChatView.vue
  • src/renderer/src/stores/mcp.ts
  • src/renderer/src/components/chat-input/composables/useSendButtonState.ts
  • src/renderer/src/components/chat-input/ChatInput.vue
src/renderer/**/*.{ts,tsx,vue}

📄 CodeRabbit inference engine (.cursor/rules/vue-shadcn.mdc)

src/renderer/**/*.{ts,tsx,vue}: Use descriptive variable names with auxiliary verbs (e.g., isLoading, hasError).
Use TypeScript for all code; prefer types over interfaces.
Avoid enums; use const objects instead.
Use arrow functions for methods and computed properties.
Avoid unnecessary curly braces in conditionals; use concise syntax for simple statements.

Files:

  • src/renderer/src/events.ts
  • src/renderer/src/components/chat-input/composables/useContextLength.ts
  • src/renderer/src/components/ChatView.vue
  • src/renderer/src/stores/mcp.ts
  • src/renderer/src/components/chat-input/composables/useSendButtonState.ts
  • src/renderer/settings/components/prompt/CustomPromptSettingsSection.vue
  • src/renderer/src/components/chat-input/ChatInput.vue
src/renderer/**/*.{vue,ts}

📄 CodeRabbit inference engine (.cursor/rules/vue-shadcn.mdc)

Implement lazy loading for routes and components.

Files:

  • src/renderer/src/events.ts
  • src/renderer/src/components/chat-input/composables/useContextLength.ts
  • src/renderer/src/components/ChatView.vue
  • src/renderer/src/stores/mcp.ts
  • src/renderer/src/components/chat-input/composables/useSendButtonState.ts
  • src/renderer/settings/components/prompt/CustomPromptSettingsSection.vue
  • src/renderer/src/components/chat-input/ChatInput.vue
src/renderer/**/*.{ts,vue}

📄 CodeRabbit inference engine (.cursor/rules/vue-shadcn.mdc)

src/renderer/**/*.{ts,vue}: Use useFetch and useAsyncData for data fetching.
Implement SEO best practices using Nuxt's useHead and useSeoMeta.

Use Pinia for frontend state management (do not introduce alternative state libraries)

Files:

  • src/renderer/src/events.ts
  • src/renderer/src/components/chat-input/composables/useContextLength.ts
  • src/renderer/src/components/ChatView.vue
  • src/renderer/src/stores/mcp.ts
  • src/renderer/src/components/chat-input/composables/useSendButtonState.ts
  • src/renderer/settings/components/prompt/CustomPromptSettingsSection.vue
  • src/renderer/src/components/chat-input/ChatInput.vue
**/*.{ts,tsx,js,vue}

📄 CodeRabbit inference engine (CLAUDE.md)

Use English for all logs and comments

Files:

  • src/renderer/src/events.ts
  • src/renderer/src/components/chat-input/composables/useContextLength.ts
  • src/renderer/src/components/ChatView.vue
  • src/renderer/src/stores/mcp.ts
  • src/main/presenter/windowPresenter/index.ts
  • src/main/events.ts
  • src/renderer/src/components/chat-input/composables/useSendButtonState.ts
  • src/renderer/settings/components/prompt/CustomPromptSettingsSection.vue
  • src/main/presenter/configPresenter/index.ts
  • src/renderer/src/components/chat-input/ChatInput.vue
**/*.{ts,tsx,vue}

📄 CodeRabbit inference engine (CLAUDE.md)

Enable and adhere to strict TypeScript typing (avoid implicit any, prefer precise types)

Use PascalCase for TypeScript types and classes

Files:

  • src/renderer/src/events.ts
  • src/renderer/src/components/chat-input/composables/useContextLength.ts
  • src/renderer/src/components/ChatView.vue
  • src/renderer/src/stores/mcp.ts
  • src/main/presenter/windowPresenter/index.ts
  • src/main/events.ts
  • src/renderer/src/components/chat-input/composables/useSendButtonState.ts
  • src/renderer/settings/components/prompt/CustomPromptSettingsSection.vue
  • src/main/presenter/configPresenter/index.ts
  • src/renderer/src/components/chat-input/ChatInput.vue
src/renderer/src/**/*.{vue,ts}

📄 CodeRabbit inference engine (AGENTS.md)

All user-facing strings must use vue-i18n ($t/keys) rather than hardcoded literals

Files:

  • src/renderer/src/events.ts
  • src/renderer/src/components/chat-input/composables/useContextLength.ts
  • src/renderer/src/components/ChatView.vue
  • src/renderer/src/stores/mcp.ts
  • src/renderer/src/components/chat-input/composables/useSendButtonState.ts
  • src/renderer/src/components/chat-input/ChatInput.vue
**/*.{ts,tsx,js,jsx,vue}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.{ts,tsx,js,jsx,vue}: Use OxLint for JS/TS code; keep lint clean
Use camelCase for variables and functions
Use SCREAMING_SNAKE_CASE for constants

Files:

  • src/renderer/src/events.ts
  • src/renderer/src/components/chat-input/composables/useContextLength.ts
  • src/renderer/src/components/ChatView.vue
  • src/renderer/src/stores/mcp.ts
  • src/main/presenter/windowPresenter/index.ts
  • src/main/events.ts
  • src/renderer/src/components/chat-input/composables/useSendButtonState.ts
  • src/renderer/settings/components/prompt/CustomPromptSettingsSection.vue
  • src/main/presenter/configPresenter/index.ts
  • src/renderer/src/components/chat-input/ChatInput.vue
src/renderer/src/components/**/*

📄 CodeRabbit inference engine (CLAUDE.md)

Organize UI components by feature within src/renderer/src/

Files:

  • src/renderer/src/components/chat-input/composables/useContextLength.ts
  • src/renderer/src/components/ChatView.vue
  • src/renderer/src/components/chat-input/composables/useSendButtonState.ts
  • src/renderer/src/components/chat-input/ChatInput.vue
src/renderer/src/**/*.vue

📄 CodeRabbit inference engine (.cursor/rules/vue-best-practices.mdc)

Use scoped styles to prevent CSS conflicts between components

Files:

  • src/renderer/src/components/ChatView.vue
  • src/renderer/src/components/chat-input/ChatInput.vue
src/renderer/{src,shell,floating}/**/*.vue

📄 CodeRabbit inference engine (CLAUDE.md)

src/renderer/{src,shell,floating}/**/*.vue: Use Vue 3 Composition API for all components
All user-facing strings must use i18n keys via vue-i18n (no hard-coded UI strings)
Use Tailwind CSS utilities and ensure styles are scoped in Vue components

Files:

  • src/renderer/src/components/ChatView.vue
  • src/renderer/src/components/chat-input/ChatInput.vue
src/renderer/**/*.vue

📄 CodeRabbit inference engine (AGENTS.md)

Name Vue component files in PascalCase (e.g., ChatInput.vue)

Files:

  • src/renderer/src/components/ChatView.vue
  • src/renderer/settings/components/prompt/CustomPromptSettingsSection.vue
  • src/renderer/src/components/chat-input/ChatInput.vue
src/renderer/src/stores/**/*.{vue,ts,tsx,js,jsx}

📄 CodeRabbit inference engine (.cursor/rules/pinia-best-practices.mdc)

src/renderer/src/stores/**/*.{vue,ts,tsx,js,jsx}: Use modules to organize related state and actions
Implement proper state persistence for maintaining data across sessions
Use getters for computed state properties
Utilize actions for side effects and asynchronous operations
Keep the store focused on global state, not component-specific data

Files:

  • src/renderer/src/stores/mcp.ts
src/main/**/*.ts

📄 CodeRabbit inference engine (.cursor/rules/electron-best-practices.mdc)

Use Electron's built-in APIs for file system and native dialogs

Files:

  • src/main/presenter/windowPresenter/index.ts
  • src/main/events.ts
  • src/main/presenter/configPresenter/index.ts
src/main/**/*.{ts,js,tsx,jsx}

📄 CodeRabbit inference engine (.cursor/rules/project-structure.mdc)

主进程代码放在 src/main

Files:

  • src/main/presenter/windowPresenter/index.ts
  • src/main/events.ts
  • src/main/presenter/configPresenter/index.ts
src/main/presenter/**/*.ts

📄 CodeRabbit inference engine (AGENTS.md)

Place Electron main-process presenters under src/main/presenter/ (Window, Tab, Thread, Mcp, Config, LLMProvider)

Files:

  • src/main/presenter/windowPresenter/index.ts
  • src/main/presenter/configPresenter/index.ts
🧠 Learnings (33)
📚 Learning: 2025-07-21T01:46:30.354Z
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/i18n.mdc:0-0
Timestamp: 2025-07-21T01:46:30.354Z
Learning: Applies to src/renderer/src/i18n/*.json : Maintain consistent structure across all translation files

Applied to files:

  • src/renderer/src/i18n/zh-CN/mcp.json
  • src/renderer/src/i18n/zh-TW/mcp.json
  • src/renderer/src/i18n/fr-FR/mcp.json
📚 Learning: 2025-07-21T01:46:30.354Z
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/i18n.mdc:0-0
Timestamp: 2025-07-21T01:46:30.354Z
Learning: Applies to src/renderer/src/i18n/common.json : Shared translation keys must be placed in 'src/renderer/src/i18n/common.json'

Applied to files:

  • src/renderer/src/i18n/zh-CN/mcp.json
  • src/renderer/src/i18n/pt-BR/mcp.json
  • src/renderer/src/i18n/zh-HK/mcp.json
  • src/renderer/src/i18n/zh-TW/mcp.json
  • src/renderer/src/i18n/ko-KR/mcp.json
  • src/renderer/src/i18n/fa-IR/mcp.json
  • src/renderer/src/i18n/ru-RU/mcp.json
  • src/renderer/src/i18n/en-US/mcp.json
  • src/renderer/src/i18n/fr-FR/mcp.json
📚 Learning: 2025-07-21T01:46:30.354Z
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/i18n.mdc:0-0
Timestamp: 2025-07-21T01:46:30.354Z
Learning: Applies to src/renderer/src/i18n/*.json : Regularly check for unused translation keys in i18n files

Applied to files:

  • src/renderer/src/i18n/zh-CN/mcp.json
  • src/renderer/src/i18n/zh-TW/mcp.json
  • src/renderer/src/i18n/fr-FR/mcp.json
📚 Learning: 2025-07-21T01:46:30.354Z
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/i18n.mdc:0-0
Timestamp: 2025-07-21T01:46:30.354Z
Learning: Applies to src/renderer/src/i18n/*.json : When adding new translations, add shared keys to 'common.json' and language-specific keys to the respective language file; keep all language files' keys consistent

Applied to files:

  • src/renderer/src/i18n/zh-CN/mcp.json
  • src/renderer/src/i18n/zh-TW/mcp.json
  • src/renderer/src/i18n/fr-FR/mcp.json
📚 Learning: 2025-07-21T01:46:19.702Z
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/error-logging.mdc:0-0
Timestamp: 2025-07-21T01:46:19.702Z
Learning: Applies to **/*.{ts,tsx} : 提供用户友好的错误信息

Applied to files:

  • src/renderer/src/i18n/zh-HK/mcp.json
📚 Learning: 2025-07-23T00:45:57.322Z
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/vue-shadcn.mdc:0-0
Timestamp: 2025-07-23T00:45:57.322Z
Learning: Applies to src/renderer/**/*.{vue} : Leverage ref, reactive, and computed for reactive state management.

Applied to files:

  • src/renderer/src/components/chat-input/composables/useContextLength.ts
  • src/renderer/src/components/chat-input/composables/useSendButtonState.ts
  • src/renderer/src/components/chat-input/ChatInput.vue
📚 Learning: 2025-07-23T00:45:57.322Z
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/vue-shadcn.mdc:0-0
Timestamp: 2025-07-23T00:45:57.322Z
Learning: Applies to src/renderer/{composables,utils}/**/*.ts : Use VueUse for common composables and utility functions.

Applied to files:

  • src/renderer/src/components/chat-input/composables/useContextLength.ts
  • src/renderer/src/components/chat-input/composables/useSendButtonState.ts
  • src/renderer/src/components/chat-input/ChatInput.vue
📚 Learning: 2025-07-23T00:45:57.322Z
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/vue-shadcn.mdc:0-0
Timestamp: 2025-07-23T00:45:57.322Z
Learning: Applies to src/renderer/**/*.{vue} : Use composition API and declarative programming patterns; avoid options API.

Applied to files:

  • src/renderer/src/components/chat-input/composables/useContextLength.ts
  • src/renderer/src/components/chat-input/ChatInput.vue
📚 Learning: 2025-07-23T00:45:57.322Z
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/vue-shadcn.mdc:0-0
Timestamp: 2025-07-23T00:45:57.322Z
Learning: Applies to src/renderer/**/*.{vue} : Use Vue 3 with TypeScript, leveraging defineComponent and PropType.

Applied to files:

  • src/renderer/src/components/chat-input/composables/useContextLength.ts
  • src/renderer/src/components/chat-input/ChatInput.vue
📚 Learning: 2025-07-21T01:47:28.817Z
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/vue-best-practices.mdc:0-0
Timestamp: 2025-07-21T01:47:28.817Z
Learning: Applies to src/renderer/src/**/*.{vue,ts,tsx,js,jsx} : Use the Composition API for better code organization and reusability

Applied to files:

  • src/renderer/src/components/chat-input/composables/useContextLength.ts
  • src/renderer/src/components/chat-input/composables/useSendButtonState.ts
  • src/renderer/src/components/chat-input/ChatInput.vue
📚 Learning: 2025-07-23T00:45:57.322Z
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/vue-shadcn.mdc:0-0
Timestamp: 2025-07-23T00:45:57.322Z
Learning: Applies to src/renderer/**/*.{ts,tsx,vue} : Use arrow functions for methods and computed properties.

Applied to files:

  • src/renderer/src/components/chat-input/composables/useContextLength.ts
  • src/renderer/src/components/chat-input/ChatInput.vue
📚 Learning: 2025-07-21T01:47:28.817Z
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/vue-best-practices.mdc:0-0
Timestamp: 2025-07-21T01:47:28.817Z
Learning: Applies to src/renderer/src/**/*.{vue,ts,tsx,js,jsx} : Leverage Vue's built-in reactivity system for efficient data handling

Applied to files:

  • src/renderer/src/components/chat-input/composables/useContextLength.ts
  • src/renderer/src/components/chat-input/composables/useSendButtonState.ts
  • src/renderer/src/components/chat-input/ChatInput.vue
📚 Learning: 2025-10-14T08:02:59.495Z
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: AGENTS.md:0-0
Timestamp: 2025-10-14T08:02:59.495Z
Learning: Applies to src/renderer/**/*.vue : Name Vue component files in PascalCase (e.g., ChatInput.vue)

Applied to files:

  • src/renderer/src/components/ChatView.vue
  • src/renderer/src/components/chat-input/ChatInput.vue
📚 Learning: 2025-09-06T03:07:23.817Z
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: CLAUDE.md:0-0
Timestamp: 2025-09-06T03:07:23.817Z
Learning: Applies to src/main/presenter/mcpPresenter/index.ts : Register new MCP tools in src/main/presenter/mcpPresenter/index.ts

Applied to files:

  • src/renderer/src/stores/mcp.ts
  • src/main/presenter/configPresenter/index.ts
📚 Learning: 2025-09-06T03:07:23.817Z
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: CLAUDE.md:0-0
Timestamp: 2025-09-06T03:07:23.817Z
Learning: Applies to src/main/presenter/mcpPresenter/inMemoryServers/*.ts : Implement new MCP tools under src/main/presenter/mcpPresenter/inMemoryServers/

Applied to files:

  • src/renderer/src/stores/mcp.ts
📚 Learning: 2025-07-21T01:46:52.880Z
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/llm-agent-loop.mdc:0-0
Timestamp: 2025-07-21T01:46:52.880Z
Learning: Applies to src/main/presenter/llmProviderPresenter/providers/*.ts : When a provider does not support native function calling, it must prepare messages using prompt wrapping (e.g., `prepareFunctionCallPrompt`) before making the API call.

Applied to files:

  • src/renderer/src/stores/mcp.ts
  • src/main/presenter/configPresenter/index.ts
📚 Learning: 2025-07-21T01:46:52.880Z
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/llm-agent-loop.mdc:0-0
Timestamp: 2025-07-21T01:46:52.880Z
Learning: Applies to src/main/presenter/llmProviderPresenter/index.ts : `src/main/presenter/llmProviderPresenter/index.ts` should manage the overall Agent loop, conversation history, tool execution via `McpPresenter`, and frontend communication via `eventBus`.

Applied to files:

  • src/renderer/src/stores/mcp.ts
📚 Learning: 2025-10-14T08:02:59.495Z
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: AGENTS.md:0-0
Timestamp: 2025-10-14T08:02:59.495Z
Learning: Applies to src/main/presenter/**/*.ts : Place Electron main-process presenters under src/main/presenter/ (Window, Tab, Thread, Mcp, Config, LLMProvider)

Applied to files:

  • src/main/presenter/windowPresenter/index.ts
  • src/main/presenter/configPresenter/index.ts
📚 Learning: 2025-07-21T01:46:30.354Z
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/i18n.mdc:0-0
Timestamp: 2025-07-21T01:46:30.354Z
Learning: Applies to src/renderer/src/i18n/*.json : Translation key naming must use dot-separated hierarchy, lowercase letters, and meaningful descriptive names (e.g., 'common.button.submit')

Applied to files:

  • src/renderer/src/i18n/fr-FR/mcp.json
📚 Learning: 2025-09-06T03:07:23.817Z
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: CLAUDE.md:0-0
Timestamp: 2025-09-06T03:07:23.817Z
Learning: Applies to src/renderer/{src,shell,floating}/**/*.vue : All user-facing strings must use i18n keys via vue-i18n (no hard-coded UI strings)

Applied to files:

  • src/renderer/src/i18n/fr-FR/mcp.json
  • src/renderer/src/components/chat-input/ChatInput.vue
📚 Learning: 2025-07-23T00:45:57.322Z
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/vue-shadcn.mdc:0-0
Timestamp: 2025-07-23T00:45:57.322Z
Learning: Applies to src/renderer/composables/**/*.ts : Use camelCase for composables (e.g., useAuthState.ts).

Applied to files:

  • src/renderer/src/components/chat-input/composables/useSendButtonState.ts
📚 Learning: 2025-06-21T15:49:17.044Z
Learnt from: neoragex2002
PR: ThinkInAIXYZ/deepchat#550
File: src/renderer/src/stores/chat.ts:1011-1035
Timestamp: 2025-06-21T15:49:17.044Z
Learning: In src/renderer/src/stores/chat.ts, the user prefers to keep both `text` and `content` properties in the `handleMeetingInstruction` function's `sendMessage` call, even though they are redundant, rather than removing the `content` property.

Applied to files:

  • src/renderer/src/components/chat-input/composables/useSendButtonState.ts
📚 Learning: 2025-07-21T01:47:03.479Z
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/pinia-best-practices.mdc:0-0
Timestamp: 2025-07-21T01:47:03.479Z
Learning: Applies to src/renderer/src/stores/**/*.{vue,ts,tsx,js,jsx} : Keep the store focused on global state, not component-specific data

Applied to files:

  • src/renderer/src/components/chat-input/composables/useSendButtonState.ts
📚 Learning: 2025-07-21T01:47:03.479Z
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/pinia-best-practices.mdc:0-0
Timestamp: 2025-07-21T01:47:03.479Z
Learning: Applies to src/renderer/src/stores/**/*.{vue,ts,tsx,js,jsx} : Use getters for computed state properties

Applied to files:

  • src/renderer/src/components/chat-input/composables/useSendButtonState.ts
📚 Learning: 2025-07-21T01:47:03.479Z
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/pinia-best-practices.mdc:0-0
Timestamp: 2025-07-21T01:47:03.479Z
Learning: Applies to src/renderer/src/stores/**/*.{vue,ts,tsx,js,jsx} : Use modules to organize related state and actions

Applied to files:

  • src/renderer/src/components/chat-input/composables/useSendButtonState.ts
📚 Learning: 2025-07-21T01:47:03.479Z
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/pinia-best-practices.mdc:0-0
Timestamp: 2025-07-21T01:47:03.479Z
Learning: Applies to src/renderer/src/stores/**/*.{vue,ts,tsx,js,jsx} : Implement proper state persistence for maintaining data across sessions

Applied to files:

  • src/renderer/src/components/chat-input/composables/useSendButtonState.ts
📚 Learning: 2025-07-21T01:47:03.479Z
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/pinia-best-practices.mdc:0-0
Timestamp: 2025-07-21T01:47:03.479Z
Learning: Applies to src/renderer/src/stores/**/*.{vue,ts,tsx,js,jsx} : Utilize actions for side effects and asynchronous operations

Applied to files:

  • src/renderer/src/components/chat-input/composables/useSendButtonState.ts
📚 Learning: 2025-09-06T03:07:23.817Z
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: CLAUDE.md:0-0
Timestamp: 2025-09-06T03:07:23.817Z
Learning: Applies to src/main/presenter/configPresenter/providers.ts : Add provider configuration entries in src/main/presenter/configPresenter/providers.ts

Applied to files:

  • src/main/presenter/configPresenter/index.ts
📚 Learning: 2025-07-23T00:45:57.322Z
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/vue-shadcn.mdc:0-0
Timestamp: 2025-07-23T00:45:57.322Z
Learning: Applies to src/renderer/**/*.{vue} : Use provide/inject for dependency injection when appropriate.

Applied to files:

  • src/renderer/src/components/chat-input/ChatInput.vue
📚 Learning: 2025-10-14T08:02:59.495Z
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: AGENTS.md:0-0
Timestamp: 2025-10-14T08:02:59.495Z
Learning: Applies to src/renderer/src/**/*.{vue,ts} : All user-facing strings must use vue-i18n ($t/keys) rather than hardcoded literals

Applied to files:

  • src/renderer/src/components/chat-input/ChatInput.vue
📚 Learning: 2025-07-23T00:45:57.322Z
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/vue-shadcn.mdc:0-0
Timestamp: 2025-07-23T00:45:57.322Z
Learning: Applies to src/renderer/**/*.{vue} : Use <script setup> syntax for concise component definitions.

Applied to files:

  • src/renderer/src/components/chat-input/ChatInput.vue
📚 Learning: 2025-07-21T01:46:30.354Z
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: .cursor/rules/i18n.mdc:0-0
Timestamp: 2025-07-21T01:46:30.354Z
Learning: Applies to src/renderer/src/**/* : Use the 'vue-i18n' framework for all internationalization in the renderer

Applied to files:

  • src/renderer/src/components/chat-input/ChatInput.vue
📚 Learning: 2025-10-14T08:02:59.495Z
Learnt from: CR
PR: ThinkInAIXYZ/deepchat#0
File: AGENTS.md:0-0
Timestamp: 2025-10-14T08:02:59.495Z
Learning: Use TypeScript + Vue 3 Composition API with Pinia for state and Tailwind for styles in the renderer

Applied to files:

  • src/renderer/src/components/chat-input/ChatInput.vue
🪛 ast-grep (0.39.6)
src/renderer/src/stores/mcp.ts

[warning] 488-488: Regular expression constructed from variable input detected. This can lead to Regular Expression Denial of Service (ReDoS) attacks if the variable contains malicious patterns. Use libraries like 'recheck' to validate regex safety or use static patterns.
Context: new RegExp({{${key}}}, 'g')
Note: [CWE-1333] Inefficient Regular Expression Complexity [REFERENCES]
- https://owasp.org/www-community/attacks/Regular_expression_Denial_of_Service_-_ReDoS
- https://cwe.mitre.org/data/definitions/1333.html

(regexp-from-variable)

🔇 Additional comments (20)
src/renderer/src/i18n/ko-KR/mcp.json (1)

250-251: No issues found.

The promptNotFound key has been successfully added to all 10 locale files (en-US, ja-JP, zh-CN, zh-TW, zh-HK, fr-FR, ru-RU, fa-IR, pt-BR, ko-KR), ensuring consistent internationalization across all supported languages.

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

25-26: LGTM! Consistent i18n addition across all locales.

The promptNotFound translation key has been added consistently across all locale files (zh-CN, en-US, zh-TW, fr-FR, zh-HK, ja-JP, pt-BR) with proper JSON syntax and appropriate translations for each language. The {name} placeholder is used consistently to support dynamic error messages when a custom prompt is not found.

src/renderer/src/events.ts (1)

28-29: LGTM! Event constant added correctly.

The new CUSTOM_PROMPTS_CHANGED event follows the established naming convention (domain:event-name format with lowercase and hyphens) and is appropriately placed in the CONFIG_EVENTS object. This enables proper IPC notification when custom prompts are modified, supporting the reactive state management mentioned in the PR objectives.

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

250-251: LGTM! Localization key added correctly.

The new promptNotFound error message key has been added consistently with the existing structure, and the trailing comma maintains valid JSON syntax.

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

1305-1308: LGTM! Event notification pattern is well-implemented.

The renderer-wide notification after saving custom prompts follows the established pattern in this file and ensures all windows stay synchronized. Cache invalidation at line 1303 before the notification ensures fresh data on reload.

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

1279-1291: LGTM! Window state persistence improves UX.

The settings window now persists its position and size between sessions using electron-window-state, which is a good UX improvement. The default dimensions (900x600) are appropriate for settings content, and using a separate state file (settings-window-state.json) keeps it independent from other windows.


1328-1344: LGTM! External URL handling is secure.

The URL validation only allows http:// and https:// protocols, which prevents potential security issues from opening file://, javascript:, or other schemes. Invalid URLs and blocked protocols are properly logged for debugging.


1360-1361: LGTM! State manager cleanup prevents memory leaks.

Calling unmanage() when the settings window closes ensures the state manager stops tracking the window, preventing memory leaks. This pattern is consistent with the shell window management at line 882.

src/renderer/settings/components/prompt/CustomPromptSettingsSection.vue (1)

208-208: LGTM! Documentation comment clarifies event flow.

The inline comment helps developers understand that the main window will be notified when custom prompts are loaded, referencing the newly added CONFIG_EVENTS.CUSTOM_PROMPTS_CHANGED event.

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

15-15: LGTM! Context length binding enables reactive tracking.

The new :context-length prop binding passes the reactive contextLength from the chat store to the ChatInput component. This works seamlessly with ChatInput's use of toRef(props, 'contextLength') to track context length changes reactively.

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

250-251: LGTM! Localization key added correctly.

The new promptNotFound error message key has been added consistently with the existing structure, and the trailing comma maintains valid JSON syntax.

src/renderer/src/components/chat-input/ChatInput.vue (2)

269-269: LGTM! Import addition supports reactive prop handling.

The toRef import from Vue enables reactive wrapping of the contextLength prop, which is used at lines 438 and 446 to provide reactive context length tracking to composables.


438-446: LGTM! Reactive prop handling enables runtime updates.

Using toRef(props, 'contextLength') instead of direct prop access creates a reactive reference that automatically updates when the parent component changes the contextLength prop. This enables the context length tracker and send button state to respond to runtime changes in context length.

This pattern aligns well with the Vue 3 Composition API best practices and works seamlessly with the updated composables that accept MaybeRef<number | undefined>.

src/renderer/src/stores/mcp.ts (2)

497-499: Good architectural separation.

Moving the MCP enablement check to only apply to MCP prompts (not custom prompts from config) is the correct design decision. Custom prompts are configuration-based and should be available regardless of MCP status.


559-564: LGTM! Proper IPC synchronization pattern.

The IPC listener correctly handles custom prompt configuration changes by reloading the prompts list. This ensures the UI stays synchronized with configuration updates made in the Settings window.

src/renderer/src/components/chat-input/composables/useContextLength.ts (3)

2-6: LGTM! Proper reactive type support.

The addition of unref and MaybeRef imports correctly enables the composable to handle both static values and reactive refs for contextLength.


14-14: Good API flexibility with MaybeRef.

Changing contextLength to MaybeRef<number | undefined> allows callers to pass either a plain number or a reactive ref, providing better flexibility for reactive context length updates.


34-35: Consistent unref usage throughout.

The unref() calls properly unwrap the MaybeRef value in all computed properties, ensuring correct reactivity tracking while maintaining backward compatibility with non-ref values.

Also applies to: 43-44

src/renderer/src/components/chat-input/composables/useSendButtonState.ts (2)

2-3: LGTM! Consistent MaybeRef adoption.

The imports and type changes align perfectly with the parallel changes in useContextLength.ts, providing a consistent API across composables.

Also applies to: 12-12


25-28: Clean pattern: extract once, use multiple times.

Extracting the unref(contextLength) result into a length variable avoids redundant unwrapping calls and improves code readability. The usage in both the newThread and chat variants is correct.

Also applies to: 37-37

Comment on lines 38 to 39
DEFAULT_SYSTEM_PROMPT_CHANGED: 'config:default-system-prompt-changed', // 默认系统提示词变更事件
CUSTOM_PROMPTS_CHANGED: 'config:custom-prompts-changed' // 自定义提示词变更事件
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 | 🟡 Minor

Use English for comments.

The inline comment on line 38 is in Chinese (中文), but the coding guidelines require all comments to be in English.

As per coding guidelines:

-  DEFAULT_SYSTEM_PROMPT_CHANGED: 'config:default-system-prompt-changed', // 默认系统提示词变更事件
+  DEFAULT_SYSTEM_PROMPT_CHANGED: 'config:default-system-prompt-changed', // Default system prompt changed event

The new CUSTOM_PROMPTS_CHANGED event key follows proper naming conventions and integrates well with the event system.

📝 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
DEFAULT_SYSTEM_PROMPT_CHANGED: 'config:default-system-prompt-changed', // 默认系统提示词变更事件
CUSTOM_PROMPTS_CHANGED: 'config:custom-prompts-changed' // 自定义提示词变更事件
DEFAULT_SYSTEM_PROMPT_CHANGED: 'config:default-system-prompt-changed', // Default system prompt changed event
CUSTOM_PROMPTS_CHANGED: 'config:custom-prompts-changed' // 自定义提示词变更事件
🤖 Prompt for AI Agents
In src/main/events.ts around lines 38 to 39, the inline comment for
DEFAULT_SYSTEM_PROMPT_CHANGED is written in Chinese; update that comment to
English to comply with coding guidelines (e.g., change "默认系统提示词变更事件" to "Default
system prompt changed event") and keep the existing English comment for
CUSTOM_PROMPTS_CHANGED unchanged.

@zerob13 zerob13 merged commit ed3190b into dev Oct 30, 2025
1 of 2 checks passed
@zerob13 zerob13 deleted the bugfix/custom-prompt-parse-failed branch November 6, 2025 10:52
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.

2 participants