diff --git a/apps/desktop/src/components/editor/EditorSettingsDialog.vue b/apps/desktop/src/components/editor/EditorSettingsDialog.vue index 8d0ac9417d..e2775c85f0 100644 --- a/apps/desktop/src/components/editor/EditorSettingsDialog.vue +++ b/apps/desktop/src/components/editor/EditorSettingsDialog.vue @@ -2195,6 +2195,24 @@ const aiTestResult = ref<"" | "success" | "error">(""); const aiTestError = ref(""); const aiTestLatency = ref(null); const aiTestErrorCopied = ref(false); +const aiTestErrorCategoryKeys: Record = { + auth: "ai.testErrorAuth", + modelNotFound: "ai.testErrorModelNotFound", + rateLimit: "ai.testErrorRateLimit", + timeout: "ai.testErrorTimeout", + tokenLimit: "ai.testErrorTokenLimit", + safety: "ai.testErrorSafety", + emptyResponse: "ai.testErrorEmptyResponse", + network: "ai.testErrorNetwork", + unknown: "ai.testErrorUnknown", +}; +const aiTestErrorPresentation = computed(() => { + const match = aiTestError.value.match(/^\[([^\]]+)]\s*(.*)$/s); + if (!match) return { summary: "", detail: aiTestError.value }; + const key = aiTestErrorCategoryKeys[match[1]]; + return key ? { summary: t(key), detail: match[2] } : { summary: "", detail: aiTestError.value }; +}); +const aiTestErrorDisplay = computed(() => [aiTestErrorPresentation.value.summary, aiTestErrorPresentation.value.detail].filter(Boolean).join(" ")); const aiIsCodexCli = computed(() => aiEditProvider.value === "codex-cli"); const aiIsClaudeCodeCli = computed(() => aiEditProvider.value === "claude-code-cli"); const aiIsCliProvider = computed(() => CLI_AI_PROVIDERS.has(aiEditProvider.value)); @@ -5560,7 +5578,7 @@ onUnmounted(cleanupPreviewEditor);