Skip to content

test(core,plugins,ui): remove low-value tests (batch d116) - #162019

Merged
steipete merged 11 commits into
mainfrom
tcr/land-d116-1790784241
Sep 30, 2026
Merged

steipete merged 11 commits into
mainfrom
tcr/land-d116-1790784241

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

This maintainer-requested campaign batch removes overlapping test cases and repeated fixtures across custodian, media, iMessage, agent execution, plugin hooks, configuration, chat history, channel turns, and voice calls.

User Impact

No user-visible behavior change. Retained tests continue to cover authorization and lifecycle fencing, cancellation, privacy, media validation, delivery accounting, and recovery. No configuration, schema, dependency, or release changes.

Why This Change Was Made

Consolidate duplicate matrices and helper-level assertions at their existing behavior boundaries. The sole production edit makes resolveImageCompressionGrid private to src/media/web-media.ts; all current callers are in that module. Remove two stale max-lines entries and two references to a deleted test suite.

All ten supplied commits replayed without conflicts onto main at 3d0f45ee9cf4517a8e6f3b9bf048bafd2c508760. None were skipped and no replay hunks were dropped. The supplied CLI-runner commit already preserves the newer fast-mode case in the installation-target suite. Named parser and causal-stream sibling regressions remain unchanged and are included in fresh focused validation.

Diff accounting against the landing base: production +1/-1 (net 0); tests +7805/-21249 (net -13444); test routing +0/-1; tooling/baselines +0/-3. No touched path matches the current CODEOWNERS rules.

Per-shard campaign evidence and files

Coverage figures below are the original in-shard before/after measurements, not a new aggregate coverage run. Statements and branches decreased by less than 1% per shard. Declaration counts count source it/test declarations, with each table counted once; executed tests include table expansion. Final LOC and declaration deltas include the review restorations described below; the original executed-test and coverage figures remain campaign evidence. The CLI-runner and voice-call shards retain documented regressions despite missing their original 50% LOC reduction targets; voice-call also retained more than half its executed tests.

Shard Executed tests Test LOC (campaign) Final test LOC delta Declarations Covered totals
t0394 91 → 45 2815 → 1407 -1313 74 → 40 (-34) covered statements 3983 -> 3974 (-9); branches 2403 -> 2386 (-17); functions 663 -> 659 (-4)
t0397 93 → 46 1707 → 839 -868 73 → 43 (-30) covered statements 806 -> 805 (-1); branches 621 -> 619 (-2); functions 145 -> 145 (0)
t0396 110 → 55 2476 → 1162 -1297 77 → 48 (-29) covered statements 765 -> 761 (-4); branches 556 -> 551 (-5); functions 103 -> 101 (-2)
t0392 117 → 50 2367 → 1183 -1184 75 → 43 (-32) covered statements 980 -> 979 (-1); branches 659 -> 658 (-1); functions 124 -> 124 (0)
t0383 90 → 45 2912 → 1237 -1675 69 → 34 (-35) covered statements 1067 -> 1067 (0); branches 508 -> 503 (-5); functions 228 -> 228 (0)
t0388 120 → 60 4436 → 2845 -1548 74 → 51 (-23) covered statements 4653 -> 4640 (-13); branches 3499 -> 3471 (-28); functions 719 -> 715 (-4)
t0405 95 → 47 2090 → 1017 -1073 62 → 36 (-26) covered statements 1850 -> 1848 (-2); branches 1132 -> 1122 (-10); functions 280 -> 280 (0)
t0403 135 → 55 2935 → 1465 -1470 76 → 44 (-32) covered statements 3981 -> 3962 (-19); branches 3331 -> 3298 (-33); functions 664 -> 661 (-3)
t0400 81 → 40 3452 → 1726 -1677 73 → 36 (-37) covered statements 976 -> 977 (1); branches 768 -> 764 (-4); functions 206 -> 207 (1)
t0398 90 → 49 3948 → 2514 -1339 73 → 44 (-29) covered statements 1883 -> 1878 (-5); branches 1012 -> 1003 (-9); functions 355 -> 357 (+2)

Files, using brace notation for related paths:

  • t0394: ui/src/pages/custodian/custodian-page{,.channel-onboarding,.history,.nudges,.session-lifecycle}.test.ts.
  • t0397: src/media/web-media.test.ts, src/media/web-media.ts, config/max-lines-baseline.txt.
  • t0396: extensions/imessage/src/actions{,.runtime}.test.ts, config/max-lines-baseline.txt.
  • t0392: src/agents/tools/gateway{,.hosted-routing,.operator-scopes,.runtime-identity}.test.ts, scripts/lib/ci-proof-test-inventory.mts, test/vitest/vitest.database-worker-core-paths.mjs.
  • t0383: src/plugins/hooks.{before-agent-finalize,before-agent-reply,before-install,before-tool-call,compaction-timeout,correlation,model-override-wiring,phase-hooks,security,skill-lifecycle}.test.ts.
  • t0388: src/agents/cli-runner/execute.{background-work,fast-mode,installation-target,pending-cancellation,supervisor-capture}.test.ts.
  • t0405: src/config/validation.{allowed-values,channel-metadata,cold-imports,legacy-rules-fast-path,policy,sandbox-container-env}.test.ts.
  • t0403: ui/src/pages/chat/chat-history{,.inflight,.media,.run-error,.startup}.test.ts.
  • t0400: src/channels/turn/run-channel-turn.{custody,delivery,finalize,pipeline,prepared-lifecycle}.test.ts.
  • t0398: extensions/voice-call/src/webhook{,.auto-response.lifecycle,.hangup-once.lifecycle,.provider-discovery,.shutdown.lifecycle,.upgrade}.test.ts.

The original CLI-runner report predates its lane replay, which retained a newly added fast-mode case and therefore changes the LOC delta. The plugin shard's old max-lines failure is historical evidence only; current validation is reported below.

Evidence

  • Local frozen dependency install passed.
  • Changed-file oxfmt --write, plain oxlint -c .oxlintrc.json (exit 0), and git diff --check origin/main passed.

Independent review identified nine retained-contract gaps and these were restored before publication: ambiguous SSH edit rejection; mismatched CLI source routes; delayed webhook persistence acknowledgment; inbound HTTP auto-response without conversation mode; durable route/requester metadata; visible-but-identityless pending completion; assembled-dispatch adoption forwarding; typed wizard cancellation; and ordinary-send/session-reconnect behavior.

Three review findings were rejected with existing canonical-owner proof: src/gateway/agent-runtime-identity-token.test.ts independently rejects execution identity from another run, and extensions/imessage/src/send.test.ts independently tests each hidden-content marker across poll/text actions. Those suites passed correction validation, alongside the custodian store tests. A later secret-deletion finding is covered by secrets-tool.test.ts (explicit required identity), retained hosted-routing required-token coverage, and server-methods/secrets.lifecycle.test.ts (retired delegated authority cannot delete). The reconnect case also retains explicit original-send and rejoin session-ID assertions. A mixed index/working-tree review was incomplete; the final review selects the staged candidate.

  • Initial focused replay validation passed: 44 test files, 13 routed Vitest shards, 144.69s, including unchanged parser and causal-stream owner suites. Blacksmith run.
  • Correction validation passed: 328 tests across 10 files / 7 routed shards in 128.09s. The same remote command completed the full changed-file gate: all 27 core test-type graphs, core/extension/script types, all three dead-export scans, core/extension/script lint (zero warnings/errors), formatting, ratchets, and repository guards. Blacksmith run. The provider reported command exit 0; its local wrapper then stalled in cleanup and was stopped. Both owned leases were stopped.
  • Final staged independent autoreview passed at P0/P1 with no findings across all three passes. Nine initial contract gaps were restored; one follow-up strengthened session-ID assertions. Three findings were rejected using the canonical-owner evidence above.
  • Infrastructure gap: the final two session-ID assertions (five lines) in the restored custodian reconnect test were added after the successful remote snapshot. That test passed before those assertions; the final assertion-only delta passed local formatting/lint and staged autoreview, but its remote rerun could not execute after the wrapper cleanup stall. Hosted required CI gates the published candidate under the campaign's infrastructure-gap rule. No executed test or code gate remains failing.

@clawsweeper

clawsweeper Bot commented Sep 30, 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) September 30, 2026 17:43
@openclaw-barnacle openclaw-barnacle Bot added channel: imessage Channel integration: imessage channel: voice-call Channel integration: voice-call app: web-ui App: web-ui scripts Repository scripts docker Docker and sandbox tooling agents Agent runtime and tooling size: XL labels Sep 30, 2026
@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 Sep 30, 2026
@clawsweeper

clawsweeper Bot commented Sep 30, 2026

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed September 30, 2026, 1:55 PM ET / 17:55 UTC.

ClawSweeper review

What this changes

The branch consolidates tests across core, plugins, channels, and the Control UI, updates test inventories, and makes one internal media helper private.

Merge readiness

⛔ Blocked before merge - 3 items remain

Keep this PR open. The cleanup remains useful, but deleting a hook security test leaves an active compatibility record pointing to a file that no longer exists; the registry's test checks that path.

Priority: P3
Reviewed head: bd52c3b6aac791719317fc35c48b32a7ec80702c

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The consolidation has substantial focused validation, but a deterministic stale registry reference needs repair.
Proof confidence 🐚 platinum hermit (4/6) Not applicable: This maintainer-admin test cleanup makes no user-visible runtime change; its only production edit narrows an internal media export. The PR supplies focused validation for an earlier candidate and identifies an unrerun final assertion change; no stored-data contract changes.
Patch quality 🦐 gold shrimp (3/6) 1 actionable review finding remain.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This maintainer-admin test cleanup makes no user-visible runtime change; its only production edit narrows an internal media export. The PR supplies focused validation for an earlier candidate and identifies an unrerun final assertion change; no stored-data contract changes.
Evidence reviewed 7 items Introduced deletion: The introduced patch deletes the entire hook security test file.
Stale active record: The active before-tool-call compatibility record still names the deleted test file.
Failing assertion path: The registry test requires every recorded test path to exist, so the deleted path makes this assertion fail when the suite runs.
Findings 1 actionable finding [P2] Update the compatibility record before deleting its named test
Security None None.

How this fits together

OpenClaw plugin hooks can block tool calls and change outgoing messages. Hook tests guard those contracts, while a compatibility registry names their test files and a registry test checks that the files exist.

flowchart LR
A[Test cleanup] --> B[Retained hook tests]
C[Plugin hook behavior] --> B
B --> D[Compatibility record]
D --> E{Named file exists?}
E --> F[Registry test result]
Loading

Before merge

  • Update the compatibility record before deleting its named test (P2) - This PR deletes hooks.security.test.ts, but this active record still lists it. src/plugins/compat/registry.test.ts asserts that every listed test path exists, so its registry check will fail on the merged tree. Point the record to the retained hook suite.
  • Resolve merge risk (P1) - The active compatibility inventory would name a nonexistent hook test, and its file-existence check would fail when run.
  • Complete next step (P2) - Replace the deleted hook security test path in the compatibility record and verify its registry check.

Findings

  • [P2] Update the compatibility record before deleting its named test — src/plugins/compat/registry-records.ts:351
Agent review details

Security

None.

PR surface

Source 0, Tests -9308, Other -3. Total -9311 across 53 files.

View PR surface stats
Area Files Added Removed Net
Source 1 1 1 0
Tests 50 4999 14307 -9308
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 2 0 3 -3
Total 53 5000 14311 -9311

Review metrics

None.

Merge-risk options

Maintainer options:

  1. Repair the registry reference (recommended)
    Replace the deleted path with the retained hook test path and run the focused compatibility registry test before merge.
Copy recommended automerge instruction
@clawsweeper automerge

Special instructions:
Replace the deleted hooks.security.test.ts path in the active compatibility record with the retained hooks.before-tool-call.test.ts path, then verify the focused registry and hook suites.

Technical review

Best possible solution:

Point the compatibility record at the retained hook suite so its test inventory stays accurate after consolidation.

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

Yes. On this PR head, the registry names a deleted file and its test checks file existence; I did not execute the suite in the read-only checkout.

Is this the best way to solve the issue?

No, not yet. Consolidating the hook tests is reasonable, but the active compatibility record needs the same cutover.

Full review comments:

  • [P2] Update the compatibility record before deleting its named test — src/plugins/compat/registry-records.ts:351
    This PR deletes hooks.security.test.ts, but this active record still lists it. src/plugins/compat/registry.test.ts asserts that every listed test path exists, so its registry check will fail on the merged tree. Point the record to the retained hook suite.
    Confidence: 0.99

Overall correctness: patch is incorrect
Overall confidence: 0.96

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add P3: This is an internal test cleanup with no intended user-visible behavior change.
  • add merge-risk: 🚨 automation: Deleting a test named by the active compatibility registry makes its file-existence test fail.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🐚 platinum hermit and patch quality is 🦐 gold shrimp.
  • add status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action. Not applicable: This maintainer-admin test cleanup makes no user-visible runtime change; its only production edit narrows an internal media export. The PR supplies focused validation for an earlier candidate and identifies an unrerun final assertion change; no stored-data contract changes.

Label justifications:

  • P3: This is an internal test cleanup with no intended user-visible behavior change.
  • merge-risk: 🚨 automation: Deleting a test named by the active compatibility registry makes its file-existence test fail.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🐚 platinum hermit and patch quality is 🦐 gold shrimp.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action. Not applicable: This maintainer-admin test cleanup makes no user-visible runtime change; its only production edit narrows an internal media export. The PR supplies focused validation for an earlier candidate and identifies an unrerun final assertion change; no stored-data contract changes.

Evidence

Acceptance criteria:

  • [P1] node scripts/run-vitest.mjs src/plugins/compat/registry.test.ts src/plugins/hooks.before-tool-call.test.ts.
  • [P1] git diff --check.

What I checked:

Likely related people:

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

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Correct the compatibility record and run its focused test on the final head.

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 disabled auto-merge September 30, 2026 17:58
@steipete

Copy link
Copy Markdown
Contributor Author

The only failing CI test job on head bd52c3b6aac791719317fc35c48b32a7ec80702c is pre-existing on main:

  • Job: checks-node-changed-compact-large-7 (PR job).
  • Test: src/cli/update-cli.windows-lifecycle.test.ts → restores Windows Scheduled Task autostart on SIGINT during package suspension, throwing ExitError(1) through update-command-triage.ts:177.
  • Clean detached main proof: 6830c82ea080767b8953edce13a3e543eed419da, verified clean before testing, Node 24.19.0 / pnpm 12.5.1, Blacksmith Testbox run, lease tbx_01m3ssks2m3w13h644zcv7fket.
  • Replayed the original job command, node --import tsx scripts/ci-run-node-test-shard.mts, with both original group selectors and worker settings (four for Gateway methods, two for the failing infrastructure group). Current main reproduced the identical single failing test: 35 files / 692 tests passed, one file / one test failed. The preceding Gateway groups passed 309 and 412 tests. The command exited 1; no assertion, timeout, or skip was changed.
  • This PR changes neither that test nor the update/daemon/runtime code it exercises. All other CI jobs completed successfully or were intentionally skipped; the aggregate openclaw/ci-gate is red solely because of this job.

Landing the exact head under the campaign's explicitly authorized pre-existing-main-failure exception. The main failure is recorded for the coordinator's separate repair.

The earlier local final-assertion validation gap is closed by hosted proof: checks-ui (2/3) passed the restored pending ordinary-turn/client-replacement test, including its final session-ID assertions (job).

@steipete
steipete merged commit 404e47a into main Sep 30, 2026
219 of 227 checks passed
@steipete
steipete deleted the tcr/land-d116-1790784241 branch September 30, 2026 18:50
steipete added a commit that referenced this pull request Sep 30, 2026
…gistry record

Test-removal batch d116 (#162019) deleted src/plugins/hooks.security.test.ts
but the hook.before_tool_call.terminal-block-approval compatibility record
still listed it, so the registry's "keeps every record actionable" check
failed on main for every PR merge ref. The record keeps its remaining
before_tool_call e2e proof.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 1, 2026
…162019)

* test(custodian): deslop t0394 tests

* test(media): deslop t0397 tests

* test(imessage): deslop t0396 tests

* test(agents): deslop t0392 tests

* test(plugins): deslop t0383 tests

* test(cli-runner): deslop t0388 tests

* test(config): deslop t0405 tests

* test(ui): deslop t0403 tests

* test(channels): deslop t0400 tests

* test(voice-call): deslop t0398 tests

* test: preserve independent contracts in d116 cleanup
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 1, 2026
…gistry record

Test-removal batch d116 (openclaw#162019) deleted src/plugins/hooks.security.test.ts
but the hook.before_tool_call.terminal-block-approval compatibility record
still listed it, so the registry's "keeps every record actionable" check
failed on main for every PR merge ref. The record keeps its remaining
before_tool_call e2e proof.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling app: web-ui App: web-ui channel: imessage Channel integration: imessage channel: voice-call Channel integration: voice-call docker Docker and sandbox tooling 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