Repository navigation
fix(ci): prevent leaf-config ownership check timeouts - #160458
Conversation
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.
|
🦞👀 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: needs maintainer review before merge. Reviewed September 28, 2026, 8:57 AM ET / 12:57 UTC. ClawSweeper reviewWhat this changesThe 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 Review scores
Verification
How this fits togetherOpenClaw’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]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceTests +1. Total +1 across 1 file. View PR surface stats
Review metrics
Technical reviewBest 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. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Merged via squash.
|
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.
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.
#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
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
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
pnpm test test/scripts/ci-changed-node-test-plan.test.ts -t "retains leaf-config owners" --maxWorkers=1failed 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.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, andgit diff --check: passed.