(remote): stop a remote session for real, behind the same dialog as a local one - #272
Merged
Merged
Conversation
… local one Part of #246 (lifecycle verbs). A remote row's stop control now goes through remote-stop-session: the descriptor pid is re-probed on the host (refused if it no longer names a claude CLI), then the narrowest tmux scope is killed (pane, else window — never the shared session), else TERM then KILL by pid. Closing a remote tab stays a detach. The descriptor is dropped and the host refreshed at once; the adapter marks the row dead.
…led stop Review follow-up on the remote stop. The projection marks a row whose process is alive (.is-alive) and the stop control shows for it, attached or not; a failed stop leaves activePtyIds and the open view untouched and flashes the button instead of logging only; the tmux kill path polls /proc before claiming success and falls through to the pid path; the main handler's ok-guarded fan-out is pinned by a source check.
Owner
Author
|
Review follow-up pushed (second commit):
Deferred, documented under "Known limits" in
|
This was referenced Sep 12, 2026
Merged
Closed
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.
Lifecycle verbs decided on #246 (2026-09-11): detach closes the view, stop terminates the process — for remote rows too, behind the same control and the same confirmation dialog as a local one. #271 tracks the bulk archive/delete sites.
What
remote-stop.js:buildStopCommand(pid, tmuxTarget)andcreateRemoteStopAdapter().stop(alias, descriptor). The command runs the pid-reuse guard first (buildProcCmdlineCheckfromremote-attach.js, same wording: a pid that no longer names a claude CLI is refused, nothing is killed), then the narrowest tmux scope —kill-pane -t <target>when the target names a pane,kill-windowwhen it names only a window, neverkill-session(several CLIs share one tmux session on the VPS) — elsekill -TERM, poll/proc/<pid>for ~3 s,kill -KILLonce. Returns{ ok, method: 'tmux-pane'|'tmux-window'|'pid-term'|'pid-kill', error }. Pid is integer-validated, target regex-validated (TMUX_FIELD_RE), alias is its own argv element; no backticks.main.js: IPCremote-stop-session({ alias, sessionId }); on success drops the descriptor (remote-index.js dropRemoteSession), forcesrefreshHostNow(alias), and closes the local PTY holding the attach if any.preload.js:remoteStopSession.public/stop-session-ui.js: pureresolveSessionStop(session)→ which IPC and which dialog text (host alias shown for remote);app.js confirmAndStopSessionroutes through it. One dialog component. Closing a remote tab stays a detach ((remote): make a solo tmux attach look and behave like a local terminal #256 restore path untouched).remote-activity-ui.js applyRemoteStopped:liveness:'dead',attached:false, timers purged.ipc-bridge.md,session-state.md(verbs section),docs/session-browser.md.Proof
test/remote-stop.test.js(16): guard runs before either path (mutation: guard emptied → red); pane →kill-pane, window →kill-window;kill-sessionnever appears for any input (mutation: forced back → 3 red); adapter with a fake runner: success, refusal, ssh failure.test/stop-session-ui.test.js: local →stopSession, remote →remoteStopSessionwith the alias in the dialog text.remote-index,remote-activity-ui,terminal-manager-lifecycleadditions.task check: 1255 + 119 pass, 0 fail, pre-existing skips.Not verified on the wire: the kill command against the real host (tests only). Next: #271.