Jinwoo Hong
1f86f980c5
fix(ssh): let terminate reach remote PTYs the app gave up reattaching ( #12642 )
...
Every SSH reattach failure abandons the remote terminal without shutting it down, and abandoned terminals then became structurally unreachable — excluded from reattach enumeration and, critically, filtered out of the user-facing "Terminate sessions" action, so a user could not kill them even manually.
The core problem is a naming trap: `expired` never meant the remote shell died. It means the app gave up reattaching. It is written on reattach failure, on spawn-time expiry, and in bulk by a relay reset inside a `finally` that runs even when the force-stop threw. So the leases most likely to name a still-live orphan were exactly the ones the terminate path excluded.
This change is reachability only. Expired leases are now reachable by an explicit user-initiated terminate, with the relay's response used as evidence: a shutdown that reports the PTY gone tombstones the lease, and leases already proven terminated are left alone.
**No automatic kills were added.** Every abandon path was enumerated and none of them proves abandonment: attempts-exhausted knows nothing (the relay never answered), identity mismatch means a *live* PTY belongs to a different pane so killing it would destroy someone else's terminal, and not-found is the one branch with real proof of death — where the process is already gone and needs no shutdown. Per the rule that unprovable liveness never authorizes destroying a session, the abandon paths deliberately leave the process running.
Relay-side automatic collection of unattached PTYs is deliberately NOT implemented: the relay cannot distinguish an abandoned terminal from a deliberately detached one, and the unlimited default grace exists precisely so long-running work survives disconnects and host sleep. Any bounded reaper would be killing on absence of evidence.
Verified: 3 tests red on main. Negative tests assert each abandon path leaves the shell running and the lease terminable, proven real by mutation — adding a shutdown to the exhausted branch or expiring on identity mismatch each turns them red.
Fixes STA-3376.
2026-08-04 23:07:34 -07:00
..
2026-06-23 11:31:41 -07:00
2026-07-14 00:15:34 -07:00
2026-07-17 12:47:04 -07:00
2026-07-14 00:15:34 -07:00
2026-07-14 00:15:34 -07:00
2026-07-14 00:15:34 -07:00
2026-07-14 00:15:34 -07:00
2026-05-30 21:20:37 -07:00
2026-08-03 16:17:00 -07:00
2026-08-03 16:17:00 -07:00
2026-07-20 17:10:07 -07:00
2026-08-03 16:17:00 -07:00
2026-08-03 16:17:00 -07:00
2026-08-03 16:17:00 -07:00
2026-08-03 16:17:00 -07:00
2026-07-23 18:35:31 -07:00
2026-07-23 18:35:31 -07:00
2026-05-31 04:21:57 -07:00
2026-07-11 21:43:20 -07:00
2026-07-11 01:31:13 -07:00
2026-08-04 19:07:23 -07:00
2026-08-03 13:02:56 -07:00
2026-08-04 19:07:23 -07:00
2026-06-28 22:33:07 -07:00
2026-06-02 18:10:31 -07:00
2026-07-12 23:19:15 -07:00
2026-07-12 23:19:15 -07:00
2026-07-31 18:33:26 -07:00
2026-07-24 18:30:54 -07:00
2026-07-24 18:30:54 -07:00
2026-06-02 18:10:31 -07:00
2026-07-18 15:16:43 -07:00
2026-07-18 15:16:43 -07:00
2026-05-11 14:20:08 -07:00
2026-05-25 14:54:47 -07:00
2026-08-04 20:42:11 -07:00
2026-07-15 14:30:33 -07:00
2026-08-04 20:42:11 -07:00
2026-07-23 19:12:54 -07:00
2026-07-23 19:12:54 -07:00
2026-07-28 21:57:41 -07:00
2026-07-28 21:57:41 -07:00
2026-07-28 17:08:14 -07:00
2026-07-28 17:08:14 -07:00
2026-07-31 00:51:39 -07:00
2026-07-31 00:51:39 -07:00
2026-07-06 02:12:32 -07:00
2026-07-27 20:54:02 -07:00
2026-06-19 17:14:55 -07:00
2026-06-19 17:14:55 -07:00
2026-07-23 18:35:31 -07:00
2026-07-23 18:35:31 -07:00
2026-07-23 18:35:31 -07:00
2026-07-27 01:14:33 -07:00
2026-07-27 01:14:33 -07:00
2026-07-27 01:14:33 -07:00
2026-07-27 20:54:02 -07:00
2026-07-23 18:35:31 -07:00
2026-07-29 19:58:10 -07:00
2026-08-02 00:33:57 -07:00
2026-07-29 19:58:10 -07:00
2026-07-29 19:58:10 -07:00
2026-07-06 16:43:43 -07:00
2026-07-20 03:18:24 -07:00
2026-07-18 23:01:29 -07:00
2026-07-23 18:35:31 -07:00
2026-07-23 18:35:31 -07:00
2026-07-23 18:35:31 -07:00
2026-07-23 18:35:31 -07:00
2026-07-22 18:25:05 -07:00
2026-07-23 18:35:31 -07:00
2026-07-23 18:35:31 -07:00
2026-07-16 13:26:15 -07:00
2026-07-23 18:35:31 -07:00
2026-07-23 00:27:06 -07:00
2026-07-23 18:35:31 -07:00
2026-07-23 18:35:31 -07:00
2026-07-29 21:43:45 -07:00
2026-07-29 21:43:45 -07:00
2026-06-29 22:38:29 -07:00
2026-07-23 18:35:31 -07:00
2026-06-29 22:38:29 -07:00
2026-07-24 18:18:40 -07:00
2026-05-20 01:35:56 -07:00
2026-05-20 01:35:56 -07:00
2026-07-10 13:48:35 -07:00
2026-07-10 13:48:35 -07:00
2026-08-01 11:55:58 -07:00
2026-07-24 17:37:01 -07:00
2026-07-24 17:37:01 -07:00
2026-06-10 21:14:53 -07:00
2026-08-01 11:55:58 -07:00
2026-08-01 11:55:58 -07:00
2026-07-24 17:37:01 -07:00
2026-07-29 18:21:26 -07:00
2026-07-28 15:30:07 -07:00
2026-07-24 17:37:01 -07:00
2026-07-26 22:39:32 -07:00
2026-07-26 22:39:32 -07:00
2026-08-01 11:55:58 -07:00
2026-08-01 11:55:58 -07:00
2026-08-04 20:05:30 -07:00
2026-08-04 20:05:30 -07:00
2026-05-21 02:49:16 -04:00
2026-05-21 02:49:16 -04:00
2026-07-25 22:48:53 -07:00
2026-07-25 22:48:53 -07:00
2026-07-25 22:48:53 -07:00
2026-07-27 20:54:02 -07:00
2026-08-03 22:48:37 -07:00
2026-08-03 22:48:37 -07:00
2026-07-10 00:11:27 -07:00
2026-08-01 15:50:54 -07:00
2026-08-01 15:50:54 -07:00
2026-07-29 19:50:18 -07:00
2026-07-29 19:50:18 -07:00
2026-07-29 19:50:18 -07:00
2026-07-27 01:14:33 -07:00
2026-07-27 01:14:33 -07:00
2026-07-09 22:23:56 -07:00
2026-07-09 22:23:56 -07:00
2026-07-30 18:27:16 -07:00
2026-07-23 18:35:31 -07:00
2026-07-23 18:35:31 -07:00
2026-07-28 14:04:41 -07:00
2026-08-04 02:03:40 -07:00
2026-07-23 18:35:31 -07:00
2026-07-23 18:35:31 -07:00
2026-04-26 21:42:06 -07:00
2026-07-05 01:15:16 -07:00
2026-07-05 01:15:16 -07:00
2026-08-03 23:25:44 -07:00
2026-08-03 23:25:44 -07:00
2026-07-23 18:35:31 -07:00
2026-07-23 18:35:31 -07:00
2026-07-23 18:35:31 -07:00
2026-07-23 18:35:31 -07:00
2026-07-23 18:35:31 -07:00
2026-07-09 19:30:23 -07:00
2026-05-30 02:46:28 -07:00
2026-07-23 18:35:31 -07:00
2026-07-23 18:35:31 -07:00
2026-05-08 14:17:50 -07:00
2026-06-02 18:10:31 -07:00
2026-07-09 02:13:13 -07:00
2026-07-09 02:13:13 -07:00
2026-07-09 02:13:13 -07:00
2026-08-01 19:22:39 -07:00
2026-08-01 19:22:39 -07:00
2026-07-12 18:15:15 -07:00
2026-07-15 15:23:35 -07:00
2026-07-15 15:23:35 -07:00
2026-07-15 15:23:35 -07:00
2026-07-15 15:23:35 -07:00
2026-07-15 15:23:35 -07:00
2026-07-15 15:23:35 -07:00
2026-07-15 15:23:35 -07:00
2026-07-15 15:23:35 -07:00
2026-07-15 15:23:35 -07:00
2026-07-12 18:15:15 -07:00
2026-07-15 15:23:35 -07:00
2026-07-15 15:23:35 -07:00
2026-07-15 15:23:35 -07:00
2026-07-12 18:15:15 -07:00
2026-07-12 18:15:15 -07:00
2026-08-02 00:33:57 -07:00
2026-07-12 18:15:15 -07:00
2026-07-15 15:23:35 -07:00
2026-07-15 15:23:35 -07:00
2026-07-15 15:23:35 -07:00
2026-07-15 15:23:35 -07:00
2026-07-15 15:23:35 -07:00
2026-07-15 15:23:35 -07:00
2026-07-15 15:23:35 -07:00
2026-07-12 18:15:15 -07:00
2026-07-12 21:34:59 -07:00
2026-07-15 15:23:35 -07:00
2026-07-15 15:23:35 -07:00
2026-07-15 15:23:35 -07:00
2026-08-02 00:33:57 -07:00
2026-07-15 15:23:35 -07:00
2026-07-15 15:23:35 -07:00
2026-07-15 15:23:35 -07:00
2026-07-15 15:23:35 -07:00
2026-07-15 15:23:35 -07:00
2026-07-15 15:23:35 -07:00
2026-07-15 15:23:35 -07:00
2026-07-23 18:35:31 -07:00
2026-07-23 18:35:31 -07:00
2026-07-23 18:35:31 -07:00
2026-07-23 18:35:31 -07:00
2026-07-27 01:14:33 -07:00
2026-07-27 01:14:33 -07:00
2026-07-27 01:14:33 -07:00
2026-07-27 01:14:33 -07:00
2026-07-27 21:43:41 -07:00
2026-07-09 17:08:35 -07:00
2026-07-18 15:16:43 -07:00
2026-06-15 19:41:45 -07:00
2026-06-28 15:08:13 -07:00
2026-06-17 16:08:14 -07:00
2026-07-27 21:43:41 -07:00
2026-07-11 21:21:18 -07:00
2026-07-11 21:21:18 -07:00
2026-06-29 22:38:29 -07:00
2026-07-30 18:27:16 -07:00
2026-07-27 21:43:41 -07:00
2026-06-29 22:38:29 -07:00
2026-07-10 17:27:47 -07:00
2026-07-19 17:31:34 -07:00
2026-08-03 12:47:41 -07:00
2026-08-03 12:47:41 -07:00
2026-07-29 17:03:15 -07:00
2026-07-25 02:38:20 -07:00
2026-07-25 02:38:20 -07:00
2026-07-25 02:38:20 -07:00
2026-07-25 02:38:20 -07:00
2026-07-29 17:03:15 -07:00
2026-07-29 17:03:15 -07:00
2026-07-10 17:27:47 -07:00
2026-07-10 17:27:47 -07:00
2026-07-02 18:41:23 -04:00
2026-06-19 17:14:55 -07:00
2026-08-04 22:59:06 -07:00
2026-08-04 22:59:06 -07:00
2026-07-24 14:42:04 -07:00
2026-07-24 14:42:04 -07:00
2026-06-30 00:28:07 -07:00
2026-06-30 00:28:07 -07:00
2026-07-27 17:53:41 -07:00
2026-07-27 20:54:02 -07:00
2026-08-01 14:49:33 -07:00
2026-08-01 14:49:33 -07:00
2026-05-31 06:42:33 -07:00
2026-05-15 12:32:07 -07:00
2026-06-29 22:38:29 -07:00
2026-07-06 02:12:32 -07:00
2026-07-23 18:35:31 -07:00
2026-07-23 18:35:31 -07:00
2026-08-03 23:11:36 -07:00
2026-08-03 23:11:36 -07:00
2026-07-15 19:14:22 -07:00
2026-07-15 19:14:22 -07:00
2026-07-25 15:38:35 -07:00
2026-07-23 18:35:31 -07:00
2026-07-23 18:35:31 -07:00
2026-08-04 01:26:48 -07:00
2026-07-29 18:57:50 -07:00
2026-07-03 19:40:45 -04:00
2026-08-04 01:26:48 -07:00
2026-06-29 22:38:29 -07:00
2026-06-17 16:08:14 -07:00
2026-07-23 18:35:31 -07:00
2026-07-30 00:31:34 -07:00
2026-07-30 00:31:34 -07:00
2026-07-30 00:31:34 -07:00
2026-07-27 01:43:44 -07:00
2026-08-02 00:33:57 -07:00
2026-07-22 18:25:05 -07:00
2026-07-22 18:25:05 -07:00
2026-07-27 12:31:37 -07:00
2026-06-14 01:48:26 -07:00
2026-07-22 18:25:05 -07:00
2026-07-23 18:35:31 -07:00
2026-06-29 22:38:29 -07:00
2026-07-27 12:31:37 -07:00
2026-08-03 19:44:30 -07:00
2026-08-03 19:44:30 -07:00
2026-07-15 15:23:35 -07:00
2026-07-15 15:23:35 -07:00
2026-07-15 15:23:35 -07:00
2026-07-15 15:23:35 -07:00
2026-07-15 15:23:35 -07:00
2026-07-15 15:23:35 -07:00
2026-07-15 15:23:35 -07:00
2026-07-15 15:23:35 -07:00
2026-07-15 15:23:35 -07:00
2026-07-23 18:03:43 -07:00
2026-07-23 18:03:43 -07:00
2026-07-15 19:09:14 -07:00
2026-07-15 22:09:37 -07:00
2026-07-31 13:03:11 -07:00
2026-07-31 13:03:11 -07:00
2026-08-01 13:38:45 -07:00
2026-08-01 13:38:45 -07:00
2026-07-27 19:11:57 -07:00
2026-07-28 14:37:31 -07:00
2026-07-25 19:31:44 -07:00
2026-08-04 20:05:30 -07:00
2026-05-01 13:25:22 -07:00
2026-07-23 18:35:31 -07:00
2026-07-23 18:35:31 -07:00
2026-07-28 20:51:14 -07:00
2026-07-28 20:51:14 -07:00
2026-07-23 18:35:31 -07:00
2026-07-29 17:03:15 -07:00
2026-07-29 17:03:15 -07:00
2026-07-29 17:03:15 -07:00
2026-07-29 17:03:15 -07:00
2026-07-29 17:03:15 -07:00
2026-07-29 17:03:15 -07:00
2026-07-29 17:03:15 -07:00
2026-07-29 17:03:15 -07:00
2026-07-29 17:03:15 -07:00
2026-07-29 17:03:15 -07:00
2026-07-29 17:03:15 -07:00
2026-07-29 17:03:15 -07:00
2026-07-29 17:03:15 -07:00
2026-07-29 17:03:15 -07:00
2026-07-29 17:03:15 -07:00
2026-07-29 17:03:15 -07:00
2026-07-29 17:03:15 -07:00
2026-07-29 17:03:15 -07:00
2026-07-29 17:03:15 -07:00
2026-07-29 17:03:15 -07:00
2026-07-29 17:03:15 -07:00
2026-07-29 17:03:15 -07:00
2026-07-29 17:03:15 -07:00
2026-07-29 17:03:15 -07:00
2026-07-30 17:49:08 -07:00
2026-07-29 17:03:15 -07:00
2026-07-30 17:49:08 -07:00
2026-07-29 17:03:15 -07:00
2026-07-29 17:03:15 -07:00
2026-07-29 17:03:15 -07:00
2026-07-29 17:03:15 -07:00
2026-07-29 17:03:15 -07:00
2026-07-29 17:03:15 -07:00
2026-07-29 17:03:15 -07:00
2026-07-29 17:03:15 -07:00
2026-07-29 17:03:15 -07:00
2026-07-29 17:03:15 -07:00
2026-07-29 17:03:15 -07:00
2026-07-29 17:03:15 -07:00
2026-07-29 17:03:15 -07:00
2026-07-29 17:03:15 -07:00
2026-07-29 17:03:15 -07:00
2026-07-04 21:31:51 -07:00
2026-08-04 23:07:34 -07:00
2026-08-04 23:07:34 -07:00
2026-04-09 12:28:59 -07:00
2026-08-03 16:28:49 -07:00
2026-08-03 16:28:49 -07:00
2026-07-14 15:23:06 -07:00
2026-07-14 15:23:06 -07:00
2026-07-23 18:35:31 -07:00
2026-07-24 12:48:18 -07:00
2026-07-24 12:48:18 -07:00
2026-07-17 16:16:17 -07:00
2026-07-23 18:35:31 -07:00
2026-07-19 20:25:52 -07:00
2026-07-08 14:34:16 -07:00
2026-07-30 18:27:16 -07:00
2026-07-20 17:11:23 -07:00
2026-07-20 17:11:23 -07:00
2026-07-29 18:21:26 -07:00
2026-07-29 18:21:26 -07:00
2026-07-29 18:21:26 -07:00
2026-08-02 17:06:11 -07:00
2026-08-02 17:06:11 -07:00
2026-06-28 11:38:23 -07:00
2026-06-28 11:38:23 -07:00
2026-07-28 14:04:41 -07:00
2026-07-23 19:00:00 -07:00
2026-06-28 11:38:23 -07:00
2026-08-02 17:06:11 -07:00
2026-07-28 14:04:41 -07:00
2026-06-28 11:38:23 -07:00
2026-07-03 17:21:50 -07:00
2026-05-08 10:50:43 -07:00
2026-08-04 02:03:40 -07:00
2026-05-31 09:29:44 -07:00
2026-05-21 13:22:37 -07:00
2026-05-21 13:22:37 -07:00
2026-07-25 05:11:03 -07:00
2026-07-13 05:40:02 -07:00
2026-07-13 05:40:02 -07:00
2026-07-13 05:40:02 -07:00
2026-07-22 20:41:30 -07:00
2026-07-23 18:35:31 -07:00
2026-07-23 18:35:31 -07:00
2026-07-23 18:35:31 -07:00
2026-07-23 18:35:31 -07:00
2026-07-29 19:50:18 -07:00
2026-08-02 00:33:57 -07:00
2026-07-23 18:35:31 -07:00
2026-06-15 19:58:55 -07:00
2026-07-13 15:47:17 -07:00
2026-07-23 18:35:31 -07:00
2026-07-25 03:33:10 -07:00
2026-07-25 03:33:10 -07:00
2026-07-23 18:35:31 -07:00
2026-07-23 18:35:31 -07:00
2026-07-12 23:43:33 -07:00
2026-07-25 05:11:03 -07:00
2026-07-25 05:11:03 -07:00
2026-07-29 19:50:18 -07:00
2026-05-14 00:42:07 -07:00
2026-06-29 22:38:29 -07:00
2026-08-01 00:40:47 -07:00
2026-07-27 22:11:56 -07:00
2026-07-26 00:41:03 -07:00
2026-07-13 01:10:38 -07:00
2026-07-10 20:52:24 -07:00
2026-06-19 17:14:55 -07:00
2026-06-19 17:14:55 -07:00
2026-06-07 19:51:36 -07:00
2026-06-07 19:51:36 -07:00
2026-08-02 17:40:58 -07:00
2026-07-23 19:12:54 -07:00
2026-07-28 14:04:41 -07:00
2026-07-28 14:04:41 -07:00
2026-08-02 17:40:58 -07:00
2026-08-03 22:29:19 -07:00
2026-08-03 22:29:19 -07:00
2026-07-15 15:23:35 -07:00