Skip to content

fix(ci): cap Testbox concurrency and idle spend - #162678

Merged
vincentkoc merged 8 commits into
mainfrom
fix/ci-testbox-spend-controls
Oct 1, 2026
Merged

vincentkoc merged 8 commits into
mainfrom
fix/ci-testbox-spend-controls

Conversation

@vincentkoc

@vincentkoc vincentkoc commented Oct 1, 2026 •

Copy link
Copy Markdown
Member

What Problem This Solves

General Testbox dispatches default to the 32-class even for routine proof, can allocate runners without a shared concurrency budget, retain idle capacity for up to 90 minutes, and let Windows callers select arbitrary runner labels. Old queued requests can also begin expensive hydration after the caller has stopped waiting.

User Impact

Routine remote proof defaults to the 16-class and a 60-minute total-job deadline, including hydration. The explicit 32-class high-memory workflow can occupy at most four slots inside a shared maximum of 32 active Testbox jobs across five maintained lease workflows. All profiles have a 15-minute idle ceiling and admission expiry after 10 minutes. Concurrency replacement does not cancel active jobs; the outer GitHub deadline can still terminate an active SSH command. Each concurrency slot retains one pending request; a newer request can replace that pending request. Hash collisions can queue work below the overall ceiling.

The limits apply to workflows containing this change. Historical refs, other repositories, alternate workflows, and probe jobs remain outside this pool; an organization-wide cap still requires provider enforcement.

Why This Change Was Made

A lightweight hosted admission job validates lease identity, runner choice, dispatch age, and runtime before scheduling paid capacity. All five workflows use the same finite GitHub concurrency namespace, then recheck expiry before hydration and bound the provider idle timer. Windows dispatches allow only the existing 8- and 16-class runners. ARM and build leases also close their SSH sessions on exit.

The standard default drops from four hours to one hour; an explicit workflow timeout_minutes input can still select 1–240 minutes. Managed Crabbox 0.69.0 cannot forward arbitrary workflow inputs, including this input, and --ttl does not extend the GitHub job. The high-memory full-suite workflow retains its four-hour default. The explicit full-suite Testbox PR gate retains its measured high-memory allocation; routine commands and changed gates use the smaller default. A larger runner is not a workaround for needing more time. The sizing audit found sampled median/p75 memory peaks of 6.2/12.8 GiB against the 8-class's 7.66 GiB. Lease-duration percentiles include idle retention, so the one-hour default is an operating choice, not a claimed active-runtime percentile. The CI limits and Crabbox skills require evidence for large-runner exceptions and reject generic failures or timeouts as sizing signals. Native CLI workflow selection requires a separate high-memory entrypoint; it reuses the existing setup actions and hydration script. Expired queued requests can still incur runner startup time before the second expiry check.

Evidence

Historical Author-Reported Proof

  • All 17 affected admission and workflow-deadline tests passed after the default-runtime follow-up. All 82 focused admission and PR gate tests passed after the earlier sizing follow-up. Earlier affected workflow concurrency, base preparation, runner, memory, and cost regressions also passed. Gate argument checks pass with FORCE_COLOR=0; forced-color numeric output is a pre-existing issue in the unchanged gate parser.
  • Pinned actionlint passed for the original four workflows and the new high-memory workflow. Both edited skills passed validation; a read-only scenario check confirmed the smaller profile stays selected after a generic timeout. Focused lint, formatting, syntax, diff whitespace, and the line-cap ratchet passed. All four root test typecheck partitions passed. The scripts lint failure identified by CI is fixed and passed in the next CI run. Follow-up assertions for admitted runtime, runner selection, and dispatch-only cleanup passed focused tests, lint, and review.
  • Independent reviews of the implementation and test follow-ups reported no actionable P0/P1 findings.
  • Live Blacksmith CLI proof passed hosted admission, expiry checks, hydration, source verification, and the payload asserting a 15-minute idle cap. The task-owned lease was stopped and independently confirmed completed. External lease cleanup can leave the backing Actions step canceled despite a successful payload.
  • The original live proof binds a9262a7b93433a0c4898c37e7851e5091409e958. Fresh 16-class proof passed on c8a6f847ddbc8f29cd47e1b5fa2c76fa79c2f8f4: 4 observed CPUs, 15.42 GiB RAM, 15-minute idle cap, all 16 admission tests passed, and the task-owned lease completed. The subsequent runtime-default change passed 17 focused tests; no new paid lease was needed to repeat the already-verified sizing and hydration path. These older live runs are not exact-head proof of the new runtime default.

Maintainer Correction and Review Disposition

  • Signed documentation-only commit 9f43e3b56ffd95ac1a3efa8bcaa8f1a83fee745f preserves the original PR ancestry and changes only docs/ci.md and docs/ci/local-proof.md (+21/-10). It corrects the stale 32-class/four-hour routine description, preserves measured capacity attribution, and distinguishes the outer deadline, idle limit, and managed CLI limitations. No runtime, workflow, default, or CI policy changed in this correction.
  • Fresh scoped review of the two-doc delta found no actionable P0–P2 findings. Diff whitespace passed. Exact published-head CI completed successfully at 9f43e3b56ffd95ac1a3efa8bcaa8f1a83fee745f: 47 successful jobs, 24 skipped, no failed jobs. Docs job passed formatting, config-doc baseline, plugin inventory and the complete docs-check command, including MDX/link checks. Both required check-run and Security Review aggregate status are successful. No local application checks or new Testbox proof have been run.
  • ClawSweeper revision 6, reviewed October 1 at 16:58 UTC, covered cb15a68b7838ad40eee584a55343c95e7c1c6ce5. Its two-doc finding is addressed. The maintainer explicitly retains the 60-minute total routine deadline, including hydration, as an operating policy with the documented memory-justified long path. Active SSH does not waive the outer deadline. No guaranteed four-hour routine-runtime contract is claimed.
  • The generic data-model/migration flag does not apply: scripts/ci-testbox-budget.mjs writes the existing external Testbox idle timer and GitHub Actions outputs, not an OpenClaw SQLite schema or application persistence model.
  • Revision 7, reviewed October 1 at 19:06 UTC on 9f43e3b56ffd, confirms the docs finding is resolved, the deadline tradeoff is accepted, and there are no code or security findings. Its repeated migration flag is source-rejected as above. Its per-file test-cost reporting request remains a disclosed limitation: original isolated one-worker measurements have not been recovered, and shared CI timings do not satisfy that measurement. The maintainer's scoped direction retains the original proof without replay and limits this correction to two docs plus available hosted timing; no claim is made that the missing isolated measurements were produced.
  • Available exact-head test timings: changed-boundary job 87 seconds total / 51 seconds test step; changed-tests job 182 seconds total / 89 seconds test step. Across the 20 successful Node/Windows test steps, metadata records 2,574 summed step-seconds (parallel execution, not elapsed duration or billed cost). The docs job took 258 seconds. None is a standalone one-worker file measurement or a performance comparison.
  • Independently observed pre-correction CI passed on exact cb15a68b7838ad40eee584a55343c95e7c1c6ce5: 47 successful jobs, 24 conditionally skipped, no failures, including the required aggregate. Actionlint also passed. check-docs job wall time was 210 seconds; the CI job envelope was 584 seconds. These are available hosted timings, not isolated test-file measurements, summed billing, or a performance comparison. Historical focused-test and live-proof captures above have not been independently recovered for this correction.
  • The new high-memory workflow needs registration on the default branch before its first live dispatch. The controls are not deployed to main yet, and realized savings have not been measured.

@vincentkoc vincentkoc self-assigned this Oct 1, 2026
@clawsweeper

clawsweeper Bot commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation scripts Repository scripts size: L labels Oct 1, 2026
@vincentkoc
vincentkoc marked this pull request as ready for review October 1, 2026 12:07
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. 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 Oct 1, 2026
@clawsweeper

clawsweeper Bot commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed October 1, 2026, 3:06 PM ET / 19:06 UTC (Revision 7).

ClawSweeper review

What this changes

The PR limits paid Testbox jobs through shared concurrency, admission expiry, shorter idle retention, smaller routine runners, and a separate high-memory workflow.

Merge readiness

⛔ Blocked before merge - 2 items remain

The controls remain useful and absent from main. The previous documentation finding is resolved, and the routine deadline tradeoff is explicitly accepted. No blocking code defect was found; required test-cost reporting remains incomplete.

Priority: P2
Reviewed head: 9f43e3b56ffd95ac1a3efa8bcaa8f1a83fee745f

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) The patch is coherent and supported by historical real-run evidence; the remaining requirement is test-cost reporting.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (logs): Historical real Testbox evidence exercises the changed admission, 16-class allocation, hydration, idle cap, and cleanup path; GitHub job metadata corroborates successful preparation. The later deadline change has reported focused coverage rather than a fresh live lease, and the final change is documentation-only. This MEMBER-authored PR requires no additional contributor setup proof. No stored-data contract changes.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (logs): Historical real Testbox evidence exercises the changed admission, 16-class allocation, hydration, idle cap, and cleanup path; GitHub job metadata corroborates successful preparation. The later deadline change has reported focused coverage rather than a fresh live lease, and the final change is documentation-only. This MEMBER-authored PR requires no additional contributor setup proof. No stored-data contract changes.
Evidence reviewed 10 items Pinned introduced changes: Reviewed the merge-base-to-head delta, separately from base-branch drift. The supplied test merge is stale and was not used to claim removal of current-main behavior.
Still necessary on main and latest release: Fetched main retains the 32-class routine runner and 240-minute default, without the new admission script or high-memory workflow. The supplied latest release, v2026.9.7, also retains those routine settings.
Shared policy owner: The admission owner validates profile, lease ID, runner, runtime, and creation age; it derives 32 shared concurrency groups, restricts high-memory jobs to four of them, and caps the existing external idle timer at 15 minutes.
Findings None None.
Security None None.

How this fits together

Testbox workflows prepare remote machines for OpenClaw validation commands. Dispatch requests pass through admission before runner allocation, hydration, and SSH execution.

flowchart TD
  A[Remote proof request] --> B[Hosted admission]
  B --> C[Runner and deadline validation]
  C --> D[Shared concurrency slots]
  D --> E[Expiry check and hydration]
  E --> F[Remote validation command]
  F --> G[Idle expiry and SSH cleanup]
Loading

Before merge

  • Complete next step (P2) - Add measured one-worker costs for the new or materially changed test files and available test CI seconds to the PR body, as required by the repository test policy.
  • Add data-model compatibility proof - Confirm migration or upgrade compatibility proof before merge.
Agent review details

Security

None.

PR surface

Tests +224, Docs +113, Config +428, Other +130. Total +895 across 22 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 8 245 21 +224
Docs 5 123 10 +113
Config 5 443 15 +428
Generated 0 0 0 0
Other 4 137 7 +130
Total 22 948 53 +895

Review metrics

Metric Value Why it matters
Routine job deadline 240 → 60 minutes, including hydration The maintainer explicitly accepted this operating change; active SSH cannot extend the outer deadline.
Production versus test growth automation +557 net lines; tests +195 net lines Automation growth implements shared admission and a dedicated high-memory entrypoint; test-cost measurements remain required.

Stored data model

Persistent data-model change detected: serialized state: scripts/ci-testbox-budget.mjs, unknown-data-model-change: scripts/ci-testbox-budget.mjs. Confirm migration or upgrade compatibility proof before merge.

Technical review

Best possible solution:

Keep one shared admission policy and the accepted routine/high-memory split, with measured test costs recorded alongside validation evidence.

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

Not applicable to a product bug reproduction: current main and the latest release visibly lack the proposed shared spending controls.

Is this the best way to solve the issue?

Yes. Shared admission before paid allocation fits the existing workflow boundary, preserves PR validation routes, and keeps memory-heavy proof explicit.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 9f5f633e54d0.

Labels

Label changes:

No label changes.

Label justifications:

  • P2: This is a bounded improvement to remote validation spending and capacity, without evidence of an urgent product outage.
  • merge-risk: 🚨 compatibility: Routine leases become smaller and expire after one total hour; the MEMBER-authored disposition explicitly accepts and documents that tradeoff.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (logs): Historical real Testbox evidence exercises the changed admission, 16-class allocation, hydration, idle cap, and cleanup path; GitHub job metadata corroborates successful preparation. The later deadline change has reported focused coverage rather than a fresh live lease, and the final change is documentation-only. This MEMBER-authored PR requires no additional contributor setup proof. No stored-data contract changes.
  • proof: sufficient: Contributor real behavior proof is sufficient. Historical real Testbox evidence exercises the changed admission, 16-class allocation, hydration, idle cap, and cleanup path; GitHub job metadata corroborates successful preparation. The later deadline change has reported focused coverage rather than a fresh live lease, and the final change is documentation-only. This MEMBER-authored PR requires no additional contributor setup proof. No stored-data contract changes.

Evidence

What I checked:

  • Pinned introduced changes: Reviewed the merge-base-to-head delta, separately from base-branch drift. The supplied test merge is stale and was not used to claim removal of current-main behavior. (9f43e3b56ffd)
  • Still necessary on main and latest release: Fetched main retains the 32-class routine runner and 240-minute default, without the new admission script or high-memory workflow. The supplied latest release, v2026.9.7, also retains those routine settings. (.github/workflows/ci-check-testbox.yml:68, c074824a27c9)
  • Shared policy owner: The admission owner validates profile, lease ID, runner, runtime, and creation age; it derives 32 shared concurrency groups, restricts high-memory jobs to four of them, and caps the existing external idle timer at 15 minutes. (scripts/ci-testbox-budget.mjs:30, 9f43e3b56ffd)
  • Previous finding resolved: The latest commit corrects both sizing pages, distinguishing routine 16-class/60-minute jobs from high-memory 32-class/240-minute jobs and explaining hydration, outer deadlines, idle limits, and managed CLI limitations. Public docs: docs/ci/local-proof.md. (docs/ci/local-proof.md:301, 9f43e3b56ffd)
  • Accepted compatibility tradeoff: The captured MEMBER-authored body explicitly retains the 60-minute total routine deadline, including hydration and termination of active SSH at the outer deadline. It acknowledges that managed Crabbox cannot forward timeout_minutes and that high-memory allocation requires a memory justification. This resolves the prior deadline-policy question. (9f43e3b56ffd)
  • Historical real Testbox evidence: The captured body reports a real 16-class lease with four observed CPUs, 15.42 GiB RAM, a 15-minute idle cap, successful payload tests, and cleanup. GitHub metadata independently confirms successful admission, expiry checking, idle configuration, and hydration at c8a6f84. The monitor ended canceled during reported lease cleanup; this is historical evidence, not exact-head proof of the later runtime default. (.github/workflows/ci-check-testbox.yml:61, c8a6f847ddbc)

Likely related people:

  • vincentkoc: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Record measured one-worker wall times for new or materially changed test files and their available CI seconds; docs-job timings are separate.

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.

History

Review history (6 earlier review cycles)
  • reviewed 2026-10-01T12:33:11.808Z sha f8da89a :: blocked before merge. :: none
  • reviewed 2026-10-01T12:43:15.054Z sha d37101f :: blocked before merge. :: none
  • reviewed 2026-10-01T12:54:32.549Z sha d37101f :: needs changes before merge. :: none
  • reviewed 2026-10-01T16:18:36.997Z sha c8a6f84 :: blocked before merge. :: [P3] [P3] Update the existing Testbox sizing instructions
  • reviewed 2026-10-01T16:29:56.553Z sha c8a6f84 :: blocked before merge. :: [P3] [P3] Update the existing Testbox sizing instructions
  • reviewed 2026-10-01T16:58:24.068Z sha cb15a68 :: blocked before merge. :: [P3] [P3] Update the existing Testbox sizing instructions

@clawsweeper clawsweeper Bot added the proof: sufficient ClawSweeper judged the real behavior proof convincing. label Oct 1, 2026
@clawsweeper clawsweeper Bot added merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. labels Oct 1, 2026
@vincentkoc
vincentkoc merged commit 32dc6c8 into main Oct 1, 2026
128 checks passed
@vincentkoc
vincentkoc deleted the fix/ci-testbox-spend-controls branch October 1, 2026 19:16
@vincentkoc

Copy link
Copy Markdown
Member Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 2, 2026
* fix(ci): cap Testbox concurrency and idle spend

* test(ci): align workflow guards with Testbox admission

* fix(ci): declare optional Testbox admission inputs

* fix(ci): narrow Testbox CLI rejection errors

* test(ci): verify admitted Testbox workflow behavior

* fix(ci): reserve large Testboxes for memory-heavy proof

* fix(ci): default routine Testboxes to one hour

* docs(ci): clarify Testbox profiles and total job deadlines

Co-authored-by: Vincent Koc <[email protected]>
steipete added a commit that referenced this pull request Oct 4, 2026
Extend the shared dispatch-age window from ten to sixty minutes so a
requester can survive a saturated queue without resetting the abandonment
deadline at runner assignment. Keep the 32 shared slots, four high-memory
slots, runtime limits, and fifteen-minute idle ceiling unchanged.

Update all five expiry diagnostics and the CI docs. Exercise delayed
hosted admission and the actual workflow Bash guards across every profile,
including refusal at the exact sixty-minute boundary.

Regression for 32dc6c8 (#162678). On an isolated Blacksmith Testbox,
the baseline budget fails ten new cases; the fixed suite passes all 22
(75 ms test time, 1.58 s one-worker command wall time). The build, all
1,492 related tests, workflow sanity checks, and check-changed pass; one
native-Windows-only case is skipped on Linux. No workflow deployment or
saturated live queue measurement is claimed.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 4, 2026
Extend the shared dispatch-age window from ten to sixty minutes so a
requester can survive a saturated queue without resetting the abandonment
deadline at runner assignment. Keep the 32 shared slots, four high-memory
slots, runtime limits, and fifteen-minute idle ceiling unchanged.

Update all five expiry diagnostics and the CI docs. Exercise delayed
hosted admission and the actual workflow Bash guards across every profile,
including refusal at the exact sixty-minute boundary.

Regression for 8a2095c (openclaw#162678). On an isolated Blacksmith Testbox,
the baseline budget fails ten new cases; the fixed suite passes all 22
(75 ms test time, 1.58 s one-worker command wall time). The build, all
1,492 related tests, workflow sanity checks, and check-changed pass; one
native-Windows-only case is skipped on Linux. No workflow deployment or
saturated live queue measurement is claimed.
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 merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. scripts Repository scripts size: L 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.

1 participant