Repository navigation
test(core,plugins): remove low-value tests (batch d108) - #161689
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 30, 2026, 4:14 AM ET / 08:14 UTC (Revision 5). ClawSweeper reviewWhat this changesThe branch consolidates and removes tests for Teams, Anthropic streaming, agent replies, Gateway usage and recovery, plugin discovery, and skill installation without changing production code. Merge readiness⛔ Blocked before merge - 3 items remain Keep this PR open. Its test cleanup remains distinct from current main, and the resolved merge preserves the Doctor and session-setting cases raised in earlier reviews. I found no definite patch defect. Priority: P3 Review scores
Verification
How this fits togetherThese suites feed fixture and loopback HTTP inputs through OpenClaw's plugins, transport, agent-reply, and Gateway code. Their assertions provide CI regression signals for those product paths. flowchart LR
A[Test inputs] --> B[Plugins and transport]
A --> C[Agent replies and Gateway]
B --> D[Observed results]
C --> D
D --> E[Test assertions]
E --> F[CI regression signal]
Before merge
Agent review detailsSecurityNone. PR surfaceTests -13976. Total -13976 across 22 files. View PR surface stats
Review metricsNone. Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep the condensed suites where they protect distinct routing, recovery, privacy, and transport contracts, with their measured execution cost recorded. Do we have a high-confidence way to reproduce the issue? Not applicable: this PR does not report a user-facing defect. The introduced test changes and retained assertions were inspected; this read-only review did not execute tests. Is this the best way to solve the issue? Yes: consolidating repeated fixtures in owner-level suites is a maintainable path, and the sampled deleted boundary cases retain equivalent or stronger coverage. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 22dda5a60d26. LabelsLabel changes: No label changes. Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (4 earlier review cycles)
|
d9a485b to
a8a45c0
Compare
ecd970d to
0c7470f
Compare
) * test(skills): deslop t0289 tests * test(auto-reply): deslop t0276 tests * test(ai): deslop t0287 tests * test(msteams): deslop t0286 tests * test(gateway): deslop t0283 tests * test(commands): deslop t0317 tests * test(auto-reply): deslop t0314 tests * test(gateway): deslop t0270 tests * test(plugins): deslop t0288 tests * test: retain distinct security and lifecycle coverage * test: repair reduced fixtures and retain Doctor contracts * test: preserve remaining behavior contracts in cleanup
What Problem This Solves
Repeated test scenarios and fixture setup add maintenance and execution cost across skills, ACP dispatch, Anthropic transport, Teams, Gateway, Doctor, memory, and plugin discovery.
User Impact
No user-visible behavior changes. This maintainer-requested campaign batch changes tests only: 22 files, including four deleted split suites. Production LOC: +0 / -0. Test files: +5,548 / -19,522; 32,863 → 18,889 (net -13,974); test support: +0 / -2. Total net -13,976. Static test declarations: 756 → 412 (net -344).
Why This Change Was Made
Replay ten coverage-gated campaign commits onto main, removing duplicate variants and consolidating repeated fixtures while retaining the owner-boundary, security, lifecycle, privacy, and regression cases. Coverage repairs restored distinct routed-delivery, signed-thinking, provider-prefix, restart retry, successful usage refresh, and plugin-policy cases before these commits were accepted.
Eight supplied cleanup shards remain in the final diff. The t0281 session-patch cleanup was skipped on the final rebase to preserve main’s new Ultrafast coverage, including its follow-up fixture-fix hunks. The t0317 Doctor cleanup is withdrawn entirely after review, preserving main’s complete missing-table refusal, successful quarantined-index recovery, and schema preflight suite. Rebase resolutions against final pinned main
6e6916dcfef85bdb194837d113a3c0ee09f3b0aa: retained the current session-patch suite and dropped the entire cleanup hunk foragent-runner-memory.preflight-stale-tokens.test.ts, preserving main’s current roster/default-agent and routed-account cases byte-for-byte. The other two t0314 files remain reduced. Review retained distinct contracts covering: plugin-level Teams approval authorization; explicit Anthropic proxy/TLS policy and ordinary truncated streams; direct ACP prompt redaction; fresh reasoning-media filtering and media custody during dual storage outages; registered-database preflight; trust-service outages; and authored privileged-plugin allowlists. These intentional restorations narrow the original deletions. A further owner-aware retention audit preserves partial-delivery caption suppression and committed-side-effect replay refusal; non-default-agent usage cache isolation; ACP runtime stale-binding recovery and history-image count bounds; small-growth memory-latch and deferred-background refusal; transport endpoint precedence, fallback exclusions, and output budgets; and China schema acceptance without serviceUrl. No baseline, production, dependency, or CODEOWNERS-owned paths changed. CI repairs make the HTTP fixture own rejected requests, contextually type fixture tables, complete required verification metadata, and remove the unused search re-export from test support. During checkout, a concurrent update of the shared main ref left an older index tree; this was reconciled to pinned basea79c90c6e50fe94ca9c9464ed49b33e985c90e75before replay. No unrelated changes are included. Formatting, plain lint, and diff checks passed again after the rebase; hosted CI evaluates the new exact head.Evidence
pnpm install --frozen-lockfile --prefer-offline: passed.node_modules/.bin/oxfmt --write <changed tests>and plainoxlint -c .oxlintrc.json <changed tests>(17 test files and one support file in the final diff): passed;git diff --checkpassed.tbx_01m3rbmz6kdt3sm85hvwy3yw50(run) expired after its 30-minute idle lifetime while source preparation was still running. No test command executed; the lease is stopped. A combined retry ofCI=1 pnpm test <20 files>followed byOPENCLAW_TESTBOX=1 node scripts/check-changed.mjs -- <24 paths>was cancelled after a further 30 minutes in source preparation and produced no test/check result. Leasetbx_01m3rg25rdfafcn962w23kfczhwas allocated while shutdown was settling and was explicitly stopped. Heavy tests were not moved onto the overloaded local host. These are unrun checks, not passing results.openclaw/ci-gate, under the campaign's explicit Testbox infrastructure-gap rule.Review disposition: nine accepted findings restored. Two rejected with source evidence: the removed memory fixture only asserted
initialTurnTaintedand its optional event callbacks were never provided by the production caller; the retained test preserves that assertion while owner tests cover sticky taint and durable provenance. The removed skills.sh mutable-ref variant duplicates the retained mutable-GitHub-ref test:clawhub-install-core.tsinvokesassertInstallResolutionAllowedunconditionally before branching onrequestedReference, so both routes share the same pinned-commit guard. Repair review returned one additional finding, rejected after tracing the owner:openclaw-agent-schema-inspection.ts:73returns immediately for a newer schema;openclaw-database-preflight.ts:578only performs ownership admission for supported/older schemas; andopenclaw-database-preflight.messages.ts:27suppliesfor agent opsfrom the incompatible-schema record. A metadata ownership mismatch cannot satisfy this assertion. No accepted findings remain.The original shard summaries predate recovery. The later successful Testbox completions match every changed file and deletion in the supplied commits. The LOC/declaration columns describe the final candidate including review restorations. The coverage columns are in-shard campaign measurements before those additive restorations, not a fresh aggregate coverage measurement on the rebased tree. Every final shard reported
failed=0; covered statement/branch losses remain below 1% (maximum 0.8621% / 0.9662%).LOC includes comments and blanks; declarations are outermost
it/testcalls, with each parameterized table counted once rather than expanding runtime cases. Doctor and session-patch are withdrawn from the final diff; their historical campaign coverage is retained here for provenance. Test LOC excludes the two removed support-file lines. Per-shard totals overlap production files and must not be summed into an aggregate coverage claim.Files by shard and final campaign coverage totals
src/skills/lifecycle/clawhub.test.ts, plus removal of an unused re-export/import insrc/skills/lifecycle/clawhub.test-support.ts.src/auto-reply/reply/dispatch-acp.owner.test.ts,src/auto-reply/reply/dispatch-acp.test.ts.packages/ai/src/transports/anthropic-transport-stream.test.ts; deletedpackages/ai/src/transports/anthropic-transport-stream.terminal-repair.integration.test.ts.extensions/msteams/src/channel.actions.test.ts,extensions/msteams/src/channel.directory.test.ts,extensions/msteams/src/channel.test.ts; deletedextensions/msteams/src/channel.message-adapter.test.ts,extensions/msteams/src/channel.reaction-current-message.test.ts.src/gateway/server-restart-sentinel.media-binding.test.ts,src/gateway/server-restart-sentinel.test.ts.src/commands/doctor-maintenance.schema-preflight.test.tsis identical to pinned main.src/auto-reply/reply/agent-runner-memory.private-transcript.test.ts,src/auto-reply/reply/agent-runner-memory.test.ts.src/gateway/server-methods/usage.sessions-usage-cache.test.ts,src/gateway/server-methods/usage.sessions-usage-owner-attribution.integration.test.ts,src/gateway/server-methods/usage.sessions-usage.test.ts,src/gateway/server-methods/usage.status-cache.test.ts,src/gateway/server-methods/usage.test.ts; deletedsrc/gateway/server-methods/usage.sessions-usage-owner-attribution.test.ts.src/plugins/channel-plugin-ids.test.ts.src/gateway/sessions-patch.test.tsis identical to final pinned main.Final recovered campaign totals, in the table's shard order:
{"files":1,"configs":1,"failed":0,"stmts":545,"stmtsTotal":8844,"fns":78,"branches":633,"branchesTotal":7294} {"files":2,"configs":1,"failed":0,"stmts":4567,"stmtsTotal":34178,"fns":824,"branches":3378,"branchesTotal":28269} {"files":1,"configs":1,"failed":0,"stmts":2164,"stmtsTotal":11414,"fns":303,"branches":1754,"branchesTotal":11584} {"files":3,"configs":1,"failed":0,"stmts":690,"stmtsTotal":6077,"fns":111,"branches":587,"branchesTotal":5020} {"files":2,"configs":1,"failed":0,"stmts":3632,"stmtsTotal":126501,"fns":622,"branches":2600,"branchesTotal":104344} {"files":2,"configs":1,"failed":0,"stmts":617,"stmtsTotal":46492,"fns":102,"branches":203,"branchesTotal":40133} {"files":3,"configs":2,"failed":0,"stmts":3235,"stmtsTotal":33895,"fns":575,"branches":2550,"branchesTotal":28071} {"files":5,"configs":1,"failed":0,"stmts":1199,"stmtsTotal":126477,"fns":185,"branches":820,"branchesTotal":104328} {"files":1,"configs":1,"failed":0,"stmts":3822,"stmtsTotal":39773,"fns":860,"branches":2835,"branchesTotal":34832} {"files":1,"configs":1,"failed":0,"stmts":616,"stmtsTotal":126501,"fns":35,"branches":413,"branchesTotal":104344}