saage remote: list + cleanup commands, ps progress, terminate unregisters target - #38
Merged
Conversation
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…ters target
Targets accumulated forever: add-target appends, nothing removed them —
even terminate left the registration behind, so every spawned box became
permanent clutter and `saage remote ps` probed each dead one for a full
ConnectTimeout in silence (read as a hang).
- `saage remote list`: registered targets, pure local, no network
- `creds.remove_target()`: text-splice removal, rest of credentials.toml
stays byte-identical (comments survive); key files never deleted
- `saage remote cleanup`: per-target y/N prompt (default N), warns when an
unfinished run references the target, optional --check reachability probe
(info only — offline everything looks dead, so it never decides)
- `saage remote terminate`: also unregisters the matching target
- `saage remote ps`: narrates each probe ("checking <name> (<dest>)… ok/
unreachable") so dead targets read as progress
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…e in sessions() tmux ls runs with check=False, so ssh's own rc 255 (connection failed) produced an empty CompletedProcess instead of an exception: every dead target looked identical to a live box with no runs. Raise SSHError on rc 255 so ps/cleanup print 'unreachable'; tmux rc 1 (no server) is still a genuine zero sessions. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…ters 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.
Problem
Targets in
credentials.tomlaccumulate forever:add-targetappends, nothing removes them — eventerminateleaves the registration behind. The result is a long list of dead names in every error message, andsaage remote pssilently probing each dead box for a full ConnectTimeout, which reads as a hang.Changes
saage remote list— table of registered targets (name, dest, $/hr, per-target key). Pure local, no network.saage remote cleanup— interactive pruning: oneremove <name> (user@host)? [y/N]prompt per target (default N, sorted order). Warns when an unfinished run in the local ledger references the target. Optional--checkssh-probes each target first and shows reachable/unreachable as information only — offline every box looks dead, so reachability never decides anything. Prints a reminder after removals that removing a target does not terminate the box.creds.remove_target()— deletes the[targets.<name>]section by text splice so the rest of the file stays byte-identical (comments and[storage]/[lambda]sections survive; a TOML re-emit would strip comments). Never deletes key files (per-instance Thunder keys are unrecoverable). Preserves 0600.saage remote terminate— now also unregisters the matching target, so spawned boxes stop becoming permanent clutter.saage remote ps— narrates each probe (checking <name> (<dest>)… ok (N sessions)/unreachable) so a wall of stale targets reads as progress instead of a hang.Design notes:
docs/superpowers/specs/2026-08-01-remote-target-cleanup-design.md.Testing
tests/remote/test_target_cleanup.py, additions totest_creds.py): splice removal edge cases (middle/last section, comment preservation, 0600, key files untouched), cleanup prompt loop with scripted input, active-run warning,--checkoutput, ps progress lines with a stubbedSshTarget, terminate unregistration.tests/remote/: 103 passed, 5 skipped (ssh/live markers).test_skills,test_agent,test_checkpointwarning-capture tests) also fail on clean master and are unrelated.list→ scriptedcleanup→listconfirms removal and billing reminder.🤖 Generated with Claude Code