Conversation
📝 WalkthroughWalkthroughThis pull request adds process launch signature computation for warmup and inflight process reuse gating, extends internationalization support with new UI control labels across all locales, creates new Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested labels
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (2)
src/renderer/settings/components/McpBuiltinMarket.vue (1)
190-208: Consider sanitizing error text in user-facing toast.The
description: String(e)can surface internal/server details to end-users. Consider logging the raw error to console (or a logger) and showing a stable, user-safe message instead.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/renderer/settings/components/McpBuiltinMarket.vue` around lines 190 - 208, In saveApiKey, avoid exposing raw error text to users: catch the error, log the full error object via console.error or a logger (e.g., include the error from the catch), then pass a stable, user-safe message into the toast description (e.g., a generic 'Unable to save API key' or localized t(...) string) while retaining the destructive variant; keep calls to mcpP.setMcpRouterApiKey and mcpP.updateMcpRouterServersAuth unchanged but ensure their thrown errors are what you log, not displayed to the user.src/renderer/settings/App.vue (1)
423-427: User-facing description is still raw error text (optional).This PR changes the toast title to an i18n key, but the toast description is still
error.message/String(error). If you expect structured error codes, consider mapping them to localized i18n keys so the description is also user-friendly in all languages (optional, since this change might be intentionally scoped to the title).🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/renderer/settings/App.vue` around lines 423 - 427, The toast currently shows raw error text in the description (toast(...) using description: error instanceof Error ? error.message : String(error)); change this to map errors to localized messages by creating or using a mapping helper (e.g., mapErrorToI18nKey or mapErrorToMessage) and call t(...) for the description instead of raw error.message; update the toast invocation in App.vue to pass t(mapErrorToI18nKey(error)) with a sensible fallback like t('common.error.operationFailedDetails') so users see a translated, friendly message across locales.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@src/main/presenter/llmProviderPresenter/acp/acpProcessManager.ts`:
- Around line 106-115: The current createLaunchSignature produces a signature
from the resolved launch spec but misses downstream modifications applied in
spawnAgentProcess (like agentState?.envOverride, npm/uv registry overrides,
runtime command expansion/replacement, and cwd fallback) and suffers from env
key order variance; update createLaunchSignature (and the other occurrences of
the same logic) to accept or compute the final spawn inputs used by
spawnAgentProcess (final command and args after expansion, merged env including
agentState?.envOverride and registry overrides, and the effective cwd with
fallback), normalize the env by sorting its keys deterministically before
serialization, and then JSON.stringify the normalized {command, args, env, cwd,
distributionType, version, installDir} so warmupProcess reuses only truly
equivalent spawn inputs.
In `@src/renderer/src/i18n/zh-HK/common.json`:
- Line 76: The zh-HK translation for the JSON key "source" is using "源碼" (which
means source code); update the value for the "source" key in the zh-HK
common.json to the correct UI wording "來源" to reflect citation/origin meaning
instead of code-related meaning.
---
Nitpick comments:
In `@src/renderer/settings/App.vue`:
- Around line 423-427: The toast currently shows raw error text in the
description (toast(...) using description: error instanceof Error ?
error.message : String(error)); change this to map errors to localized messages
by creating or using a mapping helper (e.g., mapErrorToI18nKey or
mapErrorToMessage) and call t(...) for the description instead of raw
error.message; update the toast invocation in App.vue to pass
t(mapErrorToI18nKey(error)) with a sensible fallback like
t('common.error.operationFailedDetails') so users see a translated, friendly
message across locales.
In `@src/renderer/settings/components/McpBuiltinMarket.vue`:
- Around line 190-208: In saveApiKey, avoid exposing raw error text to users:
catch the error, log the full error object via console.error or a logger (e.g.,
include the error from the catch), then pass a stable, user-safe message into
the toast description (e.g., a generic 'Unable to save API key' or localized
t(...) string) while retaining the destructive variant; keep calls to
mcpP.setMcpRouterApiKey and mcpP.updateMcpRouterServersAuth unchanged but ensure
their thrown errors are what you log, not displayed to the user.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: ff090ff6-55c2-4a5e-a6f2-cc2fc5b97c9e
📒 Files selected for processing (40)
src/main/presenter/llmProviderPresenter/acp/acpProcessManager.tssrc/renderer/settings/App.vuesrc/renderer/settings/components/McpBuiltinMarket.vuesrc/renderer/src/i18n/da-DK/common.jsonsrc/renderer/src/i18n/da-DK/image.jsonsrc/renderer/src/i18n/da-DK/index.tssrc/renderer/src/i18n/en-US/common.jsonsrc/renderer/src/i18n/en-US/image.jsonsrc/renderer/src/i18n/en-US/index.tssrc/renderer/src/i18n/fa-IR/common.jsonsrc/renderer/src/i18n/fa-IR/image.jsonsrc/renderer/src/i18n/fa-IR/index.tssrc/renderer/src/i18n/fr-FR/common.jsonsrc/renderer/src/i18n/fr-FR/image.jsonsrc/renderer/src/i18n/fr-FR/index.tssrc/renderer/src/i18n/he-IL/common.jsonsrc/renderer/src/i18n/he-IL/image.jsonsrc/renderer/src/i18n/he-IL/index.tssrc/renderer/src/i18n/ja-JP/common.jsonsrc/renderer/src/i18n/ja-JP/image.jsonsrc/renderer/src/i18n/ja-JP/index.tssrc/renderer/src/i18n/ko-KR/common.jsonsrc/renderer/src/i18n/ko-KR/image.jsonsrc/renderer/src/i18n/ko-KR/index.tssrc/renderer/src/i18n/pt-BR/common.jsonsrc/renderer/src/i18n/pt-BR/image.jsonsrc/renderer/src/i18n/pt-BR/index.tssrc/renderer/src/i18n/ru-RU/common.jsonsrc/renderer/src/i18n/ru-RU/image.jsonsrc/renderer/src/i18n/ru-RU/index.tssrc/renderer/src/i18n/zh-CN/common.jsonsrc/renderer/src/i18n/zh-CN/image.jsonsrc/renderer/src/i18n/zh-CN/index.tssrc/renderer/src/i18n/zh-HK/common.jsonsrc/renderer/src/i18n/zh-HK/image.jsonsrc/renderer/src/i18n/zh-HK/index.tssrc/renderer/src/i18n/zh-TW/common.jsonsrc/renderer/src/i18n/zh-TW/image.jsonsrc/renderer/src/i18n/zh-TW/index.tssrc/types/i18n.d.ts
| const createLaunchSignature = (launchSpec: AcpResolvedLaunchSpec): string => | ||
| JSON.stringify({ | ||
| command: launchSpec.command, | ||
| args: launchSpec.args ?? [], | ||
| env: launchSpec.env ?? {}, | ||
| cwd: launchSpec.cwd ?? null, | ||
| distributionType: launchSpec.distributionType, | ||
| version: launchSpec.version ?? null, | ||
| installDir: launchSpec.installDir ?? null | ||
| }) |
There was a problem hiding this comment.
Derive launchSignature from the final spawn inputs.
warmupProcess now decides reuse from launchSignature, but the actual child process also depends on inputs that are only applied later in spawnAgentProcess (agentState?.envOverride, npm/uv registry overrides, runtime command expansion/replacement, and cwd fallback). That means some launch-affecting changes can still reuse a stale warmup process, while equivalent env objects with different key insertion order can force needless respawns. Please build the signature from the normalized command/args/env/cwd that will actually be spawned, with env keys sorted before serialization.
Also applies to: 261-262, 312-312
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@src/main/presenter/llmProviderPresenter/acp/acpProcessManager.ts` around
lines 106 - 115, The current createLaunchSignature produces a signature from the
resolved launch spec but misses downstream modifications applied in
spawnAgentProcess (like agentState?.envOverride, npm/uv registry overrides,
runtime command expansion/replacement, and cwd fallback) and suffers from env
key order variance; update createLaunchSignature (and the other occurrences of
the same logic) to accept or compute the final spawn inputs used by
spawnAgentProcess (final command and args after expansion, merged env including
agentState?.envOverride and registry overrides, and the effective cwd with
fallback), normalize the env by sorting its keys deterministically before
serialization, and then JSON.stringify the normalized {command, args, env, cwd,
distributionType, version, installDir} so warmupProcess reuses only truly
equivalent spawn inputs.
Summary by CodeRabbit
Bug Fixes
New Features
Documentation