Repository navigation
fix(ops): the cron stops sharing a checkout with humans, and says when it is stale - #122
Merged
Merged
Conversation
…n it's stale #120 stopped this cron from rebasing whoever's branch was checked out in the shared repo. That was the bleeding, not the wound: the cron was still RUNNING from a checkout people work in, so it stayed exposed in both directions. The cure was already in this file, 20 lines lower. $DASH_REPO has been a cron-owned detached worktree since the 53-silent-skip incident, precisely so no human action can disable it. The checkout the cron runs from never got the same treatment. So it now points at .openclaw-autoscan, a worktree nobody edits, re-pinned to origin/main by its own 05:40 crontab line — while nothing is executing from it, because rewriting a script under a running bash is its own bug. That leaves this script read-only against git: fetch to learn where main is, never pull, never branch-switch. And the second half of 2026-08-11 — nobody knew for ~9 hours. #120's guard printed to stdout, so the loud ERROR went to /var/log/agentglob-diag.log and the email still looked normal. Identical silence, new wording. This file has had the right mechanism all along: warn_sync() puts a warning in the email body AND the subject (⚠ SYNC FAILED), built after 53 skipped runs went unread in that same log. The guard now calls it, which meant hoisting warn_sync above the check instead of leaving it defined 15 lines below. Also fixes a bug in #120's guard that would have made it useless in the very worktree it protects: `-d .git/rebase-merge` can never be true there, because `.git` is a FILE in a worktree and rebase state lives under .git/worktrees/<name>/. This file already warns about that trap for $DASH_REPO. Now asks git via `rev-parse --git-path`; confirmed resolving to .git/worktrees/wt-dbg/rebase-merge. Verified all three arms in a real worktree, each checked for the warning reaching SYNC_WARNINGS and not just stdout: - detached at origin/main -> clean - one commit behind (pin died) -> stale WARN with both short SHAs - genuine conflicted rebase -> MID-REBASE WARN + recovery command Co-Authored-By: Claude Opus 5 <[email protected]>
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.
fix(ops): the cron stops sharing a checkout with humans, and says when it's stale
#120 stopped this cron from rebasing whoever's branch was checked out in the
shared repo. That was the bleeding, not the wound: the cron was still RUNNING
from a checkout people work in, so it stayed exposed in both directions.
The cure was already in this file, 20 lines lower. $DASH_REPO has been a
cron-owned detached worktree since the 53-silent-skip incident, precisely so no
human action can disable it. The checkout the cron runs from never got the same
treatment. So it now points at .openclaw-autoscan, a worktree nobody edits,
re-pinned to origin/main by its own 05:40 crontab line — while nothing is
executing from it, because rewriting a script under a running bash is its own
bug.
That leaves this script read-only against git: fetch to learn where main is,
never pull, never branch-switch.
And the second half of 2026-08-11 — nobody knew for ~9 hours. #120's guard
printed to stdout, so the loud ERROR went to /var/log/agentglob-diag.log and
the email still looked normal. Identical silence, new wording. This file has
had the right mechanism all along: warn_sync() puts a warning in the email body
AND the subject (⚠ SYNC FAILED), built after 53 skipped runs went unread in
that same log. The guard now calls it, which meant hoisting warn_sync above the
check instead of leaving it defined 15 lines below.
Also fixes a bug in #120's guard that would have made it useless in the very
worktree it protects:
-d .git/rebase-mergecan never be true there, because.gitis a FILE in a worktree and rebase state lives under.git/worktrees//. This file already warns about that trap for $DASH_REPO.
Now asks git via
rev-parse --git-path; confirmed resolving to.git/worktrees/wt-dbg/rebase-merge.
Verified all three arms in a real worktree, each checked for the warning
reaching SYNC_WARNINGS and not just stdout:
Co-Authored-By: Claude Opus 5 [email protected]