Repository navigation
ci: pack native test jobs and budget more hosted checks - #154471
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: blocked before merge. Reviewed September 21, 2026, 6:30 AM ET / 10:30 UTC (Revision 5). ClawSweeper reviewWhat this changesThe PR packs compatible CI test jobs more densely, routes small native jobs to the 8-class runner, and conditionally moves additional checks and main artifact builds onto GitHub-hosted runners. Merge readiness⛔ Blocked before merge - 3 items remain Keep open: the changes remain distinct from current main, and exact-head native CI now passes with no blocking code finding. This protected, measurement-only PR still needs a deliberate rollout decision. Priority: P2 Review scores
Verification
How this fits togetherCI preflight turns changed files, test inventories, timing estimates, and runner health into execution plans. Those plans determine runner allocation and feed the required CI result. flowchart TD
A[Changed files and test inventory] --> B[CI preflight]
C[Timing estimates] --> D[Compact test planner]
B --> D
E[Recent hosted assignments] --> F[Health and capacity admission]
B --> F
D --> G[Native and hosted jobs]
F --> G
G --> H[Required CI result]
Decision needed
Why: The prior timing concern now has sensitivity analysis but no covering native main-route measurement, and the author explicitly reserves landing for human review. Before merge
Agent review detailsSecurityNone. PR surfaceTests +583, Docs +25, Config +57, Other +219. Total +884 across 10 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Retain the consolidated planner and stage the three main-only offloads behind measured deadline headroom or explicit acceptance of a monitored rollout. Do we have a high-confidence way to reproduce the issue? Not applicable as a product-bug reproduction: this is CI capacity tuning supported by historical measurements and a successful native run of the reviewed head. Is this the best way to solve the issue? Yes for the planner design: it extends the existing packing owner and preserves serial placement and worker limits; the main-only hosted expansion still needs a rollout decision. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against b95f9005280f. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (4 earlier review cycles)
|
7392312 to
368807c
Compare
368807c to
fcbcdb1
Compare
) * ci: pack native test jobs and budget more hosted checks * fix(ci): bound hosted health history and track moved groups * fix(ci): require serial Node headroom for PR hosted checks * fix(ci): preserve serial placements before parallel compaction * ci: pool compatible capacity and offload main artifact builds
Related: #153876, #154088, #153962, #153820, #154133.
What Problem This Solves
CI creates many short-lived Blacksmith allocations while the 4-class queues behind work that could use available capacity. The five supplied successful main runs averaged $18.35 in Blacksmith list-price compute with a 16m50s median job-envelope wall.
User Impact
No product behavior or test inventory changes. Compact Node planning combines eligible parallel jobs, sends native 4-class requests to the existing 8-class route, and moves measured checks to hosted runners when assignment health, latency headroom, and the existing hosted row limit allow it. This PR is for measurement and review; do not merge automatically.
Why This Change Was Made
Keep the original 360-second packing, Gateway serialization, runtime placement, and worker pinning. After those decisions settle, repack only existing two-child 32-class jobs into 500-second aggregate bins, and only when that eliminates jobs. Compatible logical runner classes can share the same actual capacity; each child keeps its original runner metadata. Existing serial jobs keep their membership, ordering, estimates, capacity and worker policy. A singleton left by compaction retains its previous two-worker ceiling.
This ordering matters: the initial wider-packing experiment moved five unchanged slow groups from four serial rows into one, producing a 21-minute job in native CI despite a 360-second estimate. The revised planner freezes those serial placements before compaction. Regression coverage exercises that placement drift and the singleton worker ceiling. The final 4-to-8 routing occurs after placement, so it cannot change runtime ownership.
The 4- and 8-class both delivered two CPUs and 7.66 GiB in the recorded capacity probe; the five-run cohort's 4-class median assignment wait was 125 seconds. Promotion costs more per minute, which the forecasts include. Logical packing classes, child processes, worker ceilings, and hosted fallbacks remain unchanged.
Reuse R1's bounded hosted-assignment guard. Healthy canonical main pushes and trusted Windows-selected PRs with a full compact plan and a serial Node row predicting at least 500 seconds can offload dependencies, both core type stripes, extension package boundaries, and runtime topology. Main additionally considers lint, central test types, and
build-artifacts. These eight jobs fit the observed four-CPU resource contract; each decision consumes remaining space inside the unchanged 45-row hosted limit. The probe fails closed on stalled, stale, missing, or malformed evidence and has one ten-second deadline. It cannot migrate already queued jobs or prevent a later hosted incident.No timeout, retry, test coverage, matrix cap, repository variable, or ruleset changes. The remaining serial-family and tooling work stays with its existing lanes.
Evidence
The baseline is runs 35557247654, 35557636746, 35558615177, 35559381087, and 35559584558. Counts exclude skipped pseudojobs; costs prorate execution seconds at list rates without invoice rounding. Forecasts are separate from native measurements. Main's historical selected workload is not a matched cohort for this broad tooling PR.
The main-only artifact offload has no native hosted timing yet. Its five baseline jobs fit a sensitivity of twice the complete job duration plus 68 seconds setup and 180 seconds assignment allowance, retaining at least 75 seconds of slack. It uses the same hosted-main admission and unchanged cap; PR placement is unchanged.
Measured final-head PR run
CI run 35586917453 at
fcbcdb1a0c1d67a0c4a00b8bc8115b0f3311d2c3: success. This is the first attempt; no rerun was requested.Measured job-envelope wall: 20.05 min; longest job
checks-node-compact-large-15: 16.10 min. The PR selects additional tooling, five Windows shards, UI and other owner-gated work absent from the five-main-run cohort, so totals are not a matched speedup comparison.Actual PR Blacksmith total: 743.27 machine-minutes, $31.697 at list before discounts or billing rounding. Windows16 is $0.064/min from the published rate selector; hosted public-repository work is modeled free.
GitHub tested merge
c5d113c2e98f925eaa18c04e2ea1337b54e07902(this head into main2a820f484186de3618f0dc98bf92e3c4cc69109e). All 113 executed jobs passed, with 12 intentionally unselected jobs. The assignment guard observed a 209-second stall and retained the five additional PR checks on Blacksmith: 19 base hosted rows, 24 total after the existing optional admission. This validates fallback behavior; the earlier 739 trial remains the admitted five-check measurement.The eight repacked parallel rows passed in 428–627 seconds, averaging 534 seconds (8m54s) including setup. The 966-second (16m06s) critical row is serial: its decoded native child plans exactly match the unmodified planner’s ordered groups, timing identities, file lists and worker settings, and its job retains the two-worker cap. The previous 21-minute co-location regression is absent. The requested roughly 15-minute longest-job reference was not reached in this trial.
Preflight took 217 seconds: checkout 169s, manifest generation 32s, and hosted-health inspection 3s. The native 32-class checkout median was 79s, compared with a 9s median across the baseline’s per-job checkout medians. Native 8-class assignment delay was 9s median/18s maximum, versus the supplied 4-class cohort’s 125s median. These source, workload and setup differences prevent a matched wall-time or cost-saving claim against the historical main cohort. The final run’s 20m03s wall is above that cohort’s 16m50s median.
The earlier staging and UI failures did not recur. Their passing Linux replays and this green run do not establish a root-cause fix; neither test was changed.
Per-job and per-step before/after receipts (seconds)
Old numbered compact jobs can contain different groups after repacking. These are job-name receipts, not identical-workload comparisons. “—” means absent from the baseline. Start delay is creation-to-start and can include dependencies. Work sums named test/check/build steps; checkout, setup and runtime preparation are separate.
Replay provenance: candidate
fcbcdb1a0c1d67a0c4a00b8bc8115b0f3311d2c3, compared with761725d03f294aaddc399a759a0755d34a0e1ecf, using one shared current inventory. Planner blob:34e1c5c0a8eace64f735b5656782b99bd0b58068. Historical main and prior PR measurements remain unchanged.The five successful main samples executed a median 34/10/3/6/18 jobs on Blacksmith 32/16/8/4 and hosted Ubuntu respectively. Expanded labels included skipped pseudo-jobs, which are excluded from runtime and cost. Mean Blacksmith consumption was 354.32 machine-minutes/$18.350 per run; median job-envelope wall was 16m50s. Costs use seconds-prorated list rates, without invoice rounding or discounts. Hosted Linux is modeled as free for this public repository.
The compact-plan replay below schedules each child in its emitted FIFO one/two-slot row. It adds the build reserve once, retains any remaining measured floor, and adds observed median native setup or 68 seconds hosted setup. It never prices summed parallel child seconds as elapsed machine time. Node makespan adds the observed assignment medians (125s on 4-class, 8s on 8-class); it excludes preflight, aggregate-gate overhead, appended plugin rows and non-Node dependencies. This is a planning model, not observed CI latency: its hybrid maximum underpredicts the 919-second measured historical tail.
These Node counts exclude two dist descriptors per PR plan and one per push plan. The full-compact hybrid PR meets the serial-work condition through
checks-node-compact-small-22(agentic-cli, one slot, 518 predicted seconds); Windows selection and the other hosted-admission conditions remain required. The fallback extension selector over every changed path in the final commit emits zero appended rows; different core/product paths can append extension coverage. Actual PR selection and native timing remain the authoritative proof.For a cost-only comparison with the same non-Node selection, adding the five measured main runs gives the following hybrid counterfactual. The PR row reuses main’s non-Node workload and assumes a trusted Windows-selected full-compact PR with a serial Node prediction of at least 500 seconds for the five hosted checks; it does not include the additional Windows/UI/QA jobs such a real PR may select. Main admits the same five plus lint, central test types, and
build-artifacts. Each after cost includes a full 10-second health probe on Blacksmith 16.The two retained main 16-class jobs are
preflightand the CLI Node row. Preflight gates fanout, so its apparent finish-to-gate slack is not usable downstream headroom; documented hosted assignment stalls justify retaining its bootstrap route. Main now also admitsbuild-artifactsunder the existing hosted-main decision and unchanged row cap. It has an existing four-CPU/15.42-GiB compute proof, a 278-second baseline median job duration, and at least 601 seconds of finish slack. There is no native hosted-artifact timing yet: the sensitivity of twice the complete job duration plus 68 seconds setup and 180 seconds assignment allowance fits all five samples with at least 75 seconds remaining. Only execution time enters machine-minute costs; the 180-second assignment allowance is queue time. This eighth main offload removes about $0.150 of additional baseline Blacksmith spend per run, without asserting matched native savings.Per-class detail for the same modeled hybrid fixed-cohort scenarios follows. Counts are medians; minutes and costs are means across the five fixed main non-Node samples, added to the compact Node model. Hosted durations reuse the specified R1 measurements or a 2× work + 68s setup sensitivity;
build-artifactsconservatively uses twice its entire original job duration plus 68 seconds. After estimates include the full 10-second health-probe allowance. These are counterfactuals, not matched native savings measurements.PR fixed-cohort scenario
Main fixed-cohort scenario
Offload-only counterfactual using measured baseline Blacksmith durations: five checks save 19.51 Blacksmith minutes/$0.624 per run; eight main jobs save 38.17 minutes/$1.221. Both deduct the full 10-second probe allowance. Lint and central test types retain their existing 20-minute job timeout;
build-artifactsretains its own existing deadline; the 2× work + 68s setup sensitivity predicts lint at at most 996s and central test-types at at most 758s. There is no matched hosted-lint or hosted-artifact measurement yet.The scratch all-hosted Node variant raises only GitHub’s serial packing budget from 210 to 500 seconds. It emits 33 raw compact rows/32 actual Node rows, versus 53/52 normally, with a nominal 568-second longest job and 182.65 hosted machine-minutes. It is rejected: 32 Node rows plus the observed 18 hosted non-Node rows already total 50, above the unchanged 45-row admission limit; including the eight new main offloads would total 58. The historical 739 experiment also exposed stale split estimates, but its native-duration sensitivity predates the merged agents-core parallelism change and is not a current latency forecast. The unchanged row cap rejects the refreshed variant independently; no fresh hosted Node run establishes the 30-minute main limit.
The main Node offloads remain deferred because upstream inventory changes invalidate numbered-row attribution and a new identity allowlist would create brittle placement policy. Existing native 4-class rows use the 8-class route, whose measured CPU/RAM allocation is the same and whose assignment queue is shorter.
The finalized-pool repair passed native CI in the run reported above. Historical A25, 739 and 368 results remain separate source-specific evidence.
The earlier 500-second initial packing changed which groups reached serial Gateway/runtime jobs; run 35575095520 then measured a 21-minute serial row. The repair first completes the original 360-second packing, runtime placement and worker policy, freezes those serial rows, and only then pools already finalized two-slot 32-class jobs into 500-second bins. Groups keep their original runner metadata, file/config inventory, environment and effective worker ceilings. Serial rows retain exact membership/order and budgets; only emitted 4→8 placement changes.
This removes two hybrid Node rows (65 → 63 PR, 43 → 41 main) and four pure-Blacksmith rows, without changing the modeled maximum job time. It does not meet the requested main 32-class target: 33 → 31 remains six above 25. Under the retained policies, 22 baseline serial 32-class rows plus nine storage-family children that cannot share a row set a 31-row floor; one final singleton changes the emitted split to 23 serial / eight two-slot rows without lowering that floor.
The tradeoff is explicit: the hypothetical admitted hybrid PR cost rises $14.29 → $14.39 (+$0.10) because 4→8 routing costs more per minute and final FIFO packing has more imbalance, despite fewer registrations and fewer Blacksmith minutes after offloading. The equivalent main counterfactual falls $13.56 → $12.58 (about $0.97). These compare one timing model and fixed non-Node cohort; they are not matched native savings measurements. The 24-minute 368 run and its 1260-second serial job show why the model’s 550-second maximum cannot stand in for fresh native validation.
For the refreshed hybrid plan, modeled Node makespan falls from 587 to 556 seconds because the observed 4-class assignment delay no longer controls a near-tail row. The longest modeled job stays 550 seconds. This queue-based projection is not native latency proof.
Validation
All local test invocations were single planner/guard files, serialized with
--maxWorkers=1. No suite, shard, endurance run, or benchmark ran on the Mac. Full workload replays ran on the two Linux Testbox leases documented below.ci-node-test-plan.test.tsci-test-timings.test.tsci-changed-node-test-plan.test.tstest-projects.test.tsci-workflow-guards.test.tsci-hybrid-hosted-health.test.tsThe final main-only artifact addition extended existing workflow cases: the original routing failed two assertions, then all ten focused admission, exclusion, health and routing cases passed in 13.70s. Its coverage independently expands the emitted workflow rows at the unchanged cap. Earlier serial-placement and singleton-worker regressions failed before the repair and passed afterward; both committed-policy host cases also reproduced the obsolete same-logical-class assumption before being updated to verify actual capacity and retained child policy.
The full planner file already owns inventory integration coverage. New focused cases use synthetic timing/config fixtures without timed waits, new public test seams, or timeout changes. The three packing cases took 9.59s including file startup; the health file's Vitest duration was 0.523s.
Final
node scripts/check-changed.mjspassed, including type checks, type-aware lint and dead-export checks. Workflow checks (including zizmor), three-page MDX sanity, documentation link audit,oxfmt --check, andgit diff --checkpassed. Fresh Codex local and final branch autoreviews were scoped-clean through P2, with no accepted/actionable findings. The final branch review coversfcbcdb1a0c1d67a0c4a00b8bc8115b0f3311d2c3against main.Native CI reported case-time sums of 78.280s for the 121 planner cases, 33.935s for the 167 timing cases, 263.721s for the workflow-guard cases, and 0.005s for the 19 health cases. These sum the reporter’s rounded case durations; they exclude shared import/setup time and are not file wall times. Owning jobs and step walls are listed in the native table above.
Earlier native trials and bounded failure investigation
Every trial below was the first attempt of a changed head. No CI rerun was requested to get green.
a25d72bfc68573923123d6ad368807cc031The timing test inferred a moved group from logical runner versus requested runner, which no longer holds after 4-to-8 routing. It now compares actual job ownership while preserving inventory, worker, and 440-second placement assertions. All four failures reproduced before the fix; all 167 timing tests passed afterward.
The first health query returned stale September 19 matches from an unrestricted history listing. A server-side one-day creation bound returns current runs; the separate thirty-minute freshness limit is unchanged. Its regression failed before the fix and passed afterward. The 739 trial admitted the five checks from seven samples with a maximum 10-second wait: dependencies 453s, core types 547/549s, extension boundary 375s, topology 281s. Their slack before the last Node job was 289–556s. The 368 trial correctly rejected admission after observing a 204-second hosted-assignment stall.
The staging failure was
crabbox-staging.test.ts→ “keeps real full-worktree registrations and hook outputs protected.” Recovery emitted 272 stdout bytes and no stderr but exceeded its unchanged 30-second deadline; worktree creation took 213ms. B1 preserves the original three-group order and execution contract, but that alone does not establish the failure is unrelated. On Linux Testboxtbx_01m31cn6jta0qtm730ek2e4yg1, the original three-group replay passed in 398.385s, with the failing case at 887ms. The standalone file also passed all 16 tests with two-CPU affinity; it had 15.42 GiB RAM versus CI's 7.66 GiB. These passing replays are not a proven fix. Lease receipt; stopped and verified completed.The UI failure was
chat-position-rail-layout.e2e.test.ts→ “keeps the rail anchored as Task progress and the composer grow (80, ltr messages).” During/goalactivation after a six-line draft, the track stayed fixed while a tick moved 21px upward. Seven sibling cases passed. B1 changes no UI source, tests, or configuration; recent upstream layout-containment and autosizing edits are investigation candidates, not established causes. The exact original--shard 10/12command passed on Linux Testboxtbx_01m31ggqrjn556tb05am7cknqf: 52 files, 234 tests, 385.18s, including the failed case in 20.453s. Source hashes, Node 24.19.0, and the CI Chromium installer matched. Root cause remains uncertain; no assertions, timeouts, or UI behavior were changed. Lease receipt; stopped and verified completed.The 368 performance regression is attributable to B1: five exact child contracts were concentrated into one serial row, consuming 1,204.96 test seconds plus 55.04s overhead. The largest child was isolated Gateway/database-worker work at 701.19s. The repair preserves the original serial placements and compacts only previously parallel jobs. The separate CLI job at 1,029s is the unchanged
agentic-clisingleton, on the same 16-class with two workers; its owner remains the CLI lane.State and follow-ups
The separate
openclaw/ci-gateStatusContext was still pending when the successful native results were collected. Security Review owns that publication; a same-window completion publisher failed with HTTP 403 installation API quota exhaustion. Timing and actor match this CI completion, but the REST record does not expose the triggering CI run ID, so this is not an exact event binding. No CI rerun or gate bypass was requested.Head
fcbcdb1a0c1d67a0c4a00b8bc8115b0f3311d2c3is published, mergeable and remains open without auto-merge. It is based on761725d03f294aaddc399a759a0755d34a0e1ecf; agents-core is integrated and the other three named dependency PRs remain open. No landing was attempted.The ≤25 target remains unmet: the current main replay emits 31 jobs in the 32-class. Further reductions require work on the remaining serial/family capacity constraints, with current workload and memory proof. Main’s lint, central-type and artifact offloads still need native hosted measurements; their costs and thirty-minute fit are projections. The full hosted-Node alternative exceeds the retained row cap. The PR trial establishes successful execution and bounded repacked jobs, but does not establish an overall PR wall-time or cost reduction against the supplied main cohort.