Conversation
Register tauri-plugin-window-state with SIZE|MAXIMIZED flags only: POSITION would fight multi-monitor layouts, VISIBLE would re-show a tray-hidden window on startup, and DECORATIONS would override the per-platform window chrome. app_restart bypasses RunEvent::Exit where the plugin normally flushes to disk, so it saves state explicitly before restarting. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Editing an SSH host used to leave established connections running on the old configuration with no feedback and no way to apply the update short of closing the session. - Saving connection-affecting changes (host/port/username/auth/proxy/new secrets) now detects active sessions for that host and offers to reconnect them immediately or keep them until the next reconnect; the reconnect waits for the settings save to land before running. - New manual reconnect action on SSH tunnel panel rows and the terminal overlay header (also revives sessions whose automatic reconnect attempts were exhausted). - Deleting a host with active connections now warns with the count and closes those sessions before removing the host. - Rust: TerminalSessionRegistry::ssh_reconnect tears down the current connection directly (never via the shutdown channel, which would kill a freshly installed handle) under the reconnect-runner mutex, then reuses reconnect_ssh_session so the latest stored config is picked up; reconnect_ssh_session now re-checks closing after install to avoid resurrecting a session closed mid-reconnect. - Gateway: new terminal action "ssh_reconnect" (no proto changes), gated with the session-scoped SSH permission group on both the Rust handler and the Go relay. - keyboard-interactive hosts cannot re-auth inside the reconnect path: the settings dialog degrades to a notice, the tunnel panel offers close-and-recreate through the full prompt flow, and the overlay points at the panel. - SshSection.tsx, lib/terminal/types.ts and confirm-dialog.tsx are now registered in the mirror manifest; platform differences stay in the web invoke shim. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
问题
在设置页修改已有活跃连接的 SSH 主机信息后,已建立的连接继续用旧配置运行:SSH 保存只写库、无任何联动钩子,配置只在下一次连接或断线自动重连时才被重新读取,用户既得不到提示,也没有让新配置立即生效的手段(会话 UI 只有"关闭",没有手动重连)。
方案
保存时弹窗询问
手动重连按钮(双端)
disconnected会话也可点,兼做断线复活。chat SSHManager 工具创建的会话在同一 registry,天然覆盖。删除主机警告并断开
Rust 核心:
TerminalSessionRegistry::ssh_reconnectreconnect_runner互斥位后直接 disconnect + clear 拆除旧连接(绝不走 shutdown 通道——writer 任务会 disconnect 共享槽内"当前"句柄,新连接装入后会被误杀);随后复用reconnect_ssh_session(本就重读最新配置)即时单次重连。孤儿 IO 泵依靠互斥位与连接代次守卫自然退出。reconnect_ssh_session在install_connection后复查is_closing,防止批量关闭与进行中的重连交叠时装回幽灵连接。网关:零 proto 改动
"ssh_reconnect",Rust 端进 session-scoped SSH 门控组,Go relay 进WebSshTerminalEnabled组;web 端经terminal.<action>通用编码透传。kbi(keyboardInteractive)降级
镜像纪律
pages/settings/SshSection.tsx、lib/terminal/types.ts、components/ui/confirm-dialog.tsx保持双端字节一致并新入 mirror-manifest;平台差异收敛在 web 的 invoke shim(新增 terminal_list/terminal_close/terminal_ssh_reconnect 三个映射)。SshTunnelPanel与WorkspaceSshTerminalOverlay仍为手动镜像差异版,已逐块同步。验证
node scripts/check-mirror.mjs:100 个镜像文件全部一致cargo test557 通过(含新增 3 个ssh_reconnect并发守卫测试:missing session / closing / 互斥占用不误释放)npm run test:frontend1176 通过;Web 前端:npm test403 通过go build ./...、go test ./internal/protocol/...通过tsc --noEmit与 biome 对改动文件零错误手动验证建议(自动化覆盖不到真实连接):
[SSH] Reconnected after attempt 1;对 disconnected 会话点击可复活。🤖 Generated with Claude Code