Skip to content

ci(cmux-next): implicit batch queue for feat-cmux-next - #17979

Closed
azooz2003-bit wants to merge 35 commits into
feat-cmux-nextfrom
azooz-migration/17535-ci-next-batch-queue
Closed

azooz2003-bit wants to merge 35 commits into
feat-cmux-nextfrom
azooz-migration/17535-ci-next-batch-queue

Conversation

@azooz2003-bit

@azooz2003-bit azooz2003-bit commented Oct 6, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

PRs into feat-cmux-next land one at a time today, and each re-runs the full CI on every push. The coordinator also stacks open UI PRs by hand, regenerates the agent-pane bundle and builds the stack on the fleet. This PR makes that loop an implicit merge queue. Agents open PRs and the queue lands them.

.github/workflows/cmux-next-batch.yml runs scripts/ci/next_batch.py. docs/ci/cmux-next-batch.md has the full rules.

  • Trigger: PR events and feat-cmux-next pushes debounce into one batch: 2 minutes of quiet, at most 10 minutes after the first event. A running batch is never cancelled; a newer dispatch waits.

  • Eligible: not a draft, a branch in this repo, no hold/exploration/needs a call label, head newer than 5 days, and no red check outside the heavy tier (pending is fine). Only PRs by the batch authors (default teamleaderleo) are auto-landed; anyone else opts in with batch-queue.

  • Stack: up to 12 PRs in PR-number order on the feat-cmux-next head. Generated files are never resolved by hand. A conflict keeps the stack's copy, and the generator rebuilds it once:

    • web bundles on Linux;
    • SDK bindings from the merged cmux-tui/spec, which merges key by key;
    • Swift exports (action contracts, settings schema, MDM) on a mini.

    Any other conflict drops that PR and comments on it, once per head.

  • Validate once: dispatch cmux-next.yml on next-batch/<run>-<n>, which runs every tier (enabled by ci(cmux-next): run every tier when dispatched on a next-batch branch #17528). In parallel, a mini submits a fleet --production build of the stack. Jobs already red on feat-cmux-next don't count, and failed jobs get one rerun before any PR is blamed.

  • Land or bisect:

    • Green: each PR lands with main's gh-merge-green --squash after a comment linking the batch. --override names the batch only when the PR's own heavy check is red.
    • Red: halving over stack prefixes finds the culprit. It gets a comment with the failing jobs, and the batch reruns without it.
  • Report: the job summary, plus a sticky comment on the HQ issue named by CMUX_NEXT_BATCH_STICKY.

Controller logic runs on Blacksmith Linux, or for now as next_batch.py serve on a workstation under the operator's gh login (no App yet). In serve mode, its pushes and merges start CI like anyone's, and the fleet build uses the host's cmux-ci. Generators run the stack's code, so they never run on the controller. regen-linux (web bundles, SDK, webviews formatting) and regen (Swift exports, on a mini) check out the stack with a read-only token and return a patch. The controller applies and pushes that patch.

  • Formatting never blocks a landing: a PR changing webviews/ whose only red is web / react-apps-check or web / Web status stays eligible. Before landing it, regen-linux runs bun run check:fix (formatter and lint autofix) on its head, and the queue pushes the fix to its branch.
  • Mini refusals: a job a runner refused before writing a result is dispatched once more.

Limits

  • The job token merges and pushes, and GitHub starts no workflows for those events. After landing, the batch dispatches cmux-next.yml, cmux-tui-artifacts.yml and the next batch on feat-cmux-next. The routing App has no contents permission, so it can't do this either.
  • If two batch PRs both changed a generated file, GitHub can't squash the second after the first lands. The queue comments on that PR, which needs a merge of feat-cmux-next plus regeneration. Pushing that fix automatically would need a token whose pushes start CI.
  • The dev-build page from feat: publish fleet dev builds as update tracks #17473 isn't on feat-cmux-next yet, so the build link goes only to the sticky report.

Testing

Changelog

none

🤖 Generated with Claude Code


Migrated from #17535 after correcting the PR author identity. The original head commit 405bf26 is preserved.


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.


Summary by cubic

Adds an implicit merge queue for feat-cmux-next (docs/ci/cmux-next-batch.md has the full rules). PR events debounce into one batch that stacks eligible PRs, rebuilds conflicted generated files, validates the stack once across every cmux-next tier plus a fleet production build, then lands each PR with gh-merge-green or bisects a red stack to its culprit. PRs no longer land one at a time with full CI on every push.

Batch rules

  • Eligible: not a draft, branch in this repo, no hold/exploration/needs a call label, head newer than 5 days, no red check outside the heavy tier; batch authors (default teamleaderleo) auto-land, others opt in with batch-queue.
  • PRs touching .github/workflows/ are never queued; they land by hand.
  • A generated-file conflict keeps the stack's copy and the generator rebuilds it once; other conflicts drop the PR and comment on it.
  • A webviews-changing PR whose only red check is web formatting stays eligible; the queue runs bun run check:fix on its head and pushes the fix before landing.
  • The token's merges and pushes start no workflows, so the batch dispatches cmux-next.yml, cmux-tui-artifacts.yml, and the next batch after landing.
  • If two batch PRs changed the same generated file, the second can't be squashed after the first lands; the queue comments and that PR needs a manual merge and regen.

Written for commit 405bf26. Summary will update on new commits.

Review in cubic Turn on auto-fix

teamleaderleo and others added 30 commits October 5, 2026 21:56
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Debounced PR events dispatch one batch: stack eligible PRs on
feat-cmux-next, rebuild conflicted generated files, run every cmux-next
tier and a fleet production build on the stack, then land each PR with
gh-merge-green or bisect a red stack to its culprit.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
feat-cmux-next is not the default branch, so the Actions API cannot find
a workflow file that exists only there by its name.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ch-dispatch

# Conflicts:
#	.github/workflows/cmux-next.yml
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
GitHub refuses the job token's push or merge of a .github/workflows
change, so those PRs land by hand. Debounce dispatches only when
CMUX_NEXT_BATCH_ENABLED is 1.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… build (red)

python3 -m unittest tests.test_next_batch: 14 failures, all in the new
ServeDebounce, RemoteRegeneration, LocalController and regen workflow tests.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
next_batch.py serve polls open PRs, debounces like the debounce job and
runs one batch at a time with the operator's gh login, so it runs without
the batch App. Its pushes and merges start CI, so nothing is re-dispatched
after landing; the fleet build uses the host's cmux-ci.

Generators run the stack's code, so they no longer run on the controller:
regen-linux (web, SDK) and regen (Swift) check out the stack with a
read-only token and return a patch that the controller applies and pushes.

python3 -m unittest tests.test_next_batch: 41 pass (14 failed on 552c900).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
next-batch/20261006: the regen job ran the stack's own copy of
regenerate-swift-exports.sh, which the stack does not have yet (exit 127).
python3 -m unittest tests.test_next_batch: 1 failure.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The stack checkout keeps the stack's code; only the generator script comes
from the trusted ref. python3 -m unittest tests.test_next_batch: OK.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…red)

next-batch/20261006: the Swift regen job was refused at runner setup (a
fleet build was waiting for the host) and the batch gave up.
python3 -m unittest tests.test_next_batch: 3 errors.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
python3 -m unittest tests.test_next_batch: OK.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
cmux-ci build --production --backend-mode local: "production builds cannot
use offline backend mode". python3 -m unittest tests.test_next_batch: 1 failure.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
python3 -m unittest tests.test_next_batch: OK.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
next-batch/20261006: #17527 and #17537 were validated green but
web / react-apps-check failed on formatting and blocked landing.
python3 -m unittest tests.test_next_batch: 5 failing.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A PR changing webviews/ whose only red is web formatting stays eligible.
Before landing it, regen-linux runs bun run check:fix (formatter and lint
autofix) on its head and the queue pushes the patch to the PR's branch;
gh-merge-green waits for the rerun. python3 -m unittest tests.test_next_batch: 50 OK.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Landing from the queue host is not allowed yet; owners land on the
receipt. A receipt names the heavy jobs that ran, since cmux-next.yml
skips them on next-batch/* until this PR is on feat-cmux-next.
python3 -m unittest tests.test_next_batch: 4 failing.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
python3 -m unittest tests.test_next_batch: 54 OK.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
next_batch.py select: gh api graphql failed: gh: HTTP 504 (100 PRs with
files and checks in one query). python3 -m unittest tests.test_next_batch: 2 failing.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
python3 -m unittest tests.test_next_batch: OK; next_batch.py select: OK.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
python3 -m unittest tests.test_next_batch: 1 failing.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
teamleaderleo and others added 5 commits October 6, 2026 08:37
python3 -m unittest tests.test_next_batch: OK.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Batch local-20261006-153816: #17534's owner pushed while its formatting
ran; the report showed a raw git push error. python3 -m unittest tests.test_next_batch: 1 error.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…atch

python3 -m unittest tests.test_next_batch: OK.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Oct 6, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration
  • Configuration used: Repository: manaflow-ai/cmux/.coderabbit.yaml
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 45b4583a-7ec1-4242-b68c-787ce34e2759

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@azooz2003-bit
azooz2003-bit deleted the azooz-migration/17535-ci-next-batch-queue branch October 6, 2026 20:56
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.

2 participants