Skip to content

chore(claude): auto-sync PR base branches from the /work command - #3461

Open
mmagician wants to merge 2 commits into
nextfrom
mmagician-claude/work-auto-base-sync
Open

chore(claude): auto-sync PR base branches from the /work command#3461
mmagician wants to merge 2 commits into
nextfrom
mmagician-claude/work-auto-base-sync

Conversation

@mmagician

@mmagician mmagician commented Aug 2, 2026

Copy link
Copy Markdown
Collaborator

Summary

Extends the /work command: after opening a draft PR, it now sets up a scheduled cloud routine that keeps the PR's base branch merged in automatically if there are conflicts

  • Runs every 2 hours against the repository.
  • When the base branch has moved AND has conflicts, it merges the base into the PR branch, resolves conflicts; otherwise it pushes nothing and comments on the PR with what blocked the sync.
  • Self-terminates when the PR is merged/closed, or after 48 hours at most.

After opening a draft PR, /work now creates a 2-hourly scheduled routine
that merges the base branch into the PR branch when it moves, gated on
lint and tests, and self-deletes once the PR closes or after 48 hours.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@mmagician mmagician added the no changelog This PR does not require an entry in the `CHANGELOG.md` file label Aug 2, 2026
A clean base move needs no action; the routine now only merges the base
in when the PR's mergeable state is CONFLICTING.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@mmagician
mmagician marked this pull request as ready for review August 2, 2026 11:04
@partylikeits1983

partylikeits1983 commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

My main issue with this PR is that it spends tokens and potentially pushes code after I close my machine.

A cloud routine runs under the account that created it. work.md is in the repo, so every contributor who uses /work gets 24 scheduled sessions per PR billed to their own credits, without opting in.

Also whats not great is that these /work sessions write. The agent could potentially resolve conflicts in kernel MASM and account code and pushes, with nobody watching. A wrong resolution would still compile and pass CI tests, so the crate tests will not catch an incorrect resolution.

Going to hold off approving, lets discuss on a call though, maybe I'm not fully understanding this PR

@mmagician

Copy link
Copy Markdown
Collaborator Author

What you describe is precisely what this PR does.
Maybe we could make this an optional watch=true flag on the /work command?

I don't think I'd worry about the tokens here, the watching part will consume absolutely minimal amount of tokens.
The point you raise about the agent running without supervision is true, though. I don't personally mind, and would in fact prefer the extra automation (which is why this PR came up in the first place)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no changelog This PR does not require an entry in the `CHANGELOG.md` file

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants