Skip to content

improve(ci): reduce compact runner queue tails [AI] - #122666

Merged
steipete merged 1 commit into
mainfrom
amp/ci-compact-runner-capacity
Aug 12, 2026
Merged

steipete merged 1 commit into
mainfrom
amp/ci-compact-runner-capacity

Conversation

@steipete

Copy link
Copy Markdown
Contributor

Closes #122665

What Problem This Solves

Three compact-small Node jobs repeatedly own the full-suite CI critical path while waiting on the more congested 4-vCPU runner pool. Across 38 successful runs in the latest 12-hour cohort, compact-small bins 2, 5, and 8 owned 12 critical paths; their combined queue p50/p90/p95 was 82/269/373 seconds versus 11/145/216 seconds for compact-large jobs on the existing 8-vCPU pool.

Why This Change Was Made

Route only checks-node-compact-small-{2,5,8} to existing 8-vCPU capacity after the compact planner finishes packing. Post-packing routing preserves the recently balanced group layout, check names, serial execution, coverage, 23-bin plan, and total Actions registrations. Every other compact-small job remains on 4 vCPU.

This is narrower than repacking/splitting the jobs, moving the whole small matrix, or raising global parallelism, all of which would increase churn or capacity pressure beyond the measured bottleneck.

User Impact

No product behavior changes. Maintainers should receive faster full-suite CI feedback during 4-vCPU queue pressure without adding jobs or runner registrations.

Production/docs LOC: +26/-12 (net +14) | Tests: +18/-2. The production growth is the bounded three-entry capacity advisory and its post-packing application; it avoids a second planning path or any workflow override.

Evidence

  • 72-hour/latest-12-hour report: CI=1 node scripts/ci-run-timings.mjs --trend-hours 72 --compare-hours 12 --output /tmp/ci-trend-post-windows.json
    • selected bins: queue p50/p90/p95/max = 82/269/373/791s; execution p50/p90 = 297/400s
    • compact-large pool: queue p50/p90/p95/max = 11/145/216/407s
    • selected bins owned 12/38 latest successful-run critical paths
  • Live actions_runner_registration: limit 10,000, remaining 10,000.
  • Planner replay: 23 bins (21 nondist + 2 dist), 110/110 unique groups; selected jobs and every child group use 8 vCPU; all 11 other nondist compact-small jobs remain on 4 vCPU.
  • CI=1 node scripts/run-vitest.mjs test/scripts/ci-node-test-plan.test.ts — 22 tests passed after the final rebase.
  • CI=1 node scripts/check-changed.mjs -- scripts/lib/ci-node-test-plan.mts test/scripts/ci-node-test-plan.test.ts docs/ci.md — passed, including script/test typechecks and lint.
  • CI=1 node --import tsx scripts/check-workflows.mts — actionlint, zizmor, and interpolation checks passed.
  • CI=1 node scripts/docs-list.js — passed.
  • CI=1 ./node_modules/.bin/oxfmt --check scripts/lib/ci-node-test-plan.mts test/scripts/ci-node-test-plan.test.ts docs/ci.md — passed.
  • git diff --check — passed.

No Crabbox or Testbox was used.

AI-assisted: analysis, implementation, and verification were performed with Amp.

@clawsweeper

clawsweeper Bot commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation scripts Repository scripts size: XS maintainer Maintainer-authored PR labels Aug 12, 2026
@steipete steipete self-assigned this Aug 12, 2026

Copy link
Copy Markdown
Contributor Author

Exact-head hosted evidence for b03d650d851a7c57c863d03e6bf1b439a7baa212:

  • CI run 31608452377 completed successfully; openclaw/ci-gate passed.
  • All three selected jobs used the intended 8-vCPU labels and runners:
    • checks-node-compact-small-2: queue 10s, execution 283s, test step 245s
    • checks-node-compact-small-5: queue 11s, execution 302s, test step 266s
    • checks-node-compact-small-8: queue 11s, execution 312s, test step 271s
  • A control job remained on the intended pool: checks-node-compact-small-10 used 4 vCPU (queue 12s, execution 323s).
  • This run did not encounter meaningful runner-pool congestion, so it proves routing/correctness rather than the expected loaded-fleet queue reduction. The route decision remains based on the 38-run latest-12-hour cohort: selected-bin queue p50/p90/p95 82/269/373s on 4 vCPU versus compact-large 11/145/216s on 8 vCPU.
  • The full run completed in 496s. Its critical path was checks-node-compact-large-4, not one of the promoted bins.
  • No Crabbox or Testbox workflow was used or attached.

@clawsweeper clawsweeper Bot added merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Aug 12, 2026
@clawsweeper

clawsweeper Bot commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 12, 2026, 11:17 AM ET / 15:17 UTC.

ClawSweeper review

What this changes

Routes compact-small CI bins 2, 5, and 8 to the existing 8-vCPU runner pool without changing compact test packing, job names, or coverage.

Merge readiness

⚠️ Ready for maintainer review - 3 items remain

This PR remains necessary: the planner currently routes every compact-small bin to 4-vCPU capacity, while this branch applies the measured exception after packing. No blocking correctness defect was found; the protected maintainer item still needs an explicit CI-capacity decision because the exact-head run proved routing but did not experience fleet congestion.

Priority: P3
Reviewed head: b03d650d851a7c57c863d03e6bf1b439a7baa212
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, source-aligned CI change with exact-head routing evidence; its remaining question is the owner-approved capacity trade-off under real congestion.
Proof confidence 🌊 off-meta tidepool Not applicable: This maintainer-owned CI PR is outside the external-contributor proof gate; its supplied exact-head hosted run nevertheless shows the intended routing result.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This maintainer-owned CI PR is outside the external-contributor proof gate; its supplied exact-head hosted run nevertheless shows the intended routing result.
Evidence reviewed 5 items Planner-owned routing: The branch computes each stable compact check name after packing, selects only the three named small bins, and updates both the job and child groups to the chosen runner.
Workflow consumer: Preflight serializes the planner's runner field into the Node-test matrix, and the Node-test job uses that matrix field as its runner label.
Regression coverage: The focused planner test retains the 23-job layout and asserts that only the selected small-bin names use 8-vCPU while every other small bin remains on 4-vCPU.
Findings None None.
Security None None.

How this fits together

The Node test planner turns test groups into compact CI jobs, then preflight passes each job's runner choice into the GitHub Actions matrix. That runner selection determines the capacity pool that executes the existing test plan and affects CI queue latency.

flowchart LR
A[Test groups] --> B[Compact CI planner]
B --> C[Packed test jobs]
C --> D[Post-packing runner rule]
D --> E[Preflight matrix]
E --> F[4-vCPU or 8-vCPU runner pool]
F --> G[CI gate]
Loading

Decision needed

Question Recommendation
Should OpenClaw accept moving these three recurring compact jobs into the shared 8-vCPU pool based on the measured queue-tail cohort, with post-land monitoring for displaced congestion? Accept monitored redistribution: Merge the targeted routing and review the next congested canonical-main timing report for improved selected-bin queue tails and healthy 8-vCPU capacity.

Why: Source and exact-head CI prove the routing is implemented correctly, but only a CI-capacity owner can accept the operational trade-off between the two shared runner pools.

Before merge

  • Resolve merge risk (P1) - The exact-head run verifies runner selection, but it was not congested, so it cannot yet demonstrate lower queue tails or rule out shifting pressure to the shared 8-vCPU pool.
  • Complete next step (P2) - The protected maintainer item needs a CI-capacity owner to accept the runner-pool trade-off; no bounded repair is indicated.
Agent review details

Security

None.

PR surface

Tests +16, Docs 0, Other +14. Total +30 across 3 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 1 18 2 +16
Docs 1 10 10 0
Config 0 0 0 0
Generated 0 0 0 0
Other 1 16 2 +14
Total 3 44 14 +30

Review metrics

Metric Value Why it matters
Production versus test LOC planner +14, docs +0, tests +16 The bounded production growth implements one post-packing runner advisory; the focused test additions verify the selected and non-selected bins.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #122665
Summary: This PR is the explicitly linked candidate implementation for the canonical CI queue-tail issue.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Merge-risk options

Maintainer options:

  1. Accept and monitor the pool transfer (recommended)
    Land the targeted routing after the CI owner accepts the capacity trade-off, then inspect a congested canonical-main run for queue improvement and 8-vCPU headroom.
  2. Pause the routing change
    Do not merge if the 8-vCPU pool cannot absorb the three recurring compact jobs without creating a new CI queue tail.

Technical review

Best possible solution:

Keep the post-packing planner rule, have the CI-capacity owner accept the measured pool trade-off, and inspect a subsequent congested canonical-main run for both targeted queue improvement and 8-vCPU headroom.

Do we have a high-confidence way to reproduce the issue?

Not applicable: this is CI capacity tuning, not a reported product bug; the exact-head hosted run directly verified the new runner assignment and 4-vCPU control job.

Is this the best way to solve the issue?

Yes, with monitored capacity ownership: routing after packing keeps the existing planner and workflow contract instead of introducing a parallel plan or workflow override.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 37b4fc8621d9.

Labels

Label changes:

  • add P3: This is a narrowly scoped internal CI latency optimization with no product-runtime behavior change.
  • add merge-risk: 🚨 availability: The change redistributes existing CI work into a shared runner pool, and the available exact-head run did not exercise congestion.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This maintainer-owned CI PR is outside the external-contributor proof gate; its supplied exact-head hosted run nevertheless shows the intended routing result.

Label justifications:

  • P3: This is a narrowly scoped internal CI latency optimization with no product-runtime behavior change.
  • merge-risk: 🚨 availability: The change redistributes existing CI work into a shared runner pool, and the available exact-head run did not exercise congestion.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This maintainer-owned CI PR is outside the external-contributor proof gate; its supplied exact-head hosted run nevertheless shows the intended routing result.

Evidence

What I checked:

  • Planner-owned routing: The branch computes each stable compact check name after packing, selects only the three named small bins, and updates both the job and child groups to the chosen runner. (scripts/lib/ci-node-test-plan.mts:1772, b03d650d851a)
  • Workflow consumer: Preflight serializes the planner's runner field into the Node-test matrix, and the Node-test job uses that matrix field as its runner label. (.github/workflows/ci.yml:2187, b03d650d851a)
  • Regression coverage: The focused planner test retains the 23-job layout and asserts that only the selected small-bin names use 8-vCPU while every other small bin remains on 4-vCPU. (test/scripts/ci-node-test-plan.test.ts:340, b03d650d851a)
  • Exact-head hosted behavior: The supplied exact-head CI run 31608452377 passed and recorded the three selected jobs on 8-vCPU runners while compact-small-10 remained on 4-vCPU. (b03d650d851a)
  • Current-main and provenance: Current main does not contain the branch change; blame attributes the current compact-planner implementation to the commit that introduced this planner surface. (scripts/lib/ci-node-test-plan.mts:1678, ce56c40dab3f)

Likely related people:

  • Vincent Koc: Current-main blame attributes the compact planner and its focused test to this commit. (role: compact-planner feature introducer; confidence: high; commits: ce56c40dab3f; files: scripts/lib/ci-node-test-plan.mts, test/scripts/ci-node-test-plan.test.ts)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

Copy link
Copy Markdown
Contributor Author

Land-ready review completed at exact head b03d650d851a7c57c863d03e6bf1b439a7baa212.

  • Independent review found no blocking correctness or security findings; post-packing planner routing is the best boundary.
  • Live attempt-specific data reproduced the 38-run cohort: selected queue p50/p90/p95/max 82/269/373/791s, compact-large 11/145/216/407s, and selected bins owning 12/38 critical paths.
  • Exact-head CI run 31608452377 passed. Only compact-small 2/5/8 used blacksmith-8vcpu-ubuntu-2404; the other eleven compact-small jobs stayed on 4 vCPU; all compact jobs and openclaw/ci-gate passed.
  • scripts/pr review-validate-artifacts 122666 passed.
  • OPENCLAW_TESTBOX=1 scripts/pr prepare-run 122666 passed by reusing exact-head hosted CI; no Crabbox or Testbox execution was launched.

The CI-capacity trade-off is accepted with post-land monitoring of the next congested main cohort. The optional autoreview helper could not invoke its Codex CLI because that executable is unavailable in this orb; the independent review and exact-head CI evidence above are complete.

@steipete
steipete merged commit 3edc9c2 into main Aug 12, 2026
112 checks passed

Copy link
Copy Markdown
Contributor Author

Merged via squash.

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

Labels

docs Improvements or additions to documentation maintainer Maintainer-authored PR merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. scripts Repository scripts size: XS status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CI: route recurring compact queue tails to existing 8-vCPU capacity

2 participants