Skip to content

armgit / cindy

Public Imported from GitHub
0

Consider it done. The open-source AI agent that works out of the box · 想到,就能做到。开源、开箱即用的 AI Agent。

fix(maker-remote-ssh,desktop): 处理 greptile R4 的两条 review 意见

yanf079827577a2
diff --git a/apps/desktop/src/renderer/components/settings/RemoteHostDetail.tsx b/apps/desktop/src/renderer/components/settings/RemoteHostDetail.tsx
index 19ead9a086..f7303537d3 100644
--- a/apps/desktop/src/renderer/components/settings/RemoteHostDetail.tsx
+++ b/apps/desktop/src/renderer/components/settings/RemoteHostDetail.tsx
@@ -284,6 +284,11 @@ function AgentProxyTunnelCard({ hostId }: { hostId: string }) {
icon = <AlertCircle size={14} />;
text = t('settings.remote.detail.agentProxyError', { message: tunnel.lastError });
isError = true;
+ } else if (snap?.status !== 'ready') {
+ // 主机断连时隧道已 disarm 且没有在途的建立动作 — 不能渲染
+ // 「建立中」spinner (误导, review: PR #715 greptile R4)。
+ icon = <AlertCircle size={14} />;
+ text = t('settings.remote.detail.agentProxyWaiting', { target: localTarget });
} else {
icon = <Spinner size={12} />;
text = t('settings.remote.detail.agentProxyPending', { target: localTarget });
diff --git a/apps/desktop/src/renderer/i18n/locales/en/common.json b/apps/desktop/src/renderer/i18n/locales/en/common.json
index f125bf4c1e..551983030a 100644
--- a/apps/desktop/src/renderer/i18n/locales/en/common.json
+++ b/apps/desktop/src/renderer/i18n/locales/en/common.json
@@ -290,6 +290,7 @@
"agentProxyTitle": "Agent proxy tunnel",
"agentProxyActive": "Remote 127.0.0.1:{{port}} → local {{target}} · established",
"agentProxyPending": "Establishing tunnel → local {{target}}",
+ "agentProxyWaiting": "Host not connected; tunnel will be established on reconnect → local {{target}}",
"agentProxyError": "Tunnel failed: {{message}}",
"button": {
"install": "Install",
diff --git a/apps/desktop/src/renderer/i18n/locales/ja/common.json b/apps/desktop/src/renderer/i18n/locales/ja/common.json
index 5a86715737..dd4fa0f7b9 100644
--- a/apps/desktop/src/renderer/i18n/locales/ja/common.json
+++ b/apps/desktop/src/renderer/i18n/locales/ja/common.json
@@ -290,6 +290,7 @@
"agentProxyTitle": "Agent プロキシトンネル",
"agentProxyActive": "リモート 127.0.0.1:{{port}} → ローカル {{target}} · 確立済み",
"agentProxyPending": "トンネル確立中 → ローカル {{target}}",
+ "agentProxyWaiting": "ホスト未接続 — 再接続後に自動確立 → ローカル {{target}}",
"agentProxyError": "トンネルの確立に失敗: {{message}}",
"button": {
"install": "インストール",
diff --git a/apps/desktop/src/renderer/i18n/locales/ko/common.json b/apps/desktop/src/renderer/i18n/locales/ko/common.json
index 160a3f0e03..60ddc4f913 100644
--- a/apps/desktop/src/renderer/i18n/locales/ko/common.json
+++ b/apps/desktop/src/renderer/i18n/locales/ko/common.json
@@ -290,6 +290,7 @@
"agentProxyTitle": "Agent 프록시 터널",
"agentProxyActive": "원격 127.0.0.1:{{port}} → 로컬 {{target}} · 설정됨",
"agentProxyPending": "터널 설정 중 → 로컬 {{target}}",
+ "agentProxyWaiting": "호스트 미연결 — 재연결 후 자동 설정 → 로컬 {{target}}",
"agentProxyError": "터널 설정 실패: {{message}}",
"button": {
"install": "설치",
diff --git a/apps/desktop/src/renderer/i18n/locales/zh-CN/common.json b/apps/desktop/src/renderer/i18n/locales/zh-CN/common.json
index 4ca12c12ec..ecf19349bc 100644
--- a/apps/desktop/src/renderer/i18n/locales/zh-CN/common.json
+++ b/apps/desktop/src/renderer/i18n/locales/zh-CN/common.json
@@ -290,6 +290,7 @@
"agentProxyTitle": "Agent Proxy 隧道",
"agentProxyActive": "远端 127.0.0.1 端口 {{port}} → 本机 {{target}} · 已建立",
"agentProxyPending": "隧道建立中 → 本机 {{target}}",
+ "agentProxyWaiting": "主机未连接,重连后自动建立 → 本机 {{target}}",
"agentProxyError": "隧道建立失败:{{message}}",
"button": {
"install": "安装",
@@ -7377,7 +7378,6 @@
"cancelFailed": "取消订阅失败,请稍后重试。"
},
"topupCard": {
-
"action": "购买点数"
}
},
diff --git a/packages/maker-remote-ssh/src/RemoteHost.ts b/packages/maker-remote-ssh/src/RemoteHost.ts
index ae7a3d036e..5f1817861f 100644
--- a/packages/maker-remote-ssh/src/RemoteHost.ts
+++ b/packages/maker-remote-ssh/src/RemoteHost.ts
@@ -843,7 +843,9 @@ export class RemoteHost {
const now = Date.now();
if (now - rec.lastLocalErrorAt > 30_000) {
rec.lastLocalErrorAt = now;
- const suppressed = rec.localErrorCount - rec.lastLocalErrorLoggedCount;
+ // 距上次日志被吞掉的条数, 不含本次 (localErrorCount 已含本次, -1 扣除;
+ // 否则首条日志就会误报 suppressed=1, review: PR #715 greptile R4)。
+ const suppressed = rec.localErrorCount - rec.lastLocalErrorLoggedCount - 1;
rec.lastLocalErrorLoggedCount = rec.localErrorCount;
this.log.warn('ssh remote forward: local target unreachable', {
id: this.id,