Skip to content

fix(agents-workspace-sync): pull fast-forward only before committing - #54

Merged
cheneeheng merged 2 commits into
mainfrom
fix/agents-workspace-sync-pull-first
Sep 26, 2026
Merged

cheneeheng merged 2 commits into
mainfrom
fix/agents-workspace-sync-pull-first

Conversation

@cheneeheng

Copy link
Copy Markdown
Owner

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 (.ps1 and .sh) run git pull -q --ff-only before git 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:

  • Merge/rebase pull: a conflict would leave an unattended repo stuck mid-merge.
  • Commit, then pull: after a local commit, any remote change is a divergence, which ff-only cannot handle.

The member CLAUDE.md invariant ("never pull, merge, or rebase") and the README were updated to match.

Testing

bash -n and the PowerShell parser both pass on the edited workers. Not run against a real repo. This member has no test suite.

Checklist

  • All CI checks pass
  • Tests added or updated for new behavior (member has no tests; static checks only)
  • No any / @ts-ignore / # type: ignore introduced
  • No secrets or credentials in code
  • Migrations (if any) are backward-compatible
  • ARCHITECTURE.md Key Decisions updated (recorded in .agents_workspace/DECISION_LOG.md entry 72 instead)
  • Attribution included if AI tooling assisted

Generated with Claude Code by CEH

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
@cheneeheng
cheneeheng merged commit 432809d into main Sep 26, 2026
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant