Consider it done. The open-source AI agent that works out of the box · 想到,就能做到。开源、开箱即用的 AI Agent。
TypeScript agentai-agentai-assistantandroidclaude-codecodexelectroniosllmmacosreact-nativetypescriptwindows
fix(device-link): cancel stale reopen retries
DavidShenbcb61b55b050
diff --git a/apps/desktop/src/main/device-link/index.ts b/apps/desktop/src/main/device-link/index.tsindex 7c4458eb94..e8870d0fba 100644--- a/apps/desktop/src/main/device-link/index.ts+++ b/apps/desktop/src/main/device-link/index.ts@@ -156,7 +156,7 @@ const pendingPeerLinkReopens = new Set<string>();let pendingPeerLinkReopenRetryTimer: ReturnType<typeof setTimeout> | null = null;function schedulePendingPeerLinkReopenRetry(): void {- if (pendingPeerLinkReopenRetryTimer !== null || linkTornDown) return;+ if (pendingPeerLinkReopenRetryTimer !== null || linkTornDown || pendingPeerLinkReopens.size === 0) return;if (arbiter && !arbiter.isOwner()) return;pendingPeerLinkReopenRetryTimer = setTimeout(() => {pendingPeerLinkReopenRetryTimer = null;@@ -184,6 +184,14 @@ function flushPendingPeerLinkReopens(): void {);}}++function cancelPendingPeerLinkReopen(deviceId: string): void {+ pendingPeerLinkReopens.delete(deviceId);+ if (pendingPeerLinkReopens.size === 0 && pendingPeerLinkReopenRetryTimer !== null) {+ clearTimeout(pendingPeerLinkReopenRetryTimer);+ pendingPeerLinkReopenRetryTimer = null;+ }+}/*** 持有者已生效的授权快照(允许被控开关 + 撤销名单)。用于检测**其它实例**改写共享* settings 文件(被动实例的设置页也能改授权,见 settings-store 多实例语义):持有者@@ -531,6 +539,9 @@ export function initDeviceLinkService(options: DeviceLinkServiceOptions = {}): v// shutdown/revoked/未知新值)都是永久关闭——必须终止已在进行的重开// 循环,否则刚被断开的控制链会被退避重试重新建起。routeLinkCloseForReopen(reason, transportTimeoutReopen, env.src);+ if (reason !== 'transport-timeout') {+ cancelPendingPeerLinkReopen(env.src);+ }if (reason === 'revoked') {// 撤权后在途请求会陆续超时——那不是「设备无响应」,是访问被收回。清熔断并// 作废在途结果(翻代),避免 unresponsive 状态与撤权状态并存(对齐 mobile 语义)。diff --git a/apps/desktop/src/renderer/i18n/locales/en/common.json b/apps/desktop/src/renderer/i18n/locales/en/common.jsonindex 9b476bb6a5..5b89a8405e 100644--- a/apps/desktop/src/renderer/i18n/locales/en/common.json+++ b/apps/desktop/src/renderer/i18n/locales/en/common.json@@ -10,7 +10,8 @@"REMOTE_MODEL_SWITCH_ROUTE_CHANGE": "The target model or source needs a different remote route — close and recreate the remote session to apply.","REMOTE_PROVIDER_UPDATING": "Provider credentials are being updated — retry in a moment","REMOTE_PROVIDER_UNSUPPORTED": "This provider is not supported in SSH remote sessions — pick another source",- "REMOTE_NATIVE_OAUTH_UNAVAILABLE": "Claude.ai subscription is not connected — connect it first or pick a gateway model"+ "REMOTE_NATIVE_OAUTH_UNAVAILABLE": "Claude.ai subscription is not connected — connect it first or pick a gateway model",+ "DEVICE_LINK_DEVICE_UNRESPONSIVE": "The target device is not responding. Check the remote device and try again."},"providerError": {"AUTH_INVALID": "Invalid or expired API key (401). Check the key and try again",diff --git a/apps/desktop/src/renderer/i18n/locales/ja/common.json b/apps/desktop/src/renderer/i18n/locales/ja/common.jsonindex 2d0be8cd46..6fab79e3dd 100644--- a/apps/desktop/src/renderer/i18n/locales/ja/common.json+++ b/apps/desktop/src/renderer/i18n/locales/ja/common.json@@ -10,7 +10,8 @@"REMOTE_MODEL_SWITCH_ROUTE_CHANGE": "対象のモデルまたはソースは別のリモートルートが必要です。リモートセッションを閉じて再作成してください。","REMOTE_PROVIDER_UPDATING": "プロバイダーの認証情報を更新中です。しばらくしてから再試行してください","REMOTE_PROVIDER_UNSUPPORTED": "このプロバイダーは SSH リモートセッションに対応していません。別のソースを選択してください",- "REMOTE_NATIVE_OAUTH_UNAVAILABLE": "Claude.ai サブスクリプションが未接続です。先に接続するか、ゲートウェイモデルを選択してください"+ "REMOTE_NATIVE_OAUTH_UNAVAILABLE": "Claude.ai サブスクリプションが未接続です。先に接続するか、ゲートウェイモデルを選択してください",+ "DEVICE_LINK_DEVICE_UNRESPONSIVE": "対象デバイスが応答していません。リモートデバイスを確認して再試行してください。"},"providerError": {"AUTH_INVALID": "API キーが無効か期限切れです(401)。キーを確認して再試行してください",diff --git a/apps/desktop/src/renderer/i18n/locales/ko/common.json b/apps/desktop/src/renderer/i18n/locales/ko/common.jsonindex 0ff4779313..3ba4f2b728 100644--- a/apps/desktop/src/renderer/i18n/locales/ko/common.json+++ b/apps/desktop/src/renderer/i18n/locales/ko/common.json@@ -10,7 +10,8 @@"REMOTE_MODEL_SWITCH_ROUTE_CHANGE": "대상 모델 또는 소스에 다른 원격 라우트가 필요합니다. 원격 세션을 닫고 다시 생성하세요.","REMOTE_PROVIDER_UPDATING": "제공자 자격 증명을 업데이트하는 중입니다. 잠시 후 다시 시도하세요","REMOTE_PROVIDER_UNSUPPORTED": "이 제공자는 SSH 원격 세션을 지원하지 않습니다. 다른 소스를 선택하세요",- "REMOTE_NATIVE_OAUTH_UNAVAILABLE": "Claude.ai 구독이 연결되지 않았습니다. 먼저 연결하거나 게이트웨이 모델을 선택하세요"+ "REMOTE_NATIVE_OAUTH_UNAVAILABLE": "Claude.ai 구독이 연결되지 않았습니다. 먼저 연결하거나 게이트웨이 모델을 선택하세요",+ "DEVICE_LINK_DEVICE_UNRESPONSIVE": "대상 장치가 응답하지 않습니다. 원격 장치를 확인한 후 다시 시도하세요."},"providerError": {"AUTH_INVALID": "API 키가 유효하지 않거나 만료되었습니다(401). 키를 확인한 후 다시 시도하세요",diff --git a/apps/desktop/src/renderer/i18n/locales/zh-CN/common.json b/apps/desktop/src/renderer/i18n/locales/zh-CN/common.jsonindex 4b9254db8c..934d8c96a2 100644--- a/apps/desktop/src/renderer/i18n/locales/zh-CN/common.json+++ b/apps/desktop/src/renderer/i18n/locales/zh-CN/common.json@@ -7,6 +7,7 @@"REMOTE_PROVIDER_UPDATING": "供应商凭证正在更新,请稍后重试","REMOTE_PROVIDER_UNSUPPORTED": "该供应商不支持 SSH 远程会话,请更换来源","REMOTE_NATIVE_OAUTH_UNAVAILABLE": "未连接 Claude.ai 订阅,请先连接或选择网关模型",+ "DEVICE_LINK_DEVICE_UNRESPONSIVE": "目标设备长时间无响应,请检查远程设备后重试","REMOTE_WORKDIR_INVALID": "远程项目目录无效,请重新选择项目目录。","REMOTE_WORKDIR_NOT_FOUND": "远程项目目录不存在,请重新选择项目目录。","REMOTE_WORKDIR_NOT_DIRECTORY": "远程项目路径不是文件夹,请重新选择项目目录。",