fix(auto-sync): retry setup on next launch when any step fails - #600
Conversation
Previously the version marker was written unconditionally after setup, so partial failures were permanently marked as "done" with no automatic retry. Now the marker is only written when all steps succeed — on partial failure the next launch re-runs all steps (they are idempotent).
ReviewSmall, well-scoped fix that addresses a real bug — partial failures were being silently latched as "done". The new behavior (write marker only on full success) is the right contract. Doc comment and user-facing message are both updated to match. The change is also exactly one focused commit on one file, which makes it easy to reason about. I verified the idempotency claim for all five steps, and it holds:
Concerns worth flagging1. Persistent-failure UX regression (medium) If a step fails for a reason that doesn't self-resolve (no
The PR description argues "they are idempotent, so re-running already-succeeded steps is harmless" — that's true for correctness, but each 2. Concurrent invocations (low, pre-existing) Two 3. Test coverage (low) There's no Nits
VerdictLGTM — bug fix is correct and the comment/message updates accurately describe the new contract. Worth following up on concern #1 (escape hatch or bounded retries) before this lands in front of users with locked-down environments, but that can be a separate PR. |
Summary
Fixes a bug where a partial setup failure was silently marked as complete, preventing automatic retry on subsequent launches. The version marker is now only written when all setup steps succeed — on partial failure, the next launch re-runs the full setup (all steps are idempotent, so re-running already-succeeded steps is harmless).
Key Changes
src/services/system/auto-sync.ts: MovemarkSynced()call inside afailures.length === 0guard so the.synced-versionmarker is only written on full successbun install -g @bastani/atomic) to informing them that setup will automatically retry on next launch — no manual intervention neededBehavior Before vs. After
Notes
tmux/psmux, global agent configs,@playwright/cli,@llamaindex/liteparse, global skills) are idempotent, making the retry-all-on-failure approach safe and cheap