Skip to content

fix(ci): prevent oversized database-worker jobs from timing out - #150581

Merged
steipete merged 1 commit into
mainfrom
codex/ci-database-worker-job-bounds
Sep 17, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/ci-database-worker-job-bounds

Conversation

@steipete

@steipete steipete commented Sep 17, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes database-worker CI jobs timing out while tests are still passing, as seen in run 35176277297.

User Impact

No product behavior changes. CI distributes the native database-worker tests across bounded jobs while retaining every test, existing process isolation, worker limits, timeouts, and capacity caps.

Why This Change Was Made

The planner left 185 native worker files in one envelope, then treated the group as inexpensive enough to bundle with other suites. Cap native worker files at 20 both when creating envelopes and when packing jobs. Migrated channel files retain their original plugin's limits.

Evidence

  • Original production fails the strengthened regression with 185 files; splitting alone still fails because packing recombines 90 files.
  • The repaired real inventory covers all 185 files exactly once in ten envelopes of 18–19 files. Total broad fallback remains 40 jobs, with unchanged other envelopes and native/migrated process plans.
  • 369 focused tests passed across changed-planner, extension-runner, and Telegram prerelease coverage. Formatting, plain syntax lint, line-cap ratchet, script erasability, and diff checks passed; independent review through P2 found no issues.
  • Exact-head CI 35181449230 passed, including script/root types and type-aware lint (not run locally). Bundle 8 completed in 20m22s: its bounded native envelope took 113.498s; ordinary and migrated siblings account for most remaining time. All 15 envelopes completed once with exit 0 and no wrapper retry.
  • The exact 185-file partition is local inventory proof. Hosted bundle composition differs from that fixture; full-job durations include other suites. The original canceled 58-minute envelope is lower-bound evidence, not a completed timing sample or a controlled speedup.

Related: #149737.

@clawsweeper

clawsweeper Bot commented Sep 17, 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: S maintainer Maintainer-authored PR labels Sep 17, 2026
@steipete
steipete marked this pull request as ready for review September 17, 2026 04:18
@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 Sep 17, 2026
@clawsweeper

clawsweeper Bot commented Sep 17, 2026

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed September 17, 2026, 12:26 AM ET / 04:26 UTC.

ClawSweeper review

What this changes

The PR splits native database-worker tests into groups of at most 20 files and prevents job packing from recombining them above that limit.

Merge readiness

⛔ Blocked before merge - 1 item remains

Keep open: this remains a useful, focused CI repair absent from the inspected main revision. No actionable introduced defect was found, and the protected maintainer submission is not a cleanup candidate.

Priority: P2
Reviewed head: e8c93067a17f62755c7be6e69250a03e49c029ea

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused owner-level repair with meaningful partition and packing regressions; no blocking code defect was found.
Proof confidence 🌊 off-meta tidepool Not applicable: The supplied repository state identifies a member-authored PR, so the external-contributor proof gate does not apply. The planner’s reported inventory validation supports partitioning; completed hosted job timings remain pending and no measured speedup is credited.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The supplied repository state identifies a member-authored PR, so the external-contributor proof gate does not apply. The planner’s reported inventory validation supports partitioning; completed hosted job timings remain pending and no measured speedup is credited.
Evidence reviewed 9 items Pinned introduction boundary: The host verified the complete merge-base-to-head patch and a test merge with the pinned base and head as parents. Both identify the same four changed paths; unrelated endpoint drift was excluded from this review.
Current main still has the oversized-envelope path: The inspected main source returns all native database-worker files as one group, and job splitting supplies no native file ceiling. The proposed repair therefore remains necessary at this revision.
Separate job and process limits: The complete module shows that only job splitting receives the new native limit; process splitting retains its existing call and migrated files retain their original configuration’s limits.
Findings None None.
Security None None.

How this fits together

OpenClaw’s CI planner turns changed paths and plugin test inventories into runner jobs. Its splitting and packing stages determine which tests share a job before the existing runner executes their isolated processes.

flowchart TD
  A[Changed repository paths] --> B[Plugin test inventory]
  B --> C[Classify native and migrated tests]
  C --> D[Split bounded test groups]
  D --> E[Pack jobs within file and cost limits]
  E --> F[Run existing isolated test processes]
Loading

Before merge

  • Resolve merge risk (P1) - The 20-file ceiling bounds workload size, but completed hosted results have not yet established the slowest resulting job duration.
Agent review details

Security

None.

PR surface

Tests +15, Docs +11, Other +27. Total +53 across 4 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 1 48 33 +15
Docs 1 11 0 +11
Config 0 0 0 0
Generated 0 0 0 0
Other 2 29 2 +27
Total 4 88 35 +53

Review metrics

Metric Value Why it matters
Native test job ceiling 20 native files per job; 50-job fallback cap retained The additional packing constraint prevents cost estimates from undoing the split without raising the existing fallback capacity cap.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Keep job sizing and packing under the existing planner owners, preserving complete coverage and process isolation while using completed hosted timings to assess the ceiling.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

Keep job sizing and packing under the existing planner owners, preserving complete coverage and process isolation while using completed hosted timings to assess the ceiling.

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

Yes, source establishes the unbounded native group through the fallback planner, supported by the recorded hour-long CI cancellation; this review did not execute a current-main reproduction.

Is this the best way to solve the issue?

Yes. Applying the bound at both existing splitting and packing stages addresses the demonstrated mechanism without changing process isolation or raising deadlines.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 3e8b396a7dc8.

Labels

Label changes:

  • add P2: This repairs an observed CI planning timeout with a bounded change and no product runtime behavior change.
  • 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: The supplied repository state identifies a member-authored PR, so the external-contributor proof gate does not apply. The planner’s reported inventory validation supports partitioning; completed hosted job timings remain pending and no measured speedup is credited.

Label justifications:

  • P2: This repairs an observed CI planning timeout with a bounded change and no product runtime behavior change.
  • 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: The supplied repository state identifies a member-authored PR, so the external-contributor proof gate does not apply. The planner’s reported inventory validation supports partitioning; completed hosted job timings remain pending and no measured speedup is credited.

Evidence

What I checked:

  • Pinned introduction boundary: The host verified the complete merge-base-to-head patch and a test merge with the pinned base and head as parents. Both identify the same four changed paths; unrelated endpoint drift was excluded from this review. (e8c93067a17f)
  • Current main still has the oversized-envelope path: The inspected main source returns all native database-worker files as one group, and job splitting supplies no native file ceiling. The proposed repair therefore remains necessary at this revision. (scripts/lib/extension-test-plan.mts:306, 3e8b396a7dc8)
  • Separate job and process limits: The complete module shows that only job splitting receives the new native limit; process splitting retains its existing call and migrated files retain their original configuration’s limits. (scripts/lib/extension-test-plan.mts:325, e8c93067a17f)
  • Packing preserves the ceiling: Both direct and fallback plugin plans use the changed packing owner. It counts native files using the existing root registry and checks the aggregate ceiling alongside existing runtime-preparation, runner, distribution, and cost constraints. The fallback retains its 50-job guard. (scripts/lib/ci-changed-node-test-plan.mts:553, e8c93067a17f)
  • Regression coverage: The changed tests check native file limits both per envelope and per packed job, exact inventory coverage, and bounded serial Memory Core jobs through direct and fallback entrypoints. The body reports failures with the original 185-file envelope and with a split-only implementation that repacked 90 files. Tests were inspected, not executed during this read-only review. (test/scripts/ci-changed-node-test-plan.test.ts:1399, e8c93067a17f)
  • Observed original CI timeout: GitHub records the affected job starting at 02:57:26Z and ending canceled at 03:57:49Z. Its test step ran from 02:59:23Z to 03:57:41Z. The related open Doctor PR documents passing tests continuing until this deadline: improve(doctor): reuse metadata snapshots during startup inspection #149737.

Likely related people:

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

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.

@steipete
steipete merged commit b360922 into main Sep 17, 2026
258 checks passed
@steipete
steipete deleted the codex/ci-database-worker-job-bounds branch September 17, 2026 04:48
@steipete

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 P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. scripts Repository scripts size: S 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