feat(cli): path resume --remote keeps an existing remote session file - #225
Open
ecalifornica wants to merge 1 commit into
Open
feat(cli): path resume --remote keeps an existing remote session file#225ecalifornica wants to merge 1 commit into
ecalifornica wants to merge 1 commit into
Conversation
The ship step writes only when the target file is absent or smaller than the local serialization (a partial earlier ship). An existing file at full size or larger is kept with a notice and the session launches on it, so remote-side progress survives a re-push. path-cli (0.18.0): - ship_command guards the write remotely in the same exec channel as the write itself: no second round trip, no check-to-write race. Both branches drain stdin and report one TP_SHIP=shipped or TP_SHIP=kept line, parsed strictly. - --overwrite replaces the target unconditionally. It requires --remote and is not spelled --force: that flag means "re-fetch from Pathbase, overwrite the cache entry". - Known edge, accepted: a target at exactly the local size with different bytes reads as kept; --overwrite is the recovery. - Unit, real-sh, and integration tests cover shipped, kept, and overwrite, including that a kept file keeps its appended entries.
|
🔍 Preview deployed: https://4d68e0ac.toolpath.pages.dev |
ecalifornica
commented
Aug 19, 2026
Comment on lines
+445
to
+448
| format!( | ||
| "umask 077; if [ ! -e {t} ] || [ $(wc -c < {t}) -lt {local_len} ]; then \ | ||
| mkdir -p {d} && cat > {t} && printf '{tag}={shipped}\\n'; \ | ||
| else cat > /dev/null; printf '{tag}={kept}\\n'; fi", |
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.
Progress on the remote survives a re-push: an existing remote session file is kept, not replaced, unless
--overwrite.Demo:
What a re-push does:
flowchart TD P[preflight] -->|tmux session live| A[attach] P -->|no live session| F{remote file} F -->|absent| W[write] F -->|smaller than local copy| W F -->|full size or larger| K[keep] F -->|"--overwrite"| W W --> L[launch tmux] --> A K --> LThis applies whenever the tmux session is not live at push time: tmux exited or was killed, the host rebooted, or an earlier push was interrupted mid-write.
A smaller file is that last case, a partial write, so it is replaced. A file at full size or larger carries the session, so it is kept with a notice and the launch runs on it.
The keep-or-replace decision runs on the remote in the same exec channel as the write, so there is no check-then-write race and no second round trip. The remote reports one
TP_SHIP=shippedorTP_SHIP=keptline, parsed strictly.Judgement calls:
--overwriterather than repurposing--force:--forcealready means "re-fetch from Pathbase, overwrite the cache entry", and coupling the two overwrites ties unrelated behaviors to one flag.wc -c.Stacked on #223.
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.