Repository navigation
fix(update): keep dev campaigns running after restart - #121328
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Land-ready proof for exact head
|
|
Merged via squash.
|
OpenClaw pinned dev update live proofDate: 2026-08-09 Isolation
Scenario
Fault injectionThe first A→B attempt intentionally exposed a scenario dependency mismatch: copied ResultPASS — pinned dev updates retain exact detached SHAs, restart receipts preserve the authoritative upstream, update status remains current/behind, and subsequent automatic campaigns continue across repeated update/restart cycles. |
…ails A campaign apply that succeeds at the git level but fails its managed-service handoff (e.g. a post-restart health-probe false negative under SQLite load) marked the update sentinel "error", so the #121328 receipt-backed upstream fallback never engaged and dev campaigns stalled silently on "no-upstream" until manual branch re-attach. The receipt now records the install fact proven by the running process (git mode, root + revision verified, install changed) regardless of sentinel status; the reader and store drop their redundant success gates; the concept is renamed Successful* -> Verified*. Receipt writes are scoped to git mode (the only mode ever read), so dead npm-mode rows can no longer clobber a valid git receipt. Fixes #121634
…ails (#121664) A campaign apply that succeeds at the git level but fails its managed-service handoff (e.g. a post-restart health-probe false negative under SQLite load) marked the update sentinel "error", so the #121328 receipt-backed upstream fallback never engaged and dev campaigns stalled silently on "no-upstream" until manual branch re-attach. The receipt now records the install fact proven by the running process (git mode, root + revision verified, install changed) regardless of sentinel status; the reader and store drop their redundant success gates; the concept is renamed Successful* -> Verified*. Receipt writes are scoped to git mode (the only mode ever read), so dead npm-mode rows can no longer clobber a valid git receipt. Fixes #121634
…ails (openclaw#121664) A campaign apply that succeeds at the git level but fails its managed-service handoff (e.g. a post-restart health-probe false negative under SQLite load) marked the update sentinel "error", so the openclaw#121328 receipt-backed upstream fallback never engaged and dev campaigns stalled silently on "no-upstream" until manual branch re-attach. The receipt now records the install fact proven by the running process (git mode, root + revision verified, install changed) regardless of sentinel status; the reader and store drop their redundant success gates; the concept is renamed Successful* -> Verified*. Receipt writes are scoped to git mode (the only mode ever read), so dead npm-mode rows can no longer clobber a valid git receipt. Fixes openclaw#121634
…ream The 2026-08-12 resync left this file a hybrid merge that dropped upstream's handoff rework while its callers and tests already expected the new API: - root-mismatch binding (openclaw#121288): concurrent handoffs across distinct install roots silently coalesced instead of rejecting; single-flight test failed ("promise resolved 'joined' instead of rejecting"). - tag threading (openclaw#121328): callers pass `tag` via a conditional spread that bypasses TS excess-property checking, so the pinned/adopted target version was silently dropped and a moving channel could update to the wrong version. - externally-supervised state-drift guard (openclaw#121069): the detached update helper could write/migrate an externally-supervised gateway's shared SQLite. Take upstream's file wholesale — no fork-specific logic in it; callers and all four handoff test files are already byte-identical to upstream. Verified: repro test now passes, all 4 handoff test files green (28 passed), tsgo:core update surface clean, autoreview clean. Co-Authored-By: Claude Opus 4.8 <[email protected]>
What Problem This Solves
Fixes an issue where a successful pinned dev update campaign left the checkout on the intended detached commit, but a service restart then made Updates report
no-upstreamand stopped future hourly dev campaigns. This was observed in a live managed dev-channel deployment after a successful pinned campaign and restart, without depending on any host- or user-specific behavior.Why This Change Was Made
Pinned dev updates must preserve the exact detached target while retaining the canonical upstream that produced it. The update flow now carries both facts in a versioned encoding through the existing single environment field, validates that the frozen SHA is an ancestor of the declared upstream before mutation, verifies the final detached HEAD, and persists
upstreamRefonly in a successful receipt. After restart, that receipt is used only when its canonical install root and SHA match the current detached checkout; active branch tracking still wins.User Impact
Updates continues to show whether the installed dev checkout is current or behind after restart, and hourly dev campaigns can continue from verified campaign-managed detached installs. Unmanaged detached checkouts still report no upstream. This adds no live config, protocol field, or public CLI flag.
Evidence
git diff --checkpassed after rebasing onto currentorigin/main.origin/mainreported no findings and rated the patch correct (0.98 confidence).No changelog edit: the PR body carries the release-note context for this focused fix.