Repository navigation
test(doctor,cli,config,sessions): remove low-value tests (batch d176) - #164348
Conversation
|
🦞👀 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 October 3, 2026, 10:47 AM ET / 14:47 UTC (Revision 2). ClawSweeper reviewWhat this changesConsolidates Doctor, update CLI, configuration, and session regression tests into shared fixtures and tables, removes redundant cases, and deletes an unused test-handler interception. Merge readiness✅ Ready for maintainer review Keep open: the cleanup remains distinct from current main, and the retention audit found no actionable correctness defect. The prior completed review also reported no findings. Likely related people: steipete and etzelm, as routing candidates supported by relevant merged history. Priority: P3 Review scores
Verification
How this fits togetherThese suites exercise OpenClaw’s diagnostics, updater, configuration loader, and session storage using controlled fixtures. Their assertions protect repair, recovery, ordering, and ownership behavior against future regressions. flowchart TD
A[Configuration and session fixtures] --> B[Regression test suites]
B --> C[Doctor and update operations]
B --> D[Configuration and session owners]
C --> E[Observed results and state]
D --> E
E --> F[Contract assertions]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceTests -2309. Total -2309 across 62 files. View PR surface stats
Review metricsNone. Technical reviewBest possible solution: Keep regression protection at its owning boundary while sharing fixtures and eliminating equivalent executions. Do we have a high-confidence way to reproduce the issue? Not applicable: this PR reduces redundant test maintenance rather than reporting a runtime bug; tests were not executed during this read-only review. Is this the best way to solve the issue? Yes: shared fixtures and tables preserve the reviewed distinct contracts without introducing production seams or competing implementations. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against db01f6d520b8. LabelsLabel changes: No label changes. Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
…openclaw#164348) * test(doctor): deslop u0153 tests * test(cli): deslop u0141 tests * test(doctor): deslop u0159 tests * test(doctor): deslop u0157 tests * test(doctor): deslop u0156 tests * test(config): deslop u0162 tests * test(commands): deslop u0160 tests * test(doctor): deslop u0158 tests * test(config): deslop u0163 tests * test(sessions): deslop u0168 tests * test: retain distinct regression coverage in batch d176
What Problem This Solves
The Doctor, update CLI, config, and session suites repeat fixture setup, equivalent matrix rows, and assertions already covered at their owning boundaries. This increases test maintenance without adding independent regression protection.
Why This Change Was Made
Replay the ten validated d176 campaign commits onto current main. Consolidate equivalent cases into tables, remove redundant executions, and remove an unused direct-handler interception from a shard-only test helper. Distinct migration, custody, recovery, authority, ordering, and platform regressions remain.
All ten commits applied; none skipped. A retention audit found that the consolidated environment-default cases only exercised the warning-callback route. Retain a three-line strict-mode assertion for missing and empty variables without adding a declaration; logging uses this strict route. One replay conflict in
src/config/sessions/session-pending-input-withdrawal.test.tswas resolved by combining the campaign's consumed/superseded custody table with main's receipt-settlement wait fromd6c1b1f9e14aa06443c685d81414911628e18914(#164284). The newer cleanup behavior is preserved for both table rows; no intended case or main-only behavior was dropped.User Impact
No production behavior, config, schema, or public API changes. The replay changes 61 test files and one test-support file: tests +4,750 / -7,048 lines (net -2,298), test support +0 / -11, production +0 / -0. There are no paths matched by the current CODEOWNERS rules.
Evidence
Local formatting, plain Oxlint, and
git diff --check origin/mainpassed. Each replay commit also passed plain Oxlint before committing. Focused Testbox proof and the changed gate are recorded below. Hosted CI is the merge gate; independent autoreview findings are resolved below.Original in-shard campaign measurements
These are the previously validated shard measurements, not a fresh coverage run on this PR head. Each includes all coverage groups; covered statements and branches decreased by at most 1%. Counts include unchanged files within the shard. The campaign retained distinct proofs when further reduction would lose behavior coverage.
Coverage drops above five statements in the original reports retain separate owner coverage: update target-schema sibling cases (u0141), retired-runtime/config-snapshot cases (u0159), and diagnostics fake-clock logging tests (u0168). The original u0141 changed gate encountered an inherited environment-variable budget mismatch; its remaining checks passed. Current replay validation is separate below.
Files touched by each shard
u0153
src/commands/doctor-memory-recall.test.tssrc/commands/doctor-retired-models.ordering.test.tssrc/commands/doctor-retired-models.successor-guard.test.tssrc/commands/doctor-sandbox-legacy-registry.test.tssrc/commands/doctor-sandbox.warns-sandbox-enabled-without-docker.test.tssrc/commands/doctor-session-sqlite-recovery-inventory.test.tsu0141
src/cli/skills-search-cli.test.tssrc/cli/update-cli.admission-ledger.test.tssrc/cli/update-cli.already-current.test.tssrc/cli/update-cli.config-convergence.test.tssrc/cli/update-cli.finalizer.test.tssrc/cli/update-cli.git-service.test.tsu0159
src/commands/doctor/shared/legacy-config-migrations.runtime.code-mode.test.tssrc/commands/doctor/shared/legacy-config-migrations.runtime.mcp.test.tssrc/commands/doctor/shared/legacy-config-migrations.runtime.tool-policy-conflicts.profiles.test.tssrc/commands/doctor/shared/legacy-config-migrations.runtime.tool-policy-conflicts.test.tssrc/commands/doctor/shared/legacy-config-migrations.runtime.tool-search.test.tssrc/commands/doctor/shared/legacy-context-budget.test.tssrc/commands/doctor/shared/legacy-tools-by-sender.test.tssrc/commands/doctor/shared/missing-configured-plugin-install.dependency-health.test.tsu0157
src/commands/doctor-sqlite-reclamation.test.tssrc/commands/doctor-update-rehearsal-inventory.test.tssrc/commands/doctor-update-schema-guard.test.tssrc/commands/doctor-web-fetch-proxy.test.tsu0156
src/commands/doctor-session-sqlite.retirement-disposal.test.tssrc/commands/doctor-session-sqlite.retirement-mutations.test.tssrc/commands/doctor-session-sqlite.retirement-verification.test.tssrc/commands/doctor-session-sqlite.source-conflict-recovery.test.tssrc/commands/doctor-session-sqlite.targets.test.tssrc/commands/doctor-session-title-repair.test.tssrc/commands/doctor-sqlite-compact.test.tssrc/commands/doctor-sqlite-nocow.test.tsu0162
src/config/config.browser-engines.test.tssrc/config/config.decision-model.test.tssrc/config/env-substitution.test.tssrc/config/includes.top-level-key.test.tsu0160
src/commands/doctor/shared/missing-configured-plugin-install.health.test.tssrc/commands/doctor/shared/missing-configured-plugin-install.version-drift.test.tssrc/commands/doctor/shared/release-configured-plugin-installs.persistence.test.tssrc/commands/gateway-setup-runtime.test.tsu0158
src/commands/doctor/auth-alias-migration.test.tssrc/commands/doctor/finalize-config-flow.test.tssrc/commands/doctor/shared/automatic-config-repair.test.tssrc/commands/doctor/shared/channel-doctor.test.tssrc/commands/doctor/shared/github-preview-upgrade.test.tssrc/commands/doctor/shared/legacy-config-compat.test.tssrc/commands/doctor/shared/legacy-config-migrate.e2e.test.tsu0163
src/config/io.runtime-async.test.tssrc/config/io.runtime-models.test.tssrc/config/io.snapshot.recovery.test.tssrc/config/io.write-effects.test.tssrc/config/io.write-effects.windows.test.tssrc/config/model-provider-config.test.tssrc/config/runtime-snapshot.preparation.test.tsu0168
src/config/sessions/session-history-worker-errors.test-support.tssrc/config/sessions/session-history-worker-errors.test.tssrc/config/sessions/session-pending-input-withdrawal.test.tssrc/config/sessions/session-reaction-store.test.tssrc/config/sessions/session-row-changes.test.tssrc/config/sessions/session-sqlite-target.worker.test.tssrc/config/sessions/session-transcript-fts.test.tssrc/config/sessions/session-transcript-projection-catchup.test.tsCurrent replay validation
oxfmt --writeon all 63 changed files, plainoxlint -c .oxlintrc.jsonon changed TypeScript, andgit diff --check: passed.tbx_01m410yzw4x2d7assvay5ea0gg, run 37128030484:CI=1 pnpm install --frozen-lockfile --prefer-offlinefollowed byCI=1 pnpm testwith all 62 changed test files passed 817 tests, with five unchanged Windows-only skips, across six Vitest shards. The command took 17m26s including dependency installation and required runtime build; Vitest wrapper time was 987.08s including its build preparation.CI=1 pnpm test src/config/env-substitution.test.tspassed all six tests on the same lease (503 ms Vitest duration, 1.25s test wrapper). Subsequent review corrections and their focused validation are recorded below.Review corrections and retained duplicates
Accepted five coverage findings. Retained the strict-mode fallback assertion; restored NOCOW regular-file mutation; restored Discord, Microsoft Teams, and Telegram sender-policy path rows. Dropped both campaign hunks in
src/config/schema.tiers.test.ts, preserving its published UI-tier policy assertions andanyOf/oneOf/allOfmatrix unchanged from the base.Rejected six proposed restorations after tracing the owners and remaining tests:
The deleted Doctor nested-dependency symlink case repeats
findMissingRequiredPluginDependenciescoverage insrc/plugins/status-dependencies-core.test.ts, whose scoped/unscoped managed-project matrices retainoutside-symlinkrejection. Doctor still tests its ancestor/hoisted dependency-root handoff. The owner suite is included in the correction validation.The deleted repeated-worker registry case is covered by the retained
registrationin-flight case insession-sqlite-target.worker.test.ts: the real single-worker pool executes before and after switching the registered owner fromopstomain, and the result must namemain.Non-default NOCOW modes were already set by the retained
seedDatabase()fixture (0640for the database and0750for its directory); the success case still records and compares those modes.The deleted NOCOW
busyfixture setsfuserstatus 0; it never simulates a busy atomic exchange. The retainedholderscase covers the same pre-exchange refusal with stronger batched-PID assertions, zero exchanges, and original-inode preservation.Symlinked launcher resolution belongs to
resolveOpenClawPackageRootsSync, called directly by Doctor.src/infra/openclaw-root.test.tsretains positive symlinked argv, nested symlink-target precedence, and node_modules fallback cases; Doctor retains script selection and execution checks.The cold-load registration race is folded into
prepares registrations added during a cold load before publishing and reusing its config: it startsloadPinnedRuntimeConfigAsyncwith an unresolved loader gate, registers preparers, then resolves loading and requires their contribution before publication.The first remote changed-gate attempt on
tbx_01m4127jp1tbc644et2ygnz21p(run 37129287173) did not execute: the Matrix native dependency download returned HTTP 503 during frozen installation. That lease stopped automatically. Correction proof and the changed gate use the already-installed first lease.Autoreview completed two rounds. Five accepted findings are corrected; the six rejected findings above require no further change.
Final correction gate
CI=1 pnpm test src/config/env-substitution.test.ts src/config/schema.tiers.test.ts src/commands/doctor-sqlite-nocow.test.ts src/commands/doctor/shared/legacy-tools-by-sender.test.ts src/plugins/status-dependencies-core.test.tspassed 120 tests across five files. The same warm Testbox then ran the delegatedpnpm check:changed -- <all 62 changed paths>payload with the repository's remote-child environment flags: all gates passed, including five core test type graphs, all three dead-export scans, and type-aware lint (0 warnings, 0 errors). Combined correction tests and changed checks took 7m31s. The earlier HTTP 503 is recovered; there is no remaining Testbox validation gap. The only later cleanup removes two redundant chmod calls already performed identically byseedDatabase; final plain Oxlint and whitespace checks pass.