Skip to content

fix(ci): prevent leaf-config ownership check timeouts - #160458

Merged
steipete merged 1 commit into
mainfrom
fix/ci-plan-leaf-config-runtime
Sep 28, 2026
Merged

steipete merged 1 commit into
mainfrom
fix/ci-plan-leaf-config-runtime

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes the leaf-config ownership check timing out at its 120-second deadline and blocking PRs that touch test/scripts.

User Impact

Developers retain the same selected test coverage while CI test planning avoids repeated filesystem work. There is no Gateway, updater, or other product-runtime change.

Why This Change Was Made

A V8 CPU-profile replay attributed 50.7 of 138.6 sampled seconds to directory checks. Target expansion probed the same target once for each of 416 database-worker test entries, even when the target was a literal file. Compute the glob/directory facts once per target, skip worker expansion for ordinary files, and reuse the directory fact in the same synchronous call. No timeout or coverage changes, new cache, or new tests.

This completes the separate slowdown reported after #160408. Checked the open selector PRs, including #160254, #158658, #154668, and #159576; the target-expansion hunk does not overlap their edits.

Evidence

  • Existing regression: pnpm test test/scripts/ci-changed-node-test-plan.test.ts -t "retains leaf-config owners" --maxWorkers=1 failed before the fix: 161.229 s in the case, 166.89 s command wall. The committed fix passes in 75.108 s for the case and 77.91 s command wall (53% less wall time), with the same 120-second timeout.
  • pnpm test test/scripts/ci-changed-node-test-plan.test.ts --maxWorkers=1: 325 passed, 538.289 s wall; the leaf-config case took 48.602 s with the shared graph cache.
  • pnpm test test/scripts/ci-changed-node-test-plan.integration.test.ts --maxWorkers=1: 7 passed, 128.578 s wall.
  • pnpm test test/scripts/test-projects.test.ts -t 'database worker ownership for directory and glob|grouped Matrix|explicit Matrix files|intersects .* inherited worker|explicit active-memory' --maxWorkers=1: 12 selected routing cases passed, 34.169 s wall.
  • No individual case exceeded 60 s in either complete file. The slowest other case was the integration PR-exempt inventory proof at 50.672 s. Both existing files retain their complete real-checkout ownership assertions; no recurring test cost was added.
  • pnpm exec oxfmt --check scripts/test-projects.test-support.mts, node scripts/run-oxlint.mjs --tsconfig config/tsconfig/oxlint.scripts.json scripts/test-projects.test-support.mts, pnpm tsgo:scripts, pnpm check:line-cap-ratchet --base 8aec7806a9363aa8cac96c688e4557358866fd63, and git diff --check: passed.
  • Codex autoreview through P2: scoped-clean, no actionable findings. Local proof only; no CI reruns or workflow dispatches.

Resolve target shape once before scanning database-worker owners, avoiding repeated directory probes for every inventory entry. Keep literal-file, directory, glob, and watch selection unchanged.
@clawsweeper

clawsweeper Bot commented Sep 28, 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 scripts Repository scripts size: XS labels Sep 28, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 28, 2026
@clawsweeper

clawsweeper Bot commented Sep 28, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 28, 2026, 8:57 AM ET / 12:57 UTC.

ClawSweeper review

What this changes

The branch makes CI test planning determine each target’s shape once before expanding database-worker test ownership.

Merge readiness

✅ Ready for maintainer review

Current main still has the timeout-prone planner path. The related merged PR fixed a different CI bottleneck, so this remains distinct, useful work.

Priority: P2
Reviewed head: a024ce946a51d5641a9a423bb0cda0e514d70f77

Review scores

Measure Result What it means
Overall readiness 🦞 diamond lobster (5/6) A narrow planner repair has matched before-and-after timing evidence and relevant existing ownership checks, with no actionable defect found.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (terminal): The changed production test planner feeds PR CI selection. The PR reports an unchanged, real-checkout leaf-config case timing out before the fix and passing afterward with the same ownership assertions, supported by full planner and integration-file runs. No stored-data contract changes.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (terminal): The changed production test planner feeds PR CI selection. The PR reports an unchanged, real-checkout leaf-config case timing out before the fix and passing afterward with the same ownership assertions, supported by full planner and integration-file runs. No stored-data contract changes.
Evidence reviewed 8 items Introduced optimization: The pinned PR hunk computes glob and directory facts once per target, and skips database-worker inventory filtering for literal files.
Current main remains unfixed: Fetched main still checks directory existence inside the database-worker inventory filter for each non-glob target.
Planner boundary: The directory check is a synchronous filesystem stat, and the changed planner feeds Vitest plans used by PR test-shard selection.
Findings None None.
Security None None.

How this fits together

OpenClaw’s test planner turns changed paths or explicit test targets into Vitest plans. PR CI uses those plans to choose Node test jobs.

flowchart LR
A[Changed paths] --> B[PR test selector]
B --> C[Test target planner]
C --> D[Target shape decision]
D --> E[Test ownership]
E --> F[CI test jobs]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Tests +1. Total +1 across 1 file.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 1 12 11 +1
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 1 12 11 +1

Review metrics

Metric Value Why it matters
Leaf-config case runtime 161.229s → 75.108s (53% lower) The reported matched run moves the case below its unchanged 120-second deadline.

Technical review

Best possible solution:

Keep complete changed-file test ownership within the existing 120-second case deadline for literal files, directories, and globs.

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

Yes for the reported environment: the PR gives an exact existing test command and a pre-fix timeout, while source shows the repeated synchronous probe. This review did not execute the test.

Is this the best way to solve the issue?

Yes. The existing planner owns target classification, and the introduced hunk avoids redundant probes while preserving the reviewed routing decisions.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 6d6ea35f7616.

Labels

Label changes:

  • add P2: The timeout blocks a limited set of PR CI workflows without changing product runtime behavior.
  • add proof: sufficient: Contributor real behavior proof is sufficient. The changed production test planner feeds PR CI selection. The PR reports an unchanged, real-checkout leaf-config case timing out before the fix and passing afterward with the same ownership assertions, supported by full planner and integration-file runs. No stored-data contract changes.
  • add rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (terminal): The changed production test planner feeds PR CI selection. The PR reports an unchanged, real-checkout leaf-config case timing out before the fix and passing afterward with the same ownership assertions, supported by full planner and integration-file runs. No stored-data contract changes.

Label justifications:

  • P2: The timeout blocks a limited set of PR CI workflows without changing product runtime behavior.
  • rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (terminal): The changed production test planner feeds PR CI selection. The PR reports an unchanged, real-checkout leaf-config case timing out before the fix and passing afterward with the same ownership assertions, supported by full planner and integration-file runs. No stored-data contract changes.
  • proof: sufficient: Contributor real behavior proof is sufficient. The changed production test planner feeds PR CI selection. The PR reports an unchanged, real-checkout leaf-config case timing out before the fix and passing afterward with the same ownership assertions, supported by full planner and integration-file runs. No stored-data contract changes.

Evidence

What I checked:

Likely related people:

  • unknown: The claimed source-line change could not be verified from bounded local history. (role: source history unknown; confidence: low)
  • vincentkoc: 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 self-assigned this Sep 28, 2026
@steipete
steipete merged commit b27c79b into main Sep 28, 2026
160 checks passed
@steipete
steipete deleted the fix/ci-plan-leaf-config-runtime branch September 28, 2026 13:18
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

steipete added a commit that referenced this pull request Sep 28, 2026
Apply the canonical planner repairs from #160408, #160458, #160531, and
#160517 to the runtime cleanup branch. Preserve complete source facts,
canonical command ownership, and the existing PR-exempt test inventory.

The merged cohort passed its old-reader regression control, owner suites,
scoped changed checks, and 20 full original-group repetitions on two CPUs.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 29, 2026
Resolve target shape once before scanning database-worker owners, avoiding repeated directory probes for every inventory entry. Keep literal-file, directory, glob, and watch selection unchanged.
steipete added a commit that referenced this pull request Sep 29, 2026
#158916)

* refactor(runtime): deslop tasks, daemon, node-host and tui second pass

* test(update): mock canonical systemd activation admission

Keep native-start and retained-restart fixtures on the lifecycle admission owner after consolidation. Preserve real executor revocation, native command ordering and every assertion.

* test(runtime): track relocated decoder suppression

* test(tui): synchronize terminal fixture readiness

Inspect the current completed target screen instead of cumulative terminal output. Wait for startup readiness and command publication while isolating unrelated fd discovery in the exact-argument completion fixture.

* test(tui): isolate fallback projection from vendor policy loading

Use distinct synthetic provider/model identities while retaining foreign-run and malformed-event rejection, exact footer replacement, unchanged backend calls, and clean exit. Include captured terminal output when the exit assertion fails.

* test(tui): group session mode proof with identity fixtures

Move the self-contained mode-scoping case out of the general harness to retain the line cap. Preserve every assertion, the 20-second operation budget, the 25-second test budget, and owned fixture cleanup.

* refactor(runtime): reuse projection and worker dispatch values

Inline the one-use row identity before keyed refresh and integrate the deferred plugin-migration write-options cleanup from main (ad31034, #159426). Preserve worker admission, transaction ownership, options, and refresh order. Also use the synchronized current screen for the sibling stale-display-name assertion without changing its timeout or cleanup.

* test(tui): fence reused-session fixture transitions

* refactor(ui): colocate omitted media status rendering (#159938)

* fix(tui): preserve CLI lifecycle context for terminal events

Bind input and resize callbacks at terminal startup so later stdin events retain the existing CLI resource host and scheduler. Keep ingress authority and shutdown ownership unchanged. Add a focused callback-context regression; the real built CLI reproduces the original MCP scheduler error and passes with the adapter.

* fix(ci): keep chat attachment controls within lint limit (#160159)

Move the unchanged image data-URL decoder into the existing image helper to restore the 700-line lint limit.

Validated on Blacksmith Testbox: 34 attachment tests, all core lint stripes, targeted changed checks, and the UI build. Independent review found no actionable issues.

* test(daemon): assert incompatible custody release diagnostics

Align the four retained historical custody cases with b107d4a. Release now validates the stored generation directly rather than using the mutation-authority predicate, allowing paired cancellation settlement without hiding incompatible-row diagnostics. Require the full incompatibility error while preserving service callback refusal and exact sidecar identity, bytes, and stored-row assertions. Production behavior is unchanged.

Blacksmith Testbox tbx_01m3kf15jgcthvq4f69nxn8t28: pristine main ff8c752 fails 3/3 runs with the same four failures; the fix passes 24/24 tests in each of three runs through ci-run-node-test-shard with the daemon config, agentic-command-support shard, CI=1, and two workers. Three sibling files pass 32/32 tests. The single-worker pnpm test cost is 28.05s wall including cold compiler preparation. Targeted lint, formatting, and git diff --check pass.

check-changed runs but stops at pre-existing services graph TS2459 errors: package-update-activation-journal.test.ts:7 and package-update-activation-lifetime.test.ts:11 import assertReliabilityForcedExit, made private by 9491d5a. A clean baseline checkout with independent dependencies reproduces both exact errors. No unrelated fix, local validation, autoreview, or push is included; review and publication remain with the lead.

* fix(node-host): retain container timeout diagnostics

Restore the configured deadline and safe engine operation when runExec reports a sanitized timeout. Keep arguments and executable paths out of the diagnostic, preserve the original cause, and leave deadlines, daemon pinning, and cleanup unchanged.

Reproduced the container supervisor failure on main at 8b549de. The focused file now passes all 22 cases; the full supervisor, container, and process families pass 1193 tests with 49 skips across 110 files. Core typecheck, targeted lint/format, docs syntax, and independent P2 review pass. The new four-case deterministic file takes 1.82s Vitest wall; the existing integration file takes 41.03s, with no added processes or waits.

* fix(scripts): export assertReliabilityForcedExit for package update tests

#158491 imports it from two infra tests after #159362 made it module-local,
so the core test-types infra stripe failed on main with TS2459.

* fix(ci): keep test planning within its existing budgets

Apply the canonical planner repairs from #160408, #160458, #160531, and
#160517 to the runtime cleanup branch. Preserve complete source facts,
canonical command ownership, and the existing PR-exempt test inventory.

The merged cohort passed its old-reader regression control, owner suites,
scoped changed checks, and 20 full original-group repetitions on two CPUs.

* test(daemon): retain canonical stale-lease release expectation

Preserve #160288 when integrating main: a stale stored generation is rejected
before its replacement payload is decoded, so release returns false. Keep the
callback refusal and exact sidecar and database-row preservation assertions.

* fix(ci): adopt canonical Doctor repair lint fix

Apply #160715 so the pinned runtime branch includes the canonical repair
module split. Version and cohort planning use the existing targets owner;
installation retirement and transaction ordering stay with repair.

* ci: refresh runtime checks after canonical contract repairs

Refresh the PR merge ref after main fixed the unused 1Password dependency
in 4ed0cb3 and the retired runtime API
inventory in 5b76930.

The runtime source tree remains cd5b525,
matching the reviewed and completed Testbox proof.

* ci: refresh runtime validation after main CI fixes

* ci: refresh runtime checks after duplicate route repair
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 30, 2026
openclaw#158916)

* refactor(runtime): deslop tasks, daemon, node-host and tui second pass

* test(update): mock canonical systemd activation admission

Keep native-start and retained-restart fixtures on the lifecycle admission owner after consolidation. Preserve real executor revocation, native command ordering and every assertion.

* test(runtime): track relocated decoder suppression

* test(tui): synchronize terminal fixture readiness

Inspect the current completed target screen instead of cumulative terminal output. Wait for startup readiness and command publication while isolating unrelated fd discovery in the exact-argument completion fixture.

* test(tui): isolate fallback projection from vendor policy loading

Use distinct synthetic provider/model identities while retaining foreign-run and malformed-event rejection, exact footer replacement, unchanged backend calls, and clean exit. Include captured terminal output when the exit assertion fails.

* test(tui): group session mode proof with identity fixtures

Move the self-contained mode-scoping case out of the general harness to retain the line cap. Preserve every assertion, the 20-second operation budget, the 25-second test budget, and owned fixture cleanup.

* refactor(runtime): reuse projection and worker dispatch values

Inline the one-use row identity before keyed refresh and integrate the deferred plugin-migration write-options cleanup from main (13f2174, openclaw#159426). Preserve worker admission, transaction ownership, options, and refresh order. Also use the synchronized current screen for the sibling stale-display-name assertion without changing its timeout or cleanup.

* test(tui): fence reused-session fixture transitions

* refactor(ui): colocate omitted media status rendering (openclaw#159938)

* fix(tui): preserve CLI lifecycle context for terminal events

Bind input and resize callbacks at terminal startup so later stdin events retain the existing CLI resource host and scheduler. Keep ingress authority and shutdown ownership unchanged. Add a focused callback-context regression; the real built CLI reproduces the original MCP scheduler error and passes with the adapter.

* fix(ci): keep chat attachment controls within lint limit (openclaw#160159)

Move the unchanged image data-URL decoder into the existing image helper to restore the 700-line lint limit.

Validated on Blacksmith Testbox: 34 attachment tests, all core lint stripes, targeted changed checks, and the UI build. Independent review found no actionable issues.

* test(daemon): assert incompatible custody release diagnostics

Align the four retained historical custody cases with 82ab893. Release now validates the stored generation directly rather than using the mutation-authority predicate, allowing paired cancellation settlement without hiding incompatible-row diagnostics. Require the full incompatibility error while preserving service callback refusal and exact sidecar identity, bytes, and stored-row assertions. Production behavior is unchanged.

Blacksmith Testbox tbx_01m3kf15jgcthvq4f69nxn8t28: pristine main 5f12b85 fails 3/3 runs with the same four failures; the fix passes 24/24 tests in each of three runs through ci-run-node-test-shard with the daemon config, agentic-command-support shard, CI=1, and two workers. Three sibling files pass 32/32 tests. The single-worker pnpm test cost is 28.05s wall including cold compiler preparation. Targeted lint, formatting, and git diff --check pass.

check-changed runs but stops at pre-existing services graph TS2459 errors: package-update-activation-journal.test.ts:7 and package-update-activation-lifetime.test.ts:11 import assertReliabilityForcedExit, made private by 90bddde. A clean baseline checkout with independent dependencies reproduces both exact errors. No unrelated fix, local validation, autoreview, or push is included; review and publication remain with the lead.

* fix(node-host): retain container timeout diagnostics

Restore the configured deadline and safe engine operation when runExec reports a sanitized timeout. Keep arguments and executable paths out of the diagnostic, preserve the original cause, and leave deadlines, daemon pinning, and cleanup unchanged.

Reproduced the container supervisor failure on main at 2d04b95. The focused file now passes all 22 cases; the full supervisor, container, and process families pass 1193 tests with 49 skips across 110 files. Core typecheck, targeted lint/format, docs syntax, and independent P2 review pass. The new four-case deterministic file takes 1.82s Vitest wall; the existing integration file takes 41.03s, with no added processes or waits.

* fix(scripts): export assertReliabilityForcedExit for package update tests

openclaw#158491 imports it from two infra tests after openclaw#159362 made it module-local,
so the core test-types infra stripe failed on main with TS2459.

* fix(ci): keep test planning within its existing budgets

Apply the canonical planner repairs from openclaw#160408, openclaw#160458, openclaw#160531, and
openclaw#160517 to the runtime cleanup branch. Preserve complete source facts,
canonical command ownership, and the existing PR-exempt test inventory.

The merged cohort passed its old-reader regression control, owner suites,
scoped changed checks, and 20 full original-group repetitions on two CPUs.

* test(daemon): retain canonical stale-lease release expectation

Preserve openclaw#160288 when integrating main: a stale stored generation is rejected
before its replacement payload is decoded, so release returns false. Keep the
callback refusal and exact sidecar and database-row preservation assertions.

* fix(ci): adopt canonical Doctor repair lint fix

Apply openclaw#160715 so the pinned runtime branch includes the canonical repair
module split. Version and cohort planning use the existing targets owner;
installation retirement and transaction ordering stay with repair.

* ci: refresh runtime checks after canonical contract repairs

Refresh the PR merge ref after main fixed the unused 1Password dependency
in 3b5b7e1 and the retired runtime API
inventory in 1ed57fc.

The runtime source tree remains cd5b525,
matching the reviewed and completed Testbox proof.

* ci: refresh runtime validation after main CI fixes

* ci: refresh runtime checks after duplicate route repair
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦞 diamond lobster Very strong PR readiness with only minor 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.

1 participant