Skip to content

test(runtime,ui,tooling): remove low-value tests (batch d026) - #167563

Merged
steipete merged 11 commits into
mainfrom
tcr/land-d026-1791502802
Oct 9, 2026
Merged

steipete merged 11 commits into
mainfrom
tcr/land-d026-1791502802

Conversation

@steipete

@steipete steipete commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

This maintainer-requested campaign batch removes redundant test cases and repeated fixture setup across channel turns, canvas widgets, Gateway Talk, browser setup, Doctor/session migration, Custodian UI, and plugin runtime tests.

User Impact

No user-visible behavior changes. Production runtime code is unchanged. The replay removes 1,970 net test lines and nine stale test-routing entries while preserving distinct regression, security, authority, and lifecycle coverage.

Why This Change Was Made

Replay all ten campaign shard commits onto main, then rebase onto 77cecb5449650c8efd3c261fecb4be08f82e7eed. Redundant variants and implementation-mirroring cases are removed; retained cases move into existing suites with their cleanup and routing preserved. Coverage alone was not used to justify deletion: distinct security and lifecycle cases remain even where their coverage overlaps.

The initial replay applied all ten commits without conflicts. The subsequent rebase had one conflict in src/acp/runtime/session-meta.legacy-migration.test.ts: main's final-metadata-commit authority fix from 71bcb79b44f is kept byte-for-byte, including initialization and closure cases; the batch's initialization-case deletion was dropped. All ten other commit patches are unchanged. Subsequent independent review retained 19 distinct contracts that the source reductions had removed; no whole commit was skipped. Current main's unrelated changes remain intact. Test-routing changes only remove paths deleted by this batch. No paths in this diff match the base CODEOWNERS rules.

Final diff against the pinned base: tests +2,319 / −4,289 (net −1,970); test-routing/tooling +0 / −9; production runtime +0 / −0. Overall: 42 changed files, +2,319 / −4,298, and 55 fewer test declarations. Per-shard final deltas below include the review corrections; original coverage figures remain the original worker measurements.

Evidence

Candidate: 9d2569cd3b4967b2131ec3ccae004eed14e95832. The completed Testbox results below belong to the pre-rebase candidate 523ddd38124b2aac0d1e3522d651f21fe4153a19; the rebase preserves the reviewed diff except for retaining more of main's ACP authority test.

Rebase validation: local formatting, plain changed-file oxlint, diff checks, and a conflict-free merge-tree check against fresh main passed. A fresh Testbox attempt for this head stalled during source preparation for more than ten minutes, then was interrupted before upload (exit 143). No post-rebase Testbox tests are claimed. Hosted CI is the final-head merge gate under the campaign infrastructure-gap rule.

  • pnpm test <26 surviving touched test files> <4 routing-owner tests>: 690 tests in 30 files passed, across all 12 routed Vitest projects in 293.98 seconds, after source hashes/deletion checks.
  • OPENCLAW_TESTBOX=1 node scripts/check-changed.mjs -- <batch paths>: all 27 core typecheck graphs, extension/script typechecks, formatting, boundaries, ratchets, and preceding guards passed on the replay. After review corrections, the core changed-path gate passed all seven selected typecheck graphs and preceding guards on the final candidate. Both attempts stopped at the same inherited dead-export scan; neither is reported as a green full gate.
  • Clean detached current main 3f76fe021990df309bfcd0905030520bb30f81f4, fresh frozen install, exact node --import tsx scripts/check-deadcode-exports.mts: reproduced the same four unused exports below. Those files and the scanner are unchanged by this batch.
  • Final oxfmt, plain changed-file oxlint -c .oxlintrc.json, and git diff --check: passed. Independent final review through P2: no actionable findings.
  • Infrastructure gap on the pre-rebase head: a separate extension typecheck and full core/extension/script lint invocation never reached remote execution. Source-capsule preparation was interrupted after 15 minutes without upload or payload start (exit 143). The initial extension typecheck passed before the retained-case corrections; final browser focused tests and local plain lint passed. Hosted CI remains the final-head gate for the unrun checks.

Blacksmith Testbox final candidate and clean-main proof, lease tbx_01m4f34n7py76wypxgwyh54eyy. Initial focused proof: run 37860860720, 657 tests before the retained-contract corrections. Broad changed-check proof: run 37862642709. The wrapper's command exit and timing records own these external lease results; stopping a completed lease may mark its hosting Actions run cancelled.

Inherited scan findings: bindCliQuestionAnswerAuthority in src/agents/cli-runner/tool-authority.ts; prepareSessionEventTargetForHost in src/auto-reply/reply/session-event-handoff.ts; readSessionEntryCreationTransition in src/config/sessions/session-accessor.sqlite-entry-cache-publication.ts; RESTART_CONTINUATION_CONTEXT_PREFIX in src/infra/heartbeat-events-filter.ts.

Each original shard stayed within the campaign's 1% covered-statement/branch loss gate. These are original in-shard coverage measurements, not a new aggregate coverage run on the rebased batch. The historical canvas changed-check run was interrupted by Testbox infrastructure; session-metadata broad checks had baseline-proven unrelated failures. Fresh replay validation is reported above.

Shard Final test LOC delta Final declaration delta Original in-shard coverage totals
w1238 -52 -2 covered statements 998 -> 998 (0); branches 802 -> 800 (-2); functions 214 -> 214 (0)
w1237 -223 -7 covered statements 303 -> 303 (0); branches 353 -> 353 (0); functions 38 -> 38 (0)
w1231 -59 -2 covered statements 29483 -> 29446 (-37); branches 19545 -> 19507 (-38); functions 5553 -> 5548 (-5)
w1240 -82 -5 covered statements 1151 -> 1151 (0); branches 891 -> 891 (0); functions 191 -> 191 (0)
w1239 -311 -12 covered statements 565 -> 565 (0); branches 521 -> 521 (0); functions 60 -> 60 (0)
w1221 -25 +0 covered statements 3985 -> 3982 (-3); branches 2368 -> 2361 (-7); functions 652 -> 652 (0)
w1232 -471 -9 covered statements 7164 -> 7148 (-16); branches 4003 -> 3991 (-12); functions 1637 -> 1634 (-3)
w1236 -409 -8 covered statements 545 -> 545 (0) branches 367 -> 367 (0) functions 90 -> 90 (0)
w1244 -102 -1 covered statements 1412 -> 1412 (0) branches 647 -> 646 (-1) functions 254 -> 254 (0)
w1243 -236 -9 covered statements 5139 → 5163 (+24) branches 3541 → 3561 (+20) functions 1124 → 1129 (+5)
Shard files and retained contracts
  • w1238: src/channels/turn/run-channel-turn.{pipeline,prepared-lifecycle,startup-admission}.test.ts. Startup admission moves into prepared lifecycle; account-stop and Gateway-stop cancellation races remain.
  • w1237: src/canvas/widget-tool.{grants,presenter,prompt,report,scheduled,script-syntax}.test.ts and widget-tool.test.ts. Retained grants, scheduled authoring, and script validation move into presenter; report security, UTF-8/large HTML, ownership, and generated-name collision regressions remain.
  • w1231: src/gateway/server.talk-{config,runtime}.test.ts. SecretRef, code-heavy speech, prototype-like aliases, and lifecycle coverage remain. Config reload has dedicated sibling coverage.
  • w1240: extensions/browser/src/cli/browser-cli-extension.{posix-upgrade,windows-setup}.test.ts. Explicit-context refusal, state-directory binding, serial cancellation, and final mutation-race guards remain.
  • w1239: src/commands/doctor/cron/store-migration.{schedule-kind,session-target}.test.ts and store-migration.test.ts. Retained cases move into the base suite; policy-owner selection and invalid/valid-date regressions remain.
  • w1221: ui/src/pages/custodian/custodian-page.session-lifecycle.test.ts and custodian-page.test.ts. Retained lifecycle cases move into base; secret clearing/masking, reconnect fencing, and incident races remain. This is test-only and changes no UI appearance.
  • w1232: src/config/sessions/legacy-main-session-migration.{bounded,handoff,input-handoff,ledger,race,startup}.test.ts, legacy-main-session-migration.test.ts, and scripts/lib/ci-proof-test-inventory.mts. Retained cases move into base; races and canonical-membership security remain; three deleted paths leave the inventory.
  • w1236: src/acp/runtime/session-meta.{alias-lifecycle,changes,key-repair,legacy-migration}.test.ts, session-meta.test.ts, scripts/lib/ci-policy-test-watch.mts, scripts/lib/ci-proof-test-inventory.mts, and test/vitest/vitest.database-worker-core-paths.mjs. Retained cases move into base; authority and recovery interleavings remain; routing cleanup removes five lines.
  • w1244: src/commands/doctor-maintenance.{settlement.refusals,settlement,stopped-activation,worker}.test.ts and scripts/lib/ci-proof-test-inventory.mts. Fourteen retained cases move into settlement; distinct authority/lifecycle refusals remain; one deleted path leaves the inventory.
  • w1243: src/plugins/runtime/runtime-agent.{session-color,session-patch,workspace}.test.ts and runtime-agent.test.ts. Session patch moves into color, workspace into base; ingress/commit authority, recovery ownership, queued archival, lifecycle replacement, and worker guards remain.
Independent review and retained contracts

P2 review retained explicit and selector-free installer guards, mixed-root atomicity, channel failure cleanup and identityless settlement, migration artifacts/discovery, ACP event negatives, stored cron target normalization, Custodian delivery certainty and reconnect history, report validation/naming, presenter precedence, dynamic capability prompts, Doctor error aggregation, and plugin initialization ordering. Talk resolver output assertions were folded into the retained code-heavy test. Final review found no actionable P0–P2 issue.

Eight findings were rejected with current-source and sibling-test evidence: ACP closure/source receipts are covered by retained canonical-edit and changed-source cases; legacy ACP session-ID reads by the retained runtime-reader fence; Doctor timeout and unchanged/during-write receipts by retained settlement and database-write tests; plugin unlocked rollback and refusal to overwrite a completed entry by retained creation cases; Talk persisted voice fields by the strict SecretRef resolver test. Each uses the same owning guard or failure path.

@clawsweeper

clawsweeper Bot commented Oct 9, 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.

@steipete
steipete enabled auto-merge (squash) October 9, 2026 01:57
@openclaw-barnacle openclaw-barnacle Bot added app: web-ui App: web-ui gateway Gateway runtime scripts Repository scripts commands Command implementations extensions: browser size: XL labels Oct 9, 2026
@steipete
steipete disabled auto-merge October 9, 2026 02:00
@clawsweeper

clawsweeper Bot commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs changes before merge.

What this changes

This PR consolidates regression suites, removes redundant cases, and removes test-routing entries for deleted suites.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) Useful consolidation has harness evidence, but the stale compatibility reference introduces a definite test failure.
Proof confidence 🦐 gold shrimp (3/6) Owner-directed test maintenance changes no shipped behavior; reported harness results support the consolidation, while final-head Testbox execution remains unclaimed and hosted checks are incomplete.
Patch quality 🦐 gold shrimp (3/6) 1 actionable review finding remain.

Product

Kind: Test only · Worth it: Yes
Reason: The established area contributor requested this maintenance campaign, and reducing repeated fixtures has maintenance value without expanding product behavior.

Merge readiness

⛔ Needs changes before merge - 1 item remains

Keep open: this is useful owner-directed maintenance, but one source-proven test-contract regression blocks a clean review.

Priority: P3
Reviewed head: 9d2569cd3b4967b2131ec3ccae004eed14e95832

Before merge

  • Update the compatibility record to the surviving workspace test suite (P2) - Deleting src/plugins/runtime/runtime-agent.workspace.test.ts leaves this record pointing to a nonexistent file. src/plugins/compat/registry.test.ts checks every record.tests path with fs.existsSync, so its keeps every record actionable test now fails. Replace this path with src/plugins/runtime/runtime-agent.test.ts, where the compatibility regression moved. This is a late discovery: the earlier reviewed head already had the same stale record and deleted suite.

Findings

  • [P2] Update the compatibility record to the surviving workspace test suite — src/plugins/compat/workspace-mutation-guard.ts:20

Provenance

  • Browser setup, Gateway Talk, and CI test-routing inventories: original intent not found (bb2d479; fdacaf0: Browser history records preservation of saved profiles and registered setup configuration; Talk history records expectation synchronization. Routing history shows continuing test-reduction maintenance, but the original inventory introduction was not established.)
Agent review details

How this fits together

OpenClaw’s regression suites check runtime, maintenance, browser setup, and Control UI behavior. CI selects these suites through routing inventories, while compatibility records identify tests protecting supported plugin contracts.

flowchart TD
  A[Repository changes] --> B[CI test selection]
  B --> C[Consolidated regression suites]
  C --> D[Runtime and UI contracts]
  E[Plugin compatibility records] --> F[Test path validation]
  F --> G[Test results]
  D --> G
Loading

Technical review

Best possible solution:

Keep distinct regressions in their existing owner suites and update compatibility metadata whenever those tests move.

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

Yes: the compatibility registry checks that every recorded test path exists, and this PR deletes one of those paths without updating the record; no failing run was executed during this read-only review.

Is this the best way to solve the issue?

Yes: consolidation into existing suites is appropriate, with a mechanical metadata correction needed to complete the move.

Full review comments:

  • [P2] Update the compatibility record to the surviving workspace test suite — src/plugins/compat/workspace-mutation-guard.ts:20
    Deleting src/plugins/runtime/runtime-agent.workspace.test.ts leaves this record pointing to a nonexistent file. src/plugins/compat/registry.test.ts checks every record.tests path with fs.existsSync, so its keeps every record actionable test now fails. Replace this path with src/plugins/runtime/runtime-agent.test.ts, where the compatibility regression moved. This is a late discovery: the earlier reviewed head already had the same stale record and deleted suite.
    Confidence: 0.99
    Late finding: first raised on code an earlier review cycle already covered.

Overall correctness: patch is incorrect
Overall confidence: 0.97

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 608134ea54c3.

Provenance checked

Testing

Proof path: in-process harness.

Security

None.

Evidence

Acceptance criteria:

  • pnpm test src/plugins/compat/registry.test.ts src/plugins/runtime/runtime-agent.test.ts --maxWorkers=1
  • git diff --check
  • node scripts/check-changed.mjs -- src/plugins/compat/workspace-mutation-guard.ts

What I checked:

  • Introduced scope: The pinned introduced delta changes tests and three test-routing inventories, without production runtime, configuration, dependency, or stored-data changes. (9d2569cd3b49)
  • Stale compatibility reference: The workspace compatibility record still names the deleted workspace suite; its retained compatibility test now lives in runtime-agent.test.ts. (src/plugins/compat/workspace-mutation-guard.ts:20, 9d2569cd3b49)
  • Deterministic failing contract: The registry's existing actionable-record test asserts that every recorded test path exists, so the deleted workspace path fails this assertion on the proposed head. (src/plugins/compat/registry.test.ts:80, 9d2569cd3b49)
  • Late-finding verification: GitHub's complete tree for the earlier reviewed head has the same compatibility-record and runtime-agent.test.ts blob IDs as the current head, and already lacks runtime-agent.workspace.test.ts. This concern was equally visible in the earlier review. (src/plugins/compat/workspace-mutation-guard.ts:20, 523ddd38124b)
  • Earlier ACP blocker resolved: The current suite retains both initialization and closure cases, the typed ACP commit-receipt selector, and the pending metadata postimage assertion from current-main commit 71bcb79. (src/acp/runtime/session-meta.legacy-migration.test.ts:191, 71bcb79b44fb)
  • Verified merge composition: The test merge has exactly the pinned main parent followed by the reviewed head parent. Its result deletes the workspace suite while leaving the compatibility record unchanged; unrelated main changes are not PR-owned edits. (src/plugins/runtime/runtime-agent.workspace.test.ts, 84d95e63a654)

Likely related people:

  • Peter Steinberger: Raw commit 71bcb79 adds src/acp/runtime/session-meta.legacy-migration.test.ts:192 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 71bcb79b44fb; files: src/acp/runtime/session-meta.legacy-migration.test.ts)

PR surface

Tests -1972, Other -7. Total -1979 across 42 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 40 2281 4253 -1972
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 2 0 7 -7
Total 42 2281 4260 -1979

Labels

Label changes:

  • add P3: This is test maintenance without a production behavior change or urgent user-facing failure.
  • add merge-risk: 🚨 automation: Deleting a test still referenced by the compatibility registry makes its existing path-validation test fail.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🦐 gold shrimp.
  • add status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.

Label justifications:

  • P3: This is test maintenance without a production behavior change or urgent user-facing failure.
  • merge-risk: 🚨 automation: Deleting a test still referenced by the compatibility registry makes its existing path-validation test fail.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🦐 gold shrimp.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only; repair and merge need explicit maintainer commands such as @clawsweeper autofix or @clawsweeper automerge.

History

Review history (1 earlier review cycle)
  • reviewed 2026-10-09T02:03:41.716Z sha 523ddd38124b2aac0d1e3522d651f21fe4153a19 :: needs changes before merge. :: none

Reviewed October 8, 2026, 10:31 PM ET / October 9, 2026, 02:31 UTC (Revision 2).

@steipete
steipete force-pushed the tcr/land-d026-1791502802 branch from 523ddd3 to 9d2569c Compare October 9, 2026 02:24
@steipete
steipete enabled auto-merge (squash) October 9, 2026 02:24
@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Oct 9, 2026
@steipete

steipete commented Oct 9, 2026

Copy link
Copy Markdown
Contributor Author

Confirmed the inherited CI failure for head 9d2569cd3b4967b2131ec3ccae004eed14e95832.

The only failed check in CI run 37874402877 is check-guards-architecture; openclaw/ci-gate reflects that failure. The other jobs finished with 54 successes and 24 intentional skips, with no cancelled test jobs.

The exact failing command was reproduced on clean detached checkouts in Blacksmith Testbox run 37877245073, lease tbx_01m4f9ncn9s3jht8k7ax0y9y6s:

node --import ./scripts/tsx.mjs scripts/check-madge-import-cycles.ts
PR base 77cecb5449650c8efd3c261fecb4be08f82e7eed: exit 1
Fresh main ae64a98a4eb1bc45765290f5b9988c75ce7eb8ca: exit 1
Madge import cycle check: 1 cycle(s).
src/agents/prepared-model-catalog-fingerprints.ts
  -> src/agents/prepared-model-catalog-worker.ts

Both runs verified their Git SHA and clean tracked tree around the frozen install. The batch changes neither cycle owner nor the scanner or its configuration. The same failure also appears in the completed full-main CI run 37871873098; the Testbox reproduction above is the independent baseline proof.

Proceeding with the approved pre-existing-failure exception, pinned to this head. The cycle remains a separate main repair.

@steipete
steipete merged commit 98eb575 into main Oct 9, 2026
140 of 143 checks passed
@steipete
steipete deleted the tcr/land-d026-1791502802 branch October 9, 2026 03:13
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 9, 2026
…aw#167563)

* test(channels): deslop w1238 tests

* test(canvas): deslop w1237 tests

* test(gateway): deslop w1231 tests

* test(browser): deslop w1240 tests

* test(commands): deslop w1239 tests

* test(ui): deslop w1221 tests

* test(scripts): deslop w1232 tests

* test(scripts): deslop w1236 tests

* test(scripts): deslop w1244 tests

* test(plugins): deslop w1243 tests

* test: preserve distinct contracts in reduction batch d026
steipete added a commit that referenced this pull request Oct 9, 2026
#167563 deleted src/plugins/runtime/runtime-agent.workspace.test.ts, but the
workspace-mutation-guard compatibility record still listed it, so the compat
registry's "keeps every record actionable" test failed on main. The deprecated
beforePersistentApply surface and its DEP_WORKSPACE_MUTATION_GUARD warning are
covered by src/plugins/runtime/runtime-agent.test.ts.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 10, 2026
openclaw#167563 deleted src/plugins/runtime/runtime-agent.workspace.test.ts, but the
workspace-mutation-guard compatibility record still listed it, so the compat
registry's "keeps every record actionable" test failed on main. The deprecated
beforePersistentApply surface and its DEP_WORKSPACE_MUTATION_GUARD warning are
covered by src/plugins/runtime/runtime-agent.test.ts.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: web-ui App: web-ui commands Command implementations extensions: browser gateway Gateway runtime merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. scripts Repository scripts size: XL 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