Skip to content

feat(scripts): resume-remote.sh never overwrites a remote session - #246

Merged
ecalifornica merged 1 commit into
mainfrom
ecalifornica/script-no-overwrite
Aug 28, 2026
Merged

feat(scripts): resume-remote.sh never overwrites a remote session#246
ecalifornica merged 1 commit into
mainfrom
ecalifornica/script-no-overwrite

Conversation

@ecalifornica

@ecalifornica ecalifornica commented Aug 27, 2026

Copy link
Copy Markdown
Collaborator

This PR cuts the decisions scripts/resume-remote.sh makes 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. --force is 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.


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

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.
@github-actions

Copy link
Copy Markdown

🔍 Preview deployed: https://e53195d9.toolpath.pages.dev

@ecalifornica
ecalifornica marked this pull request as ready for review August 27, 2026 21:40
@ecalifornica
ecalifornica requested a review from akesling August 27, 2026 21:41

@akesling akesling left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@akesling akesling assigned ecalifornica and unassigned akesling Aug 28, 2026
@ecalifornica
ecalifornica merged commit 173bc25 into main Aug 28, 2026
3 checks passed
@ecalifornica
ecalifornica deleted the ecalifornica/script-no-overwrite branch August 28, 2026 19:10
@ecalifornica ecalifornica removed their assignment Aug 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants