Skip to content

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

Draft
ecalifornica wants to merge 1 commit into
ecalifornica/export-claude-derive-session-idfrom
ecalifornica/resume-remote-simple
Draft

feat(scripts): resume-remote.sh never overwrites a remote session#243
ecalifornica wants to merge 1 commit into
ecalifornica/export-claude-derive-session-idfrom
ecalifornica/resume-remote-simple

Conversation

@ecalifornica

@ecalifornica ecalifornica commented Aug 25, 2026

Copy link
Copy Markdown
Collaborator

This PR cuts the decisions scripts/resume-remote.sh 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 PR it runs on every run.
  • The remote checks (two read-only ssh calls) run before any remote write. Before this PR, --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.

Script only: no version bump, no CHANGELOG entry. Stacked on #241.


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

@ecalifornica ecalifornica self-assigned this Aug 25, 2026
@github-actions

github-actions Bot commented Aug 25, 2026

Copy link
Copy Markdown

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

@ecalifornica ecalifornica changed the title feat(scripts): resume-remote.sh follows the simple model feat(scripts): resume-remote.sh never overwrites a remote session Aug 26, 2026
@ecalifornica
ecalifornica marked this pull request as ready for review August 26, 2026 14:56
@ecalifornica
ecalifornica requested a review from akesling August 26, 2026 14:56
@ecalifornica
ecalifornica force-pushed the ecalifornica/resume-remote-simple branch from d321267 to d297300 Compare August 26, 2026 14:57
@ecalifornica
ecalifornica force-pushed the ecalifornica/resume-remote-simple branch from d297300 to a0e709a Compare August 26, 2026 15:42
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.
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