fix(agents-workspace-sync): pull fast-forward only before committing - #54
Merged
Merged
Conversation
The worker only pushed, so a remote that had moved ahead turned every run into a rejected push. It now runs `git pull --ff-only` before staging when the branch has an upstream. Fast-forward only because the job is unattended: a merge or rebase conflict would leave the repo mid-merge. A failed pull is logged and the repo skipped (exit 2), left for a human. Generated with [Claude Code](https://claude.com/claude-code) by CEH
Generated with [Claude Code](https://claude.com/claude-code) by CEH
cheneeheng
enabled auto-merge
September 26, 2026 19:49
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.
What
agents-workspace-sync now pulls (fast-forward only) before it commits and pushes each repo. Version bumped to 0.1.1.
Why
The worker only pushed. When the remote had moved ahead (e.g. edits from another machine), every run ended in a rejected push, and remote changes never reached the local copy.
How
When the branch has an upstream, both workers (
.ps1and.sh) rungit pull -q --ff-onlybeforegit add -A. If the pull fails (diverged history, or incoming changes overlap uncommitted edits), the tool logs it, skips the repo, and exits 2.Rejected alternatives:
The member CLAUDE.md invariant ("never pull, merge, or rebase") and the README were updated to match.
Testing
bash -nand the PowerShell parser both pass on the edited workers. Not run against a real repo. This member has no test suite.Checklist
any/@ts-ignore/# type: ignoreintroduced.agents_workspace/DECISION_LOG.mdentry 72 instead)Generated with Claude Code by CEH