Skip to content

AI-native knowledge base & Evernote/Obsidian alternative with instant sync & native MCP. Free on Cloudflare or self-hosted via Docker.

fix(web): show local agent connection failure reasons

tianma-if0d1682e48d59
diff --git a/apps/web/src/components/settings/DesktopAcpAgentCard.tsx b/apps/web/src/components/settings/DesktopAcpAgentCard.tsx
index 2ef49111..34e3892e 100644
--- a/apps/web/src/components/settings/DesktopAcpAgentCard.tsx
+++ b/apps/web/src/components/settings/DesktopAcpAgentCard.tsx
@@ -158,7 +158,12 @@ const DesktopAcpAgentCardBody = ({ bridge }: { bridge: boolean }) => {
adapterId === "workbuddyCn" ? method.id !== "external" : adapterId === "workbuddyIntl" ? method.id !== "internal" : true
)) ?? [];
const canRetryLogin = desktopAcpLoginRetryAvailable(shown);
+ // Host failure details are sanitized before crossing the desktop bridge.
+ const failureReason = shown?.state === "failed"
+ ? shown.detail?.trim().slice(0, 160) || t("aiAssistant.agentSource.connectionFailureUnknown")
+ : null;
const hasDetails = Boolean(
+ failureReason ||
canRetryLogin ||
shown?.state === "not_installed" ||
shown?.state === "needs_login" ||
@@ -408,6 +413,11 @@ const DesktopAcpAgentCardBody = ({ bridge }: { bridge: boolean }) => {
{hasDetails ? (
<div className="space-y-1.5 text-[11px] leading-4 text-slate-500">
+ {failureReason ? (
+ <p className="select-text whitespace-pre-wrap [overflow-wrap:anywhere]">
+ {t("aiAssistant.agentSource.connectionFailureReason", { reason: failureReason })}
+ </p>
+ ) : null}
{shown?.state === "not_installed" ? (
<p>
{t(adapterId === "claudeCode" ? "aiAssistant.agentSource.claudeCodeMissingHint" : adapterId === "openClaw" ? "aiAssistant.agentSource.openClawMissingHint" : adapterId === "hermesAgent" ? "aiAssistant.agentSource.hermesAgentMissingHint" : adapterId === "grokBuild" ? "aiAssistant.agentSource.grokBuildMissingHint" : adapterId === "deepseekHarness" ? "aiAssistant.agentSource.deepseekHarnessMissingHint" : adapterId === "piAgent" ? shown.detail === "adapter_missing" ? "aiAssistant.agentSource.piAgentAdapterMissingHint" : "aiAssistant.agentSource.piAgentMissingHint" : adapterId === "workbuddyCn" || adapterId === "workbuddyIntl" ? "aiAssistant.agentSource.workbuddyMissingHint" : "aiAssistant.agentSource.installHint")}
diff --git a/packages/shared/src/i18n/en-US.ts b/packages/shared/src/i18n/en-US.ts
index 987feafe..a1b6ecf4 100644
--- a/packages/shared/src/i18n/en-US.ts
+++ b/packages/shared/src/i18n/en-US.ts
@@ -1777,6 +1777,8 @@ export const enUS = {
installFailed: "Installation or connection check failed. The previous version was kept.",
updateFailed: "Automatic update failed. The previous version remains in use.",
updateFailureReason: "Reason: {{reason}}",
+ connectionFailureReason: "Connection failure reason: {{reason}}",
+ connectionFailureUnknown: "The desktop app did not return a specific reason. Check the connection again and provide the desktop diagnostic log.",
updateTimeoutHint: "The download or connection timed out. Check your network and retry.",
updateNetworkHint: "Could not reach the update service. Check your network and system proxy, then retry.",
retryUpdate: "Retry update",
diff --git a/packages/shared/src/i18n/ja.ts b/packages/shared/src/i18n/ja.ts
index 69d25e5e..30eca28c 100644
--- a/packages/shared/src/i18n/ja.ts
+++ b/packages/shared/src/i18n/ja.ts
@@ -1766,6 +1766,8 @@ export const ja = {
installFailed: "インストールまたは接続確認に失敗しました。以前のバージョンは保持されています。",
updateFailed: "自動更新に失敗しました。以前のバージョンを継続して使用します。",
updateFailureReason: "失敗の理由:{{reason}}",
+ connectionFailureReason: "接続失敗の理由:{{reason}}",
+ connectionFailureUnknown: "デスクトップアプリから具体的な理由が返されませんでした。接続を再確認し、デスクトップの診断ログを提供してください。",
updateTimeoutHint: "ダウンロードまたは接続がタイムアウトしました。ネットワークを確認して再試行してください。",
updateNetworkHint: "更新サービスに接続できません。ネットワークとシステムプロキシを確認して再試行してください。",
retryUpdate: "更新を再試行",
diff --git a/packages/shared/src/i18n/pl.ts b/packages/shared/src/i18n/pl.ts
index 5f7a83ef..f42ef207 100644
--- a/packages/shared/src/i18n/pl.ts
+++ b/packages/shared/src/i18n/pl.ts
@@ -1766,6 +1766,8 @@ export const pl = {
installFailed: "Instalacja lub sprawdzenie połączenia nie powiodło się. Zachowano poprzednią wersję.",
updateFailed: "Automatyczna aktualizacja nie powiodła się. Nadal używana jest poprzednia wersja.",
updateFailureReason: "Przyczyna: {{reason}}",
+ connectionFailureReason: "Przyczyna błędu połączenia: {{reason}}",
+ connectionFailureUnknown: "Aplikacja desktopowa nie zwróciła konkretnej przyczyny. Sprawdź połączenie ponownie i udostępnij dziennik diagnostyczny aplikacji.",
updateTimeoutHint: "Pobieranie lub połączenie przekroczyło limit czasu. Sprawdź sieć i spróbuj ponownie.",
updateNetworkHint: "Nie można połączyć się z usługą aktualizacji. Sprawdź sieć i systemowe ustawienia proxy, a następnie ponów próbę.",
retryUpdate: "Ponów aktualizację",
diff --git a/packages/shared/src/i18n/zh-CN.ts b/packages/shared/src/i18n/zh-CN.ts
index 3ece175b..62867a1e 100644
--- a/packages/shared/src/i18n/zh-CN.ts
+++ b/packages/shared/src/i18n/zh-CN.ts
@@ -1777,6 +1777,8 @@ export const zhCN = {
installFailed: "安装或连接检查失败,原版本已保留。",
updateFailed: "自动更新失败,正在继续使用原版本。",
updateFailureReason: "失败原因:{{reason}}",
+ connectionFailureReason: "连接失败原因:{{reason}}",
+ connectionFailureUnknown: "桌面端未返回具体原因。请重新检查连接,并提供桌面端诊断日志。",
updateTimeoutHint: "下载或连接超时,请检查网络后重试。",
updateNetworkHint: "无法连接更新服务,请检查网络和系统代理后重试。",
retryUpdate: "重试更新",