Repository navigation
feat(desktop): 远程开发窗口保存 SSH 连接并测试连接,SSH 的询问在窗口中回答 (#2231) - #2256
Merged
Merged
Conversation
- 欢迎页“更多”菜单和标题栏项目菜单新增“远程开发”:左侧是已保存的连接,右侧是名称、主机、端口、用户名、认证方式、私钥和高级选项(ProxyJump、超时、保活)的表单。 - 连接列表由 Core 的 remote.connections / remote.editConnections 定义和检查,新包 remoteconn 只读写偏好目录里的 remote/connections.json,按读取时的字节原子写回;文件被改过时不覆盖,损坏时不写入。 - Core 拒绝某个字段时,原因显示在该字段下方;端口等数字在送给 Core 前先检查。 - “测试连接”调用 Core 的 RemoteProbe,显示系统、架构、CPU、内存和主目录磁盘;可以停止,关窗口时同样停止。 - OpenSSH 的密码、口令和主机指纹询问经 AskPass 回到窗口,和 Git 认证共用同一个提问框,问题带 Remote 标记,用 RemoteAuthRespond 回答;答案不保存。 - 保存新连接后列表选中行跟着表单走(Viva 的 Select 只能选到已声明的行,列表声明后再同步)。 - 日志只记 remote.* 动作,不含主机、用户名、私钥路径、提问原文和答案。 - Core 固定到 #145 的 d1a5b82(基于 main 7c1cd55),#145 合入后换 main 提交。 - 新增 i18n 词条、功能矩阵 remote-connections、Agent Note 与无头截图。
xiaoyumuxi
marked this pull request as ready for review
November 21, 2026 04:07
13 of 16 tasks
xiaoyumuxi
added a commit
that referenced
this pull request
Nov 21, 2026
- #2256 把 Core 固定在 d1a5b82。它是 #145 分支上的提交,不在 Core main 上。 这次换成 main 66a1476,带上已合入的五个 PR: #145 已保存的连接, #146 上传前核对清单哈希(S17), #148 ssh 子进程只保留白名单环境变量(S26), #149 server.state 补关闭确认所需字段, #147 端口转发的开始、停止和列出,以及监听端口所属进程(S28/S29)。 - 测试修复:core 和 workbench 的测试二进制同时充当 AskPass 助手。#148 之后,Core 只把 ssh 需要的环境变量交给助手。包级变量在初始化时读取 LITHE_PLUGIN_CONTRACT_DIR,这发生在 TestMain 判断助手模式之前,所以会崩溃。两处 fixture 路径改为函数,只在测试用到时读取。
This was referenced Nov 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
关联 Issue / Linked issue
PR 类型 / Type
改动说明 / What changes
背景 / Why
#2231 的远程开发要先能告诉 Lithe“连哪台机器、怎么登录”,并在打开项目前确认这台机器能用。Viva 桌面端还没有任何远程入口。本 PR 加上“远程开发”窗口:保存 SSH 连接、测试连接、在窗口里回答 OpenSSH 的密码/口令/指纹询问。连接的字段规则和文件格式在 Core(#145),桌面端只读写文件和呈现;窗口不保存任何秘密(设计 S12、S15)。
改动 / Changes
入口与窗口
desktop.remote.menuItem),打开remoteView(root.go的 overlays 里声明)。user@host:port)和“+”新建;右侧表单:名称、主机、端口、用户名、认证方式(自动 / SSH Agent / 私钥文件 / 密码)、私钥路径(带文件选择)、可折叠的“高级”(ProxyJump、连接超时、保活间隔)。主机、认证方式、私钥和列表标题有 ⓘ 说明。保存(
desktop/internal/remoteconn,新包)remote.connections拿相对路径和大小上限,再从平台偏好目录读remote/connections.json;没有文件时什么都不创建。remote.editConnections(save / remove),把 Core 返回的整份文档按“读取时的字节”原子写回(configfile),写完重新读取并显示。文件在读取后被改过时报ErrConflict,不覆盖;Core 解不开的文件报ErrDamaged,永不覆盖。{ field, reason }),原因显示在该字段下面;端口、超时等数字在送给 Core 前先检查。测试连接
core.RemoteProbe新增客户端(desktop/internal/core/remote.go),调用 Core 的探测;结果显示状态和主机名、系统与内核、CPU 数、内存、主目录磁盘。认证失败、指纹被拒、不可达、平台不支持分别有对应文字。GitAuthChallenge新增Remote字段,远程连接的问题进入和 Git 认证相同的队列与对话框,只换标题(“SSH 身份验证”)、提示和回答方法(RemoteAuthRespond)。细节
ListState.Select只能选到上一帧已声明的行,保存新行的那一帧会被截到旧的最后一行)。remote.connections.open、remote.connection.new/select/save/remove/test/test.stop、remote.authentication.answer/retry/cancel和失败/拒绝的固定原因,不含主机、用户名、私钥路径、OpenSSH 输出、提问原文和答案。scripts/desktop/build-desktop-core.sh:Core 固定到 fix(windows): polish desktop icon and welcome sidebar #145 的 d1a5b82(基于 main 7c1cd55,包含已合入的 继续优化 macOS 界面细节与更新了单文件编辑器体验 #143、【功能建议】win端允许应用内部检查更新 #144)。fix(windows): polish desktop icon and welcome sidebar #145 合入后换成 main 提交。shared/i18n/features/remote-connections.json)及生成结果;功能矩阵新增remote-connections;新增 Agent Note.agents/notes/implemented/feature/2026-11-21-remote-connections-window.md;截图在docs/assets/remote-connections/。不在本 PR 范围内 / Out of scope
remote.connect、远程文件夹选择与“最近文件夹”、标题与状态栏、最近项目、远程信任(S03/S04)——下一个 PR。ssh -G按用户的 SSH 配置解析,放在下一个 PR 的连接阶段由 Core 解析后回显。类型专属:feat
多平台对齐
desktop/下同一份 Go 代码,macOS 与 Windows 同时具备。Windows 上 OpenSSH 调用 GUI 子系统的lithe助手读取答案还没有实机验证,矩阵里两端都记为pending。platform-specific),理由:范围检查 / Scope checks
功能矩阵 / Feature matrix
shared/platform-feature-matrix/features/remote-connections.json:两端implemented/pending,证据为本 PR 的 Go 文件与测试,验证动作写明菜单入口、保存/改名/删除、字段拒绝、三种认证的测试连接、停止与关窗、日志内容./scripts/platform-feature-matrix/verify-platform-feature-matrix.sh(220 项通过)和./scripts/platform-feature-matrix/verify-platform-feature-matrix-change.sh origin/main HEAD(通过).artifacts/下生成的矩阵视图插件归属 / Plugin ownership
develop-lithe第三节的自查命令,结果为空UI 验证 / UI evidence
TestVisualRemoteConnections(提交 96f841d,窗口 1200×760,浅色英文、深色中文),检查了全部 6 张截图:LITHE_VISUAL_OUTPUT_DIR="$(pwd)/docs/assets/remote-connections",在desktop/下../scripts/desktop/desktop-go.sh test -tags vivahead,lithevisual ./internal/workbench -run '^TestVisualRemoteConnections$' -count=1user@host被拒绝,原因在字段下方统一日志系统 / Structured logging
app.action.performed、操作失败和操作被拒绝事件,新增的动作名和原因都在TestLogEventsMatchCatalog里逐条对照固定 Core 的目录remote_test.go用loggedAny断言界面文案 / i18n
shared/i18n/features/remote-connections.json(中英),运行了node scripts/i18n/generate-i18n.mjs并提交生成结果;代码经i18n.Shared/i18n.SharedFormat读取node scripts/i18n/verify-app-language-localization.mjs与node scripts/i18n/generate-i18n.mjs --check通过(中英 12018/12018)逻辑归属 / Logic placement
性能与内存 / Performance and memory
设置 / Settings
插件契约 / Plugin contract
N/A:没有改插件契约、能力版本或插件函数协议,也没有新增宿主方法。
PINNED_CORE_REVISION升到 d1a5b82 是为了 Core 的remote.connections/remote.editConnections接口。发行包与资源 / Bundle and resources
remote/connections.json(用户数据,本机专属,不进 app bundle 或安装目录,不跨工作树复制),生命周期写在remoteconn包注释里;./scripts/desktop/verify/verify-runtime-bundle-immutability.sh通过无用代码与重构 / Dead code and refactoring
answerGitAuth改成按问题来源选回答方法,原有 Git 路径不变)验证 / Verification
scripts/desktop/desktop-go.sh test ./... -count=1(对 Core d1a5b82)remote_view.go,之后重跑了下一行desktop-go.sh test ./internal/workbench -run 'Remote|GitAuth|CloneAsks|LogEventsMatchCatalog' -count=1TestRemoteSavedConnectionIsTheSelectedRow去掉syncListSelection后运行list row -1, want 0;恢复后通过TestRemoteTestAsksInTheWindowAndReportsTheHost/TestRemoteTestStopsWithTheWindow(PATH 上的替身 ssh,真实 Core 和 AskPass 助手)desktop-go.sh test -tags vivahead,lithevisual … TestVisualRemoteConnectionsdesktop-go.sh vet ./internal/workbench ./internal/remoteconn ./internal/core、gofmt -l desktop/internal desktop/cmdnode scripts/desktop/validate-pins.mjs./scripts/agent-notes/verify-agent-notes.sh、发行包只读校验、插件归属自查未能执行的检查和原因:
lithe助手的答案需要实机;替身 ssh 是 shell 脚本,相关两个测试在 Windows 上跳过。提交前确认 / Final checks
main(c2eb7a724)创建,目标main