Repository navigation
test(core,ui,plugins,ci): remove low-value tests (batch d008) - #158663
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 September 26, 2026, 3:00 AM ET / 07:00 UTC (Revision 2). ClawSweeper reviewWhat this changesThe branch removes repeated test cases and consolidates fixtures across agent, Gateway, plugin, CLI, Telegram, Control UI, and CI tests without changing production code. Merge readiness⛔ Blocked before merge - 1 item remains Keep open. This branch has substantial test cleanup still absent from current main. The merged Telegram cleanup covers only part of it, and the earlier merge conflict is resolved. Sampled security, routing, media, and lineage contracts retain owner-level tests. Priority: P3 Review scores
Verification
How this fits togetherOpenClaw's test suites exercise agent runs, Gateway requests, plugins, channel delivery, CLI commands, and Control UI chat. CI runs those suites to detect behavior regressions before merge. flowchart LR
A[Production behavior] --> B[Test fixtures]
B --> C[Agent and Gateway tests]
B --> D[Plugin and UI tests]
C --> E[CI checks]
D --> E
E --> F[Merge signal]
Before merge
Agent review detailsSecurityNone. PR surfaceTests -8191. Total -8191 across 62 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Keep one independent regression test at each meaningful owner boundary while removing duplicate cases and fixtures, then use the existing exact-head CI gate for merge readiness. Do we have a high-confidence way to reproduce the issue? Not applicable: this PR reports test maintenance rather than a failing user behavior, and the introduced diff changes test files only. Is this the best way to solve the issue? Yes, based on the inspected cases: the cleanup removes overlap while sampled high-impact contracts retain owner-level coverage. Exact-head CI remains the normal validation gate. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against edfa5df633ee. LabelsLabel 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)
|
0add221 to
9210ca5
Compare
158 upstream commits, none in extensions/feishu. Two conflicts, both generated: docs/.generated/config-baseline.sha256 and src/config/bundled-channel-config-metadata.generated.ts. Upstream's Telegram webhook change (openclaw#158732) moved the channel schema while this branch moves it for Feishu. Both files came from upstream and were regenerated. config-baseline.counts.json auto-merged without a conflict but was wrong: each side took the channel count from 3740 to 3742 for its own entries, so git kept 3742. The real count with both sides is 3744, and the regenerated file says so. build:docker ran in a separate detached checkout of this commit outside the nested node_modules install. Regenerating there changed the three files above and nothing else, giving core 2463, channel 3744, plugin 4349 as predicted, a channel hash neither side had, and upstream's core and plugin lines. The three generated-file checks pass there. The lockfile moved, so dependencies were reinstalled. Feishu: 105 files and 2168 tests in the extension project, 16 files and 348 tests in the database-workers project. The forwarder test and the routing guards pass, 2011 tests, fewer than before because upstream removed tests from test-projects.test.ts (openclaw#158663). tsgo:core, tsgo:extensions, tsgo:extensions:test, tsgo:test:root, and the line-cap, max-lines and assertion-safety ratchets against upstream/main pass, and oxlint and oxfmt pass on the changed code files.
…aw#158663) * test(ci): deslop s000 tests * test(chat): deslop s002 tests * test(agents): deslop s006 tests * test(telegram): deslop s015 tests * test(gateway): deslop s005 tests * test(cli): deslop s008 tests * test(gateway): deslop s001 tests * test(auto-reply): deslop s007 tests * test(scripts): deslop s004 tests * test(plugins): deslop s009 tests * test: preserve routing coverage during cleanup replay * test: preserve current fixture contracts in cleanup replay * test: retain independent security and recovery coverage
What Problem This Solves
Batch d008 removes duplicate test scenarios, implementation-mirroring probes, and repeated fixture setup that add maintenance and CI cost without independent behavior coverage.
User Impact
No production behavior changes. This replay changes 62 test files: +5,112/-19,110 lines (net -13,998), with 349 fewer test declarations. Production and external test-support LOC are unchanged.
Why This Change Was Made
Replays all ten campaign commits onto main at
4ed4df0e9b3f, retaining each original commit message. Main's newer tests, fixtures, API changes, lifecycle ownership, and regression assertions take precedence. No whole commit was skipped; obsolete, already-applied, or behavior-uncertain hunks were omitted. Review preserved independently valuable security and recovery cases.The CI/planning and fingerprint reductions follow their extracted owners. Gateway relay cleanup follows its renamed file, and session-creation reductions follow the accounts/stores/dispatch split. Main's existing Telegram cleanup (#155040) already removed most of that shard, leaving three equivalent duplicate cases here. Rewritten updater and plugin fixtures stay with their current owners. New authorization, cancellation, monotonic timing, provider opt-in, and registry ownership coverage remains intact.
Evidence
CI=1 OPENCLAW_TESTBOX=1 node scripts/check-changed.mjs -- <62 changed paths>, through the repository Testbox wrapper. This covers all 24 core test-type shards, extension/root test types, lint, ratchets, three dead-export scans, and selected Mac tooling suites.oxfmt --write --threads=1 <changed files>andgit diff --checkpassed. Existing platform-gated skips remain; the additional E2E run selected its two relevant cases.9210ca53e5a1db5c704a0767d7805508cefe352dcontains verified treead1573b2d7fea7163a282ace1f29cefcc28f746b.tbx_01m3e2c2fn9m07qxmtnw2pmtcf, wrapper exit 0. All three task leases were stopped, includingtbx_01m3dt1694cyejx5arjh9mbqcmandtbx_01m3dwcy4mrmyrgszhda8wq6sc. Lease cleanup may mark the linked workflow cancelled; the command result is the proof outcome.Historical coverage below is the original campaign's in-shard measurement, not current-main or repository-wide coverage. Each measured shard stayed within a 1% loss of covered statements and branches. The s000 measurement excludes package acceptance; s001 excludes chat-b/session creation. Historical retry and incomplete-gate caveats are retained below; fresh replay validation is reported separately above.
None of the changed paths matches
.github/CODEOWNERS.Per-shard replay, historical coverage, and conflict decisions
30298ea8d1bfa65b8bc6a772ff7c543ec1b89295d99b9d1eed0f09285676c19b0af895f5424ac15f38652f31de1b17400c3043f53f88ecac49866a7cs000
Review retains all four existing Linux release-admission predicates. Their unchanged main assertions protect predicate presence; the proposed Boolean-structure strengthening is a pre-existing improvement, not a regression from this patch.
Moved planning/fingerprint hunks follow their current files. Fresh remote proof exposed an independent Docs Agent planning contract: restored its row and source-discovered routing relationship, retaining the existing routing assertion. Retained main's release-waiver versions, hourly iOS matrix, current minimatch consumers, and five-command enforcement assertion.
Files:
test/scripts/ci-workflow-guards.test.ts,test/scripts/ci-workflow-planning.test.ts,test/scripts/package-acceptance-workflow.test.ts,test/scripts/setup-node-env-dependency-fingerprint.test.ts.covered statements 1338 -> 1338 (0); branches 1215 -> 1215 (0); functions 283 -> 283 (0)
Coverage measured ci-workflow-guards.test.ts only; package acceptance was excluded after unchanged title-convergence subprocess timeouts returning null.
Final full shard retained one documented pre-existing failure and two existing skips; stronger owner proof reported 25 passing tests.
s002
Retained main's send/context helpers, moved suites, normalized-message fixtures, account/auth tests, and null-duration assertions. Dropped stale local fixture rewrites; kept independent duplicate removals and matrix reductions. Shortened two parameter labels without changing cases or assertions so the file remains below its existing line-count ratchet.
Files:
ui/src/pages/chat/chat-send.test.ts,ui/src/pages/chat/chat-state.test.ts,ui/src/pages/chat/chat-thread.test.ts,ui/src/pages/chat/chat-view.test.ts.covered statements 17357 -> 17333 (-24); branches 14623 -> 14611 (-12); functions 3071 -> 3068 (-3)
Normalization coverage drops have stronger remaining message-normalizer owner proof; related owner suites reported 122 passing tests.
s006
Retained current MCP transport/cancellation/schema cases, recovery harness, quoted executable pinning, release callbacks, monotonic retry timing, native-control admission, and current tool output contracts. Dropped obsolete pending-media assertions and extracted-fixture copies. Review retained both detached approval-write failure modes and the delivered-overflow no-retry case. Fresh proof restored the namespace import required by main's retained executable-drift cases.
Files:
src/agents/agent-bundle-mcp-runtime.test.ts,src/agents/agent-command.live-model-switch.test.ts,src/agents/bash-tools.exec-host-gateway.test.ts,src/agents/cli-runner.reliability.test.ts,src/agents/embedded-agent-subscribe.handlers.tools.test.ts,src/agents/model-fallback.test.ts,src/agents/tool-search.test.ts.Two initial timing failures passed unchanged on retry and the final full run.
Coverage drops cite stronger remaining CLI output, supervisor capture, run termination, tool display, and result fallback classifier owner suites.
s015
Main already completed most reductions in #155040. Only unchanged duplicate rich-blocks and delayed-webhook-payload cases remain here. Kept rewritten transport/lifecycle suites and main's deleted send/outbound test files absent.
Files:
extensions/telegram/src/rich-blocks.test.ts,extensions/telegram/src/webhook.test.ts.covered statements 10481 -> 10481 (0); branches 8371 -> 8368 (-3); functions 1964 -> 1965 (1)
Initial coverage timeout passed on retry.
An ordering-test deletion was reverted rather than changing an outside-shard max-lines ratchet.
s005
Followed the relay rename. Retained current config-write producers, startup fixtures, channel restart/snapshot behavior, relay cleanup, and new tests. Dropped overlapping stale fixture/API rewrites and retained changed relay scenarios.
Files:
src/gateway/config-reload.test.ts,src/gateway/openai-http.test.ts,src/gateway/server-channels.test.ts,src/gateway/server-cron.test.ts,src/gateway/server-startup-post-attach.test.ts,src/gateway/session-utils.test.ts,src/gateway/talk/relay/index.test.ts.Coverage: statements 12,098 → 12,090 (−8); branches 7,140 → 7,136 (−4); functions 2,161 → 2,156 (−5). Gate passes; no source file lost more than three statements.
Knip timed out in the full changed gate; standalone checks passed across retries. The report records no uninterrupted green full changed-gate run.
s008
Review retains local scanner-failure and npm scanner-blocked cases under the unsafe-install flag.
Retained agent-owner matrices, strict config validation, new cron timeout behavior, official plugin trust/beta fallback coverage, readiness ownership, and asynchronous proxy regressions. Secret-gateway fixture cleanup was already applied; updater contributes only its surviving local duplicate deletion. Fresh proof preserved the strict validation call and removed the resulting unused updater binding and inert install-fixture argument.
Files:
src/cli/capability-cli.test.ts,src/cli/config-cli.test.ts,src/cli/cron-cli.test.ts,src/cli/plugins-cli.install.test.ts,src/cli/plugins-cli.update.test.ts,src/cli/run-main.exit.test.ts,src/cli/skills-cli.commands.test.ts,src/cli/update-cli.test.ts.covered statements 9430 -> 9417 (-13); branches 7550 -> 7533 (-17); functions 1596 -> 1592 (-4)
Changed gate passed after fixing one no-map-spread lint finding.
s001
The final rebase retains main #158581's deletion of the two obsolete lineage-cache cases and leaves its replacement session-lifetime tests intact.
Followed session-creation splits for equivalent account/store/dispatch reductions. Retained main's recovery/transcript APIs and newer event cases; dropped the obsolete monolithic response-type consolidation and changed-main fixture rewrites.
Files:
src/gateway/server-chat.agent-events.test.ts,src/gateway/server-reload-handlers.test.ts,src/gateway/server.chat.gateway-server-chat-b.test.ts,src/gateway/server.sessions.create.accounts.test.ts,src/gateway/server.sessions.create.dispatch.test.ts,src/gateway/server.sessions.create.stores.test.ts.covered statements 5375 -> 5373 (-2); branches 3791 -> 3785 (-6); functions 872 -> 872 (0)
Coverage measured reload/events only; chat-b and session-create were excluded following coverage-run failures.
Full Vitest initially reported 651 passed/4 failed; focused retry reported 177 passed/1 failed, leaving the unchanged baseline direct-model timeout.
Projection drops cite stronger remaining session-event-payload.test.ts proof.
s007
Applied matching complete test transformations and fixture consolidations. Retained 54 changed or retired-main transformations and ambiguous duplicate-title matrices; all unaffected main test declarations remain. Replayed helper calls use main's current
makeStorePathfixture owner.Files:
src/auto-reply/reply/agent-runner-memory.test.ts,src/auto-reply/reply/agent-runner.misc.runreplyagent.test.ts,src/auto-reply/reply/directive-handling.model.test.ts,src/auto-reply/reply/dispatch-acp.test.ts,src/auto-reply/reply/get-reply-run.media-only.test.ts,src/auto-reply/reply/queue.collect.test.ts,src/auto-reply/reply/session.test.ts.covered statements 9308 -> 9307 (-1); branches 8696 -> 8693 (-3); functions 1565 -> 1565 (0)
SQLite-lock and Knip-timeout retries recovered; all 944 tests and final 182-test ACP recheck passed.
s004
Review retains the complete release candidate binding matrix and its target/tooling/profile subprocess mismatch cases.
Retained current source-capsule lease checks, extracted installer contract registrations, newer release provenance/SIGTERM cases, Docker log-removal failure coverage, and current routing/shuffle assertions. Dropped obsolete routing/isolation reductions; kept applicable shared fixture and duplicate-case cleanup.
Files:
test/scripts/check-database-first-legacy-stores.test.ts,test/scripts/crabbox-wrapper.test.ts,test/scripts/docker-build-helper.test.ts,test/scripts/full-release-validation-state.test.ts,test/scripts/install-sh.test.ts,test/scripts/mac-elevation-host.test.ts,test/scripts/test-projects.test.ts.covered statements 3532 -> 3531 (-1); branches 3075 -> 3072 (-3); functions 685 -> 685 (0)
Config-parity test was restored after an initial excessive coverage drop.
Knip passed after a 600-second watchdog retry; three existing skips were unchanged.
s009
Review retains the installed npm integrity-drift rejection/cleanup case.
Retained current startup resolver, provider opt-in/reasoning execution, optionalDependencies/relink matrix, managed npm dependency suite, async database cleanup, registry authority/delegation/no-rescan cases, and newer update recovery. Dropped extracted inline helpers and rewritten install cases.
Files:
src/plugins/channel-plugin-ids.test.ts,src/plugins/clawhub.test.ts,src/plugins/discovery.test.ts,src/plugins/install.npm-spec.test.ts,src/plugins/install.test.ts,src/plugins/manifest-registry.test.ts,src/plugins/official-external-plugin-catalog.test.ts,src/plugins/provider-runtime.test.ts,src/plugins/tools.optional.test.ts,src/plugins/update.test.ts.covered statements 9648 -> 9643 (-5); branches 8638 -> 8624 (-14); functions 1982 -> 1981 (-1)
Changed gate hit the Knip watchdog; all three export scans subsequently passed with zero unused exports.
Rejected review reports
CLAWHUB_SECURITY_UNAVAILABLEand zero download/install calls; the owner uses the same catch for all fetch failures.Declaration counts use syntax inspection; parameterized rows are not expanded. The original reports counted 1,749 fewer executed cases before the current-main replay.