Repository navigation
test(cli, media, gateway): remove low-value tests (batch d215) - #165651
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: blocked before merge. Reviewed October 5, 2026, 12:01 PM ET / 16:01 UTC. ClawSweeper reviewWhat this changesThe branch removes repetitive tests, consolidates retained cases, trims unused fixtures, and removes obsolete test-routing and mock-baseline entries. Merge readiness⛔ Blocked before merge - 3 items remain Keep open as useful test maintenance that remains distinct from current main. The inspected consolidations preserve meaningful boundary coverage, and no concrete introduced defect was established. Priority: P3 Review scores
Verification
How this fits togetherOpenClaw's test suites exercise CLI commands, media handling, message delivery, Gateway operations, secrets, and the Codex plugin. Vitest runs these checks to detect regressions before changes reach users. flowchart TD
A[OpenClaw behavior contracts] --> B[Retained regression tests]
C[Shared test fixtures] --> B
D[Test routing metadata] --> E[Vitest projects]
B --> E
E --> F[CI results]
Before merge
Agent review detailsSecurityNone. PR surfacePR surface statistics unavailable: the file list is incomplete. Review metricsNone. Stored data modelPersistent data-model change detected: Technical reviewBest possible solution: Keep one strong test owner for each observable contract while consolidating fixtures and retaining security, lifecycle, and regression boundaries. Do we have a high-confidence way to reproduce the issue? Not applicable: this PR consolidates existing tests rather than reporting or repairing a product failure; reviewer execution was outside the read-only scope. Is this the best way to solve the issue? Yes for the inspected changes: consolidating retained boundary tests and removing repetitive variants follows the existing test-owner approach without adding production seams. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 8ccf43d1764c. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
…law#165651) * test(cli): deslop w0069 tests * test(media): deslop w0068 tests * test(outbound): deslop w0077 tests * test(cli-runner): deslop w0071 tests * test(gateway): deslop w0073 tests * test(gateway): deslop w0075 tests * test(agents): deslop w0070 tests * test(cli): deslop w0074 tests * test(secrets): deslop w0078 tests * test(codex): deslop w0079 tests
What Problem This Solves
The CLI, media, outbound, Gateway, agent, secrets, and Codex plugin suites contain duplicate behavior checks and repeated fixtures that add maintenance cost without independent coverage.
User Impact
No user-visible behavior changes. This batch changes no runtime production code and retains security, authority, lifecycle, and regression coverage.
Why This Change Was Made
Replay ten audited test-cleanup commits onto current main. Consolidate retained cases at their existing owners, remove low-value repetitions and unused test support, and shrink obsolete mock-export and database-worker routing entries.
All ten commits were applied in the supplied order; none was skipped. Replay started at
38d1253242c4dbb4c2e005fb6b187e3418fed9a7.Conflict resolutions:
src/infra/outbound/payloads.test.ts: keep main's newly added multiline Markdown-image regression alongside the single-line row; remove the audited duplicate MEDIA-directive row and retain the shared assertions.src/gateway/server-methods/system-agent.test.ts: remove the audited duplicate history-seeding wiring case after its async API conversion on main; preserve main's async APIs and other tests.src/gateway/server-methods/tools-effective.test.ts: apply the audited removals of the warm-workspace, filtered-MCP, and global-session wiring cases after main's async inventory conversion; keep main's async mocks and newly added tests elsewhere.Final diff: test files +4,967 / −12,288 (net −7,321); test support +21 / −224 (net −203); test metadata +0 / −9; runtime production 0. Total: 7,533 fewer lines across 93 files.
CODEOWNERS visibility: none of the changed paths matches a rule in the current
.github/CODEOWNERS.Evidence
pnpm install --frozen-lockfile --prefer-offline: passed.node_modules/.bin/oxfmt --write <changed TS/JS files>, plainoxlint -c .oxlintrc.json <changed TS/JS files>, andgit diff --check origin/main: passed.tbx_01m46bj5z39wccdd42ybwr0qc0: source236c753203acbe0f445414328fcb688d6fe1e884, tree8c08adc445a27dabdac5eba926855e43ce76486dverified by the repository wrapper.CI=1 pnpm install --frozen-lockfile --prefer-offline && CI=1 pnpm test <all 66 surviving touched test files>passed: 66 files, 1,345 cases, 11 Vitest projects, 376.15 seconds. Ten pre-existing platform conditions skipped nine real-Fish cases and the macOS Bash UTF-8 byte-offset case. No failed tests.node scripts/check-changed.mjs --dry-run -- <all changed paths>selected core tests, extension tests, and tooling.OPENCLAW_TESTBOX=1 node scripts/check-changed.mjs -- <all changed paths>allocatedtbx_01m46c7exaxcz7p43k8qnmes4z, which remained queued. That unused allocation was stopped, and the same changed-file gate was submitted on the now-idle focused-test lease withOPENCLAW_CHECK_CHANGED_REMOTE_CHILD=1 OPENCLAW_CHANGED_LANES_RAW_SYNC=1; it is pending source staging. No executed changed-file check has failed. Hosted CI supplies the required merge gate; this gap is recorded under the campaign's authorized infrastructure exception.codex-rs/app-server-protocol/src/protocol/v2/{item,turn,thread}.rs; this batch changes no protocol or runtime behavior.Independent autoreview runs during hosted CI. GitHub's required
openclaw/ci-gateis the merge gate for this authorized campaign batch.Per-shard files, test reductions, coverage totals, and historical limitations
Shard evidence
These are historical in-shard measurements for the ten source commits in batch d215. Fresh validation of the rebased batch is reported separately. The retained tests protect distinct regressions, security and authority boundaries, and lifecycle interleavings. All shards report zero case folding. Nine shards intentionally stopped below the campaign's 30% declaration-reduction target to preserve those contracts; w0077 exceeded it.
The ten supplied source commits together change test files by +4,971/−12,292 lines (net −7,321), test support by +21/−224 (net −203), and metadata by +0/−9. They change no runtime production files. The final PR diff owns the actual landing totals after replay and conflict resolution. Two historical LOC figures differ slightly from the supplied commits: w0070's supplied commit removes 351 net test lines versus the report's 347, and w0075 removes 443 versus 441. The other eight source-commit test deltas match their reports.
Exact historical coverage totals
Reported statement and branch losses remain below 1% within the compared groups. The exclusions and incomplete refresh below qualify that statement.
w0069 — completion, hooks, and devices CLI
Changed files:
Removed 75 completion, 50 hooks, and five devices cases covering repeated inventories, formatting, shell variants, registration, scope selection, and fallback paths. Retained generated-shell injection and word-boundary regressions, process termination/settlement interleavings, symlink boundaries, and device authority revalidation. Production and test-support changes: none.
w0068 — media fetch and storage
Changed files:
Removed 72 metadata/filename, fetch, retry, and error-path replays; consolidated three split files. Trimmed five net LOC from the exclusive fetch support helper. Retained security, regression, and race coverage. Runtime production changes: none.
w0077 — outbound message actions and payloads
Changed files:
Removed 81 payload replays, execution variants, and runner duplicates. Retained authority boundaries, races, and regressions. Production and test-support changes: none.
w0071 — CLI runner
Changed files:
Removed 13 repeated hydration/cache, spawn diagnostics/environment, prompt, side-question, and settlement cases. Retained stale lifecycle rejection, current hook authority, redaction, hard deadlines, dangerous environment sanitization, ambient credential clearing, cancellation, and model revocation. An attempted file consolidation was reverted after the growth ratchet rejected it. Production and test-support changes: none.
w0073 — Gateway server methods
Changed files:
Removed 48 lifecycle-method replays, ten inspection/catalog duplicates, 13 effective-tool wiring cases, six approval-client variants, and three chat/setup duplicates. Retained authority revocation, registry-generation races, contention, storage-failure redaction, and session-reset regression coverage. Strengthened the forged-auth negative control. Removed exactly three obsolete mock-baseline entries; no production or test-support changes.
w0075 — Gateway probe, dispatch, and reload
Changed files:
Removed ten probe wiring/cache replays, five device-auth variants, nine TLS variants, 14 dispatch duplicates, and eight reload replays. Moved the two runtime-store cases into prepared-borrow. Trimmed 198 net LOC across three exclusive support helpers. Retained unverified-listener security, authority, lifecycle, and coverage-sensitive cases; three candidates were restored to preserve coverage. Runtime production changes: none.
w0070 — agent tool construction and permissions
Changed files:
Removed 32 construction/inventory/provider, memory-flush, native-search, description/routing, authority/bridge, and alias-patch replays. Retained explicit-deny precedence, successful-completion persistence ordering, run-scope isolation/revocation, owner-authored handoffs, read-only authority, traversal and symlink containment. Production and test-support changes: none.
w0074 — skills and capability CLI
Changed files:
Removed 17 skills variants, 12 capability variants, three lazy-registration rows, and four duplicate web-fetch cases. Preserved malformed-verification rejection, remote Gateway authority, error redaction, ambiguous-selector regressions, trusted provenance, no mutation replay, credentialless offline upgrades, and timeout behavior. Two timeout cases were restored after the first coverage comparison. Removed exactly four obsolete mock-baseline entries; no production or test-support changes.
w0078 — secrets
Changed files:
Removed 61 registry replays, 22 duplicate table rows, and 36 discovery/resolution/state cases; merged the store-reference split. Retained inherited-property rejection, filesystem/permission boundaries, timeout regressions, endpoint credential isolation, redaction, snapshot publication races, and auth-store mutation interleavings. Production and test-support changes: none.
w0079 — Codex dynamic tools and native subagent monitor
Changed files:
Removed 33 dynamic-tool output/status/wiring variants, four automation variants, and seven monitor duplicates. Retained current-turn custody authority, stale-close replacement ownership, split/truncated credential handling, screenshot authority, approval rejection, and completion/receipt ordering. Removed exactly two deleted paths from the database-worker list; moved retained cases preserve existing database-worker routing. Production and test-support changes: none.
Historical evidence limits
agent-tools.deferred-followup-guidance.test.tsand unchangedagent-tools.session-portal.test.ts, because the baseline portal fixture failed. Guidance deletions additionally had passing per-file case coverage. The aggregate figures are not complete coverage of that shard.