fix(ssh): keep managed remote server ownership through stop - #215
fix(ssh): keep managed remote server ownership through stop#215leoisadev1 wants to merge 2 commits into
Conversation
SSH-managed servers started through npx/npm can outlive Disconnect because the launcher recorded the wrapper PID. Exec the resolved CLI, treat installer non-zero exits as failures, and keep ownership files when the remote process is still alive. Connect and disconnect on one target run in order. Adapted from pingdotgg#9843, pingdotgg#10088, and pingdotgg#10105. Implemented with Grok 4.6 High in Grok Build via Orca.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Greptile SummaryThis change improves SSH-managed Akeru server lifecycle handling by ensuring reconnect and disconnect work is ordered consistently, preserving remote process ownership, and surfacing shutdown failures. Confidence Score: 5/5Safe to merge. The reconnect/disconnect race is fully addressed: both operations acquire the same target lock before resolving the target, preventing a reconnect from returning a tunnel while an earlier disconnect is stopping it. The first prior thread was resolved by greptile-apps[bot] without explanation. leoisadev1 dismissed the retained-lock concern, accepting the risk because one semaphore per target for the desktop session is intentional and deleting it could allow a reconnect while shutdown is still running. Files Needing Attention: None. Reviews (2): Last reviewed commit: "fix(ssh): serialize target resolution wi..." | Re-trigger Greptile |
Acquire the per-target lock before SSH host resolution so a slow disconnect cannot lose the race to a later reconnect. Implemented with Grok 4.6 High in Grok Build via Orca.
Problem
SSH-managed servers started through npx/npm can outlive Disconnect or app shutdown. The launcher recorded the npm wrapper PID, so stop signaled npm while the server kept its listener and database open. A failed installer that printed a path could still launch, and a stop that timed out still deleted ownership files.
Fix
SshCommandError.External servers remain running. No remote force-kill was added.
Adaptation
Reviewed port of pingdotgg/t3code#9843, #10088, and #10105. Package and executable names stay
akeru-bot/akeru. Hosted relay was not added.Scope
This PR is SSH runner, install diagnostics, and stop ownership only. Cookie isolation is #208. LAN vs Tailscale pairing and Zed remote open are separate PRs.
Verification
vp test run packages/ssh: 54 passed, including POSIX runner PID ownership, installer ETARGET/network/empty-success/success paths, stop timeout keeping ownership files, disconnect failure retry, and per-target reconnect ordering.vp run --filter @t3tools/ssh typecheckexited 0.No live bot/group UI changed. Native remote SSH hosts were not used; tests run a real POSIX runner against fixture package managers and a local Node listener.
Implemented with Grok 4.6 High in Grok Build via Orca.