feat(scripts): resume-remote.sh never overwrites a remote session - #246
Merged
Conversation
This commit cuts the decisions the script makes per run. Before it, three remote states (fresh, existing, live) and --force give 5 outcomes, one of them an overwrite of the remote session. After it, two remote facts (is the tmux session live, does the session file exist) give 3 outcomes, and none of them overwrites the remote. - The remote session ID is derived from the toolpath document, and the tmux session name is derived from that ID. One ID names the session file, the tmux session, and the claude resume. - One read-only ssh call reports whether the tmux session is live and whether the session file exists. Live: attach. File present: launch, attach. File absent: ship, launch, attach. - --force is removed. To reset a remote session, delete its file on the remote and re-run. - The rsync of the working tree runs only on a run that ships. Before this commit it runs on every run. - The remote checks (two read-only ssh calls) run before any remote write. Before this commit, --setup seeding and the rsync run between them. - A missing remote project directory fails the run unless --setup or a sync on a run that ships creates it. - The ship writes to a temporary name, checks the byte count, and renames into place, so a present session file is a complete file.
|
🔍 Preview deployed: https://e53195d9.toolpath.pages.dev |
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.
This PR cuts the decisions
scripts/resume-remote.shmakes per run: two remote facts (is the tmux session live, does the session file exist) give 3 outcomes, and none of them overwrites the remote. The remote session ID is derived from the toolpath document and names the session file, the tmux session, and the claude resume.--forceis removed, so to reset a remote session you delete its file on the remote and re-run. The rsync of the working tree runs only on a run that ships, and both read-only ssh calls run before any remote write. The ship writes to a temporary name, checks the byte count, and renames into place, so a present session file is a complete file.Script only: no version bump, no CHANGELOG entry.
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.