Skip to content

feat(ssh): 支持从本地更新并重启远端服务 - #102

Open
uiliugang wants to merge 1 commit into
mainfrom
lg/ssh-remote-auto-update
Open

uiliugang wants to merge 1 commit into
mainfrom
lg/ssh-remote-auto-update

Conversation

@uiliugang

Copy link
Copy Markdown
Owner

Problem

SSH 环境不具备服务端自更新能力时,本地更新按钮只复制重启命令,用户仍需登录远端手动停止和升级服务。

Change

将该按钮接入桌面端已有的 SSH 服务管理链路:确认重启后,下载并校验指定版本,再停止当前实例、启动新版并等待目标版本重新连接。支持 SSH 托管实例,以及通过默认 T3 home 运行记录确认的手动启动实例;下载失败保留旧进程和启动器,停止失败时不启动第二个实例。

更新后的版本用于后续 SSH 重连。设置中的批量更新、侧栏更新全部和聊天提示共用相同更新路径;保留维护权限、管理策略、环境身份校验及跨发布轨道限制。已有原生自更新能力继续使用原有流程,普通网页和移动端维持现有行为。

Scope and approval

按仓库所有者明确提出的 SSH 远端自动更新需求实现,PR 提交到 uiliugang/t3code,范围限于现有 SSH 环境管理与更新入口,不向上游提交。

Verification

  • vp run check:changed 全部通过:格式、lint、knip、受影响包及依赖的类型检查、7 个测试文件的 101 项测试、React Compiler 检查。
  • 真实子进程测试覆盖托管和手动启动实例:版本准备成功后旧 PID 退出并产生新的托管 PID;准备失败时旧 PID 仍运行且启动器内容不变。
  • 回归测试覆盖非法版本不会关闭现有隧道、更新后重连保持目标版本、更新失败、旧版本 ready 事件不会被当作更新成功,以及批量更新的发布轨道过滤。
  • T3 内置浏览器中使用隔离夹具挂载实际更新按钮和确认框:取消后远端调用数为 0;确认后依次发出身份预检及 targetVersion: 0.1.8,模拟下载失败触发错误通知回调。未对用户实际 SSH 设备执行停服或升级。
  • 真实 Electron 到 SSH 主机的整机更新尚未验证。浏览器验收使用模拟桌面桥,实际远端进程替换由真实子进程测试覆盖。
  • 已保留本地截图和交互录屏;当前 GitHub CLI 无附件上传命令,本次未上传 GitHub 图片附件,未将验收素材提交到仓库。

模型:gpt-6.1-sol;运行框架:Codex(T3 Code)。

@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:L labels Nov 11, 2026
@github-actions

Copy link
Copy Markdown

Thread transfer impact

✅ Thread transfer remains within every enforced ceiling.

ℹ️ The exact PR base did not have a successful artifact. Baseline uses the latest successful main measurement shown below.

Provider Metric Main baseline This PR Impact PR ceiling
Codex Total thread wire 5.0 KiB 5.0 KiB 0 B (0.0%) 6.8 KiB ✅
Codex Thread snapshot wire 3.8 KiB 3.8 KiB 0 B (0.0%) 4.9 KiB ✅
Codex Live turn WebSocket wire 1.2 KiB 1.2 KiB 0 B (0.0%) 2.0 KiB ✅
Codex Live turn WebSocket decoded 21.5 KiB 21.5 KiB 0 B (0.0%) 24.4 KiB ✅
Codex Live turn messages 1 1 0 (0.0%) 8 ✅
Claude Total thread wire 5.0 KiB 5.0 KiB 0 B (0.0%) 6.8 KiB ✅
Claude Thread snapshot wire 3.8 KiB 3.8 KiB 0 B (0.0%) 4.9 KiB ✅
Claude Live turn WebSocket wire 1.2 KiB 1.2 KiB 0 B (0.0%) 2.0 KiB ✅
Claude Live turn WebSocket decoded 21.9 KiB 21.9 KiB 0 B (0.0%) 24.4 KiB ✅
Claude Live turn messages 1 1 0 (0.0%) 8 ✅

Baseline: 9324cfa · PR result: 0eab1e0 · Source CI: cancelled

Scenario and decoded snapshot size

10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.

  • Codex decoded thread snapshot: 108.5 KiB
  • Claude decoded thread snapshot: 108.8 KiB

Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant