Skip to content

improve: add hybrid CI runner backend - #123479

Merged
steipete merged 2 commits into
mainfrom
steipete/hybrid-backend
Aug 14, 2026
Merged

steipete merged 2 commits into
mainfrom
steipete/hybrid-backend

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

Resolves a CI capacity problem where light jobs consume Blacksmith registrations while a Blacksmith outage or saturation can leave heavyweight platform and build jobs stuck without an automatic hosted escape path.

Why This Change Was Made

Adds OPENCLAW_CI_RUNNER_BACKEND=hybrid: light lanes use GitHub-hosted runners and the existing hosted planner profiles, while heavy lanes use Blacksmith on attempt 1 and automatically fall back to their hosted label when rerun. Unset/blacksmith and github retain their existing all-Blacksmith-first and all-hosted behavior, including fork and manual-dispatch fallbacks.

User Impact

Maintainers can reserve Blacksmith capacity for builds and native platform work without giving up a simple outage recovery path. If a heavy hybrid job is stuck or fails because Blacksmith is unavailable, rerunning it moves that job to GitHub-hosted capacity automatically.

The coordinator will set OPENCLAW_CI_RUNNER_BACKEND to hybrid after this PR merges. This PR does not change the repository variable.

Evidence

Lane classification

Hybrid class Jobs Attempt 1 Rerun (github.run_attempt > 1)
Heavy Linux build-artifacts, check-sqlite-session-lifecycle blacksmith-32vcpu-ubuntu-2404, blacksmith-8vcpu-ubuntu-2404 ubuntu-24.04
Heavy Android all android matrix rows blacksmith-8vcpu-ubuntu-2404 ubuntu-24.04, with the hosted low-memory Gradle route
Heavy macOS/iOS macos-node, macos-swift, ios-build blacksmith-6vcpu-macos-15 or blacksmith-12vcpu-macos-26 macos-15 or macos-26
Light preflight, pnpm-store warmup, Node tests, fast contracts, checks/lint/additional/docs, UI/UI E2E, QA Smoke, Windows, native i18n, Python skills, Opengrep GitHub-hosted; hosted Node/UI/QA/Windows planner counts and cache paths GitHub-hosted

The workflow guard evaluates all configurable jobs in unset/Blacksmith, GitHub, hybrid attempt-1, hybrid-rerun, and fork contexts. Planner tests prove that hybrid's compact Node plans are byte-for-byte equal to the GitHub profile. UI E2E, QA Smoke, Windows splitting, cache ownership, hosted lint stripes, Android route interpolation, and heavy fallback labels are covered explicitly.

Validation on rebased head:

node scripts/run-vitest.mjs test/scripts/ci-workflow-guards.test.ts test/scripts/ci-node-test-plan.test.ts test/vitest-projects-config.test.ts
Test Files 3 passed across 2 routed Vitest shards
Tests 165 passed, 2 skipped

node --import tsx scripts/check-workflows.mts
zizmor Passed
No direct inputs interpolation found in composite run blocks.

./node_modules/.bin/oxfmt --check .github/workflows/ci.yml scripts/lib/ci-node-test-plan.mts test/scripts/ci-node-test-plan.test.ts test/scripts/ci-workflow-guards.test.ts docs/ci.md
All matched files use the correct format.

git diff --check origin/main...HEAD
clean

.agents/skills/autoreview/scripts/autoreview --mode branch --base origin/main
autoreview clean: no accepted/actionable findings reported

The first post-rebase combined test run had one transient failure in the unrelated offline pnpm hard-link fixture after 71 seconds. Its exact isolated rerun passed, and the complete requested command then passed cleanly.

@clawsweeper

clawsweeper Bot commented Aug 14, 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: M maintainer Maintainer-authored PR labels Aug 14, 2026
@clawsweeper clawsweeper Bot added merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Aug 14, 2026
@clawsweeper

clawsweeper Bot commented Aug 14, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 14, 2026, 2:30 AM ET / 06:30 UTC.

ClawSweeper review

What this changes

This PR adds a hybrid CI runner backend that sends light jobs to GitHub-hosted runners while routing heavyweight jobs through Blacksmith first and a hosted runner on rerun.

Merge readiness

⚠️ Ready for maintainer review - 4 items remain

Keep open for maintainer review: this member-authored, maintainer-labeled CI change is not eligible for automated cleanup, and the read-only review shell failed before source, history, scoped-policy, or exact-head workflow inspection could be completed.

Priority: P2
Reviewed head: 0f96470f5c971d01b080080981bb77aa3826c886
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The supplied validation is focused, but the patch cannot receive a confident higher rating until the exact current-main merge result is inspectable and validated.
Proof confidence 🌊 off-meta tidepool Not applicable: This member-authored CI routing change is outside the external-contributor real-behavior-proof gate; the supplied validation claims still need exact-head CI completion.
Patch quality 🦐 gold shrimp (3/6) Security review found an item that needs attention.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This member-authored CI routing change is outside the external-contributor real-behavior-proof gate; the supplied validation claims still need exact-head CI completion.
Evidence reviewed 3 items Review environment failure: The read-only shell failed before repository inspection with bwrap: loopback: Failed RTM_NEWADDR: Operation not permitted; no local source, history, or scoped-policy claims are made from the checkout.
Proposed routing surface: The supplied PR context identifies runner selection in .github/workflows/ci.yml and matching hosted-profile planning in scripts/lib/ci-node-test-plan.mts, with focused workflow and planner tests.
Maintainer handling required: The repository state identifies the author as a MEMBER and the PR carries the protected maintainer label, so it must remain open for explicit maintainer handling.
Findings None None.
Security Needs attention Complete the workflow security pass after sandbox recovery: The review could not inspect the exact workflow diff for action references, permissions, or executable steps because every read-only shell command failed before execution.

How this fits together

OpenClaw’s CI workflow assigns platform and test jobs to hosted or Blacksmith runner pools. The runner-backend setting feeds workflow job selection and the Node shard planner, which determine capacity, concurrency, and rerun recovery.

flowchart LR
  A[Repository runner setting] --> B[CI workflow]
  C[Run attempt and event context] --> B
  B --> D[Light job routing]
  B --> E[Heavy job routing]
  D --> F[GitHub-hosted runners]
  E --> G[Blacksmith first attempt]
  E --> H[Hosted rerun fallback]
  I[Node shard planner] --> D
Loading

Decision needed

Question Recommendation
Should the repository adopt hybrid as a supported CI runner-backend mode after current-main integration and exact-head validation? Validate and adopt hybrid: Rebase, verify all backend and rerun routes on the exact merge result, then enable the repository variable deliberately.

Why: This adds an operational policy mode for repository automation, and the protected maintainer status plus unavailable source inspection prevent a safe automated merge recommendation.

Before merge

  • Resolve security concern: Complete the workflow security pass after sandbox recovery - The review could not inspect the exact workflow diff for action references, permissions, or executable steps because every read-only shell command failed before execution.
  • Resolve merge risk (P1) - The PR base is behind current main, and source inspection could not establish whether its runner expressions and planner changes remain correct on the current merge result.
  • Resolve merge risk (P0) - The hybrid value changes CI scheduling and outage recovery; incomplete exact-head CI cannot establish the intended hosted fallback behavior.

Findings

  • [low] Complete the workflow security pass after sandbox recovery
Agent review details

Security

Needs attention: The supplied patch summary shows no obvious new dependency or permission surface, but the failed shell prevented the required exact-head workflow security pass.

PR surface

Tests +106, Docs +10, Config +1, Other +3. Total +120 across 5 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 2 146 40 +106
Docs 1 28 18 +10
Config 1 80 79 +1
Generated 0 0 0 0
Other 1 11 8 +3
Total 5 265 145 +120

Review metrics

Metric Value Why it matters
Production versus test delta production +4, tests +106, docs +10 net lines The supplied per-file totals show modest workflow/planner growth backed by substantial routing coverage; exact-head execution still matters because CI behavior is the changed product surface.

Merge-risk options

Maintainer options:

  1. Validate the current merge result (recommended)
    Rebase and complete exact-head CI so the hybrid attempt-one and rerun routes are proven with current main before merge.
  2. Pause the new mode
    Keep the existing runner backends if maintainers do not want a third operational policy to own.

Technical review

Best possible solution:

Rebase onto current main, complete the workflow and planner review against the merge result, and land only after exact-head CI confirms all backend modes and rerun fallback routes.

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

Not applicable: this proposes a new CI scheduling mode rather than reporting a broken product behavior; local workflow execution could not be inspected because the review shell failed.

Is this the best way to solve the issue?

Unclear: the hybrid design is plausible from the supplied context, but current source, exact merge behavior, and sibling runner routes could not be examined in the failed read-only environment.

AGENTS.md: unclear because the file could not be read completely.

Codex review notes: model internal, reasoning high; reviewed against 16470278805c.

Labels

Label changes:

  • add status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action. Not applicable: This member-authored CI routing change is outside the external-contributor real-behavior-proof gate; the supplied validation claims still need exact-head CI completion.
  • remove status: 👀 ready for maintainer look: Current PR status label is status: ⏳ waiting on author.

Label justifications:

  • P2: The PR changes internal CI capacity and recovery behavior without evidence of a current end-user runtime emergency.
  • merge-risk: 🚨 automation: Workflow runner expressions and the CI shard planner determine how repository automation is scheduled.
  • merge-risk: 🚨 availability: The new rerun fallback changes how heavyweight jobs recover from Blacksmith capacity failures.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🌊 off-meta tidepool and patch quality is 🦐 gold shrimp.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action. Not applicable: This member-authored CI routing change is outside the external-contributor real-behavior-proof gate; the supplied validation claims still need exact-head CI completion.

Evidence

Security concerns:

  • [low] Complete the workflow security pass after sandbox recovery
    The review could not inspect the exact workflow diff for action references, permissions, or executable steps because every read-only shell command failed before execution.
    Confidence: 0.99

What I checked:

  • Review environment failure: The read-only shell failed before repository inspection with bwrap: loopback: Failed RTM_NEWADDR: Operation not permitted; no local source, history, or scoped-policy claims are made from the checkout.
  • Proposed routing surface: The supplied PR context identifies runner selection in .github/workflows/ci.yml and matching hosted-profile planning in scripts/lib/ci-node-test-plan.mts, with focused workflow and planner tests. (.github/workflows/ci.yml, 0f96470f5c97)
  • Maintainer handling required: The repository state identifies the author as a MEMBER and the PR carries the protected maintainer label, so it must remain open for explicit maintainer handling. (0f96470f5c97)

Likely related people:

  • steipete: The supplied PR commits attribute the hybrid runner routing work to steipete; checkout failure prevented the required broader current-main ownership history hunt. (role: current CI routing contributor; confidence: low; commits: b8961c6dbeb0, 0f96470f5c97; files: .github/workflows/ci.yml, scripts/lib/ci-node-test-plan.mts)

Rank-up moves

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

  • Rebase onto current main and let exact-head CI complete.
  • Have a maintainer confirm adoption of the new repository runner-backend mode.

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 (3 earlier review cycles)
  • reviewed 2026-08-14T05:08:01.982Z sha f98e668 :: needs maintainer review before merge. :: none
  • reviewed 2026-08-14T05:28:49.116Z sha f98e668 :: needs maintainer review before merge. :: none
  • reviewed 2026-08-14T06:18:29.575Z sha ee40199 :: needs maintainer review before merge. :: none

@steipete steipete closed this Aug 14, 2026
@steipete steipete reopened this Aug 14, 2026
@steipete steipete closed this Aug 14, 2026
@steipete steipete reopened this Aug 14, 2026
@steipete
steipete force-pushed the steipete/hybrid-backend branch from ee40199 to 0f96470 Compare August 14, 2026 06:26
@clawsweeper clawsweeper Bot added status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Aug 14, 2026
@steipete
steipete merged commit e51ee08 into main Aug 14, 2026
267 of 269 checks passed
@steipete
steipete deleted the steipete/hybrid-backend branch August 14, 2026 07:19
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 15, 2026
* ci: add hybrid runner backend

* test: admit hybrid backend in CI fixture
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: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. scripts Repository scripts size: M status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant