Repository navigation
test(core,plugins): remove low-value tests (batch d053) - #169218
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: needs changes before merge. What this changesThis PR removes redundant test variants and consolidates assertions across core and bundled plugins. Example: Test maintenance
Review scores
ProductKind: Test only · Worth it: Yes Merge readiness⛔ Needs changes before merge - 4 items remain Keep this PR open: the maintainer-directed cleanup is useful, but two independent regression contracts should be retained. Priority: P3 Before merge
Findings
Provenance
Agent review detailsHow this fits togetherThese suites exercise agent, Gateway, worker, security, outbound-delivery, and plugin owners using fixtures and assertions. flowchart LR
A[Test fixtures] --> B[Core owners]
A --> C[Plugin owners]
B --> D[Observed results]
C --> D
D --> E[Contract assertions]
E --> F[CI checks]
Technical reviewBest possible solution: Keep the cleanup while restoring compact tests for Unicode marker variants and Qwen’s distinct Wan credential restrictions. Do we have a high-confidence way to reproduce the issue? No runtime bug is claimed; source and history establish the removed coverage, and no target code was executed during this review. Is this the best way to solve the issue? Consolidation is appropriate, but shared mechanism coverage does not replace independent Unicode mappings or Qwen-specific credential-domain cases. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against b5a9b9b41c34. TestingProof path: in-process harness. SecurityNone. EvidenceAcceptance criteria:
What I checked:
Likely related people:
PR surfacePR surface statistics unavailable: the file list is incomplete. Review metrics
LabelsLabel changes:
Label justifications:
Rating scale6/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. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed October 11, 2026, 12:39 PM ET / 16:39 UTC. |
Integrate origin/main 49d2a93 (185 commits after 6e06137) so the PR is tested against current main. Only two test files conflicted. Main's low-value test cleanup (openclaw#169092, openclaw#169218) removed the base cases next to which this branch had added its fallback-policy cases. Keep main's removals and keep the new cases in place: queue/state.test.ts keeps the four queued fallback consent cases, model-overrides.test.ts keeps the policy-only pending-switch case. No production file conflicted; run-entry.ts, attempt-recovery.ts and the database-worker path list merged cleanly with independent hunks.
) * test(security): deslop x1196 tests * test(agents): deslop x1192 tests * test(sessions): deslop x1194 tests * test(crabbox): deslop x1193 tests * test(worker): deslop x1197 tests * test(memory-wiki): deslop x1199 tests * test(browser): deslop x1200 tests * test(infra): deslop x1203 tests * test(browser): deslop x1206 tests * test(gateway): deslop x1178 tests * test: retain security boundary regressions during cleanup
A native worker killed during streaming could leave already-visible assistant text out of canonical history, and an abort diagnostic guard hid the concrete worker failure behind a generic error. Failed handed-off native turns now save the uncommitted display tail through the existing guarded partial-transcript writer while their exact claim is still current, keep the sanitized promptError alongside the aborted outcome, and ignore an empty synthetic aborted final that would erase streamed text. Backport adaptation: the branch keeps the launcher options type inline in worker-turn-launcher.ts (main later moved it to worker-turn-launcher.types.ts), so persistAbandonedPartial is added to that inline type and the single findPendingWorkerWorkspaceResult call site switches to prepareWorkerTurnFailure. The cosmetic `terminal:` spread rewrite in the launcher is left out. In embedded-agent-live.runtime.test.ts only the new empty-final regression is taken; a neighboring main-only reasoning test pulled in by the conflict hunk is dropped. The branch still carries the stop/aborted-without-cleanup-failure rows of the deferred-terminal table (main removed them in test-only #169218), so their error assertion stays conditional: those rows have no prompt error to retain. Extracted-from: ea3ffb7 Co-authored-by: Peter Steinberger <[email protected]>
What Problem This Solves
Redundant test variants and implementation-mirroring assertions increase test maintenance without independently protecting behavior.
User Impact
No production behavior, dependencies, public APIs, or shared test-support code changes. This is the bounded d053 test-cleanup batch.
Why This Change Was Made
Replay ten already-validated campaign shards onto current main, retaining the remaining security, regression, and lifecycle boundary tests. All ten commits applied; none skipped. No changelog changes (release-owned).
Conflict resolution: only src/gateway/session-transcript-title-reader.test.ts conflicted. Kept main's new worker-read append/rewrite regression and its observeHostDataSql import; removed the source-import-backedge test and its now-unused import as intended. No other manual conflict changes. Automatic merges retained newer main changes.
Production/test split from git diff --numstat e6c4986: production +0/−0; test support +0/−0; tests +868/−14144 (net −13276), 132 files. No current CODEOWNERS rule matches these paths.
Independent review identified nine distinct security/protocol cases worth retaining. Restored wrong-extension-origin rejection, global OAuth throttling across rotated IPs, exact/search path-swap rejection, enrollment command credential secrecy, complete tool-metadata credential rejection, synchronous startup-error redaction, non-ChatML control-token families, Workshop audit discovery-limit independence, and unterminated managed-input size enforcement. All nine findings accepted; no rejected findings. These are original main cases, not new production behavior.
Evidence
Base: e6c4986. Campaign coverage below is historical in-shard evidence from each results report, not a claim of fresh rebased coverage; all statement/branch drops are within 1%. LOC/declaration counts below are freshly recomputed for the touched files against this PR base, so they can differ from whole-shard reports.
Local validation passed: frozen-lockfile installation; oxfmt across all 132 changed files; plain oxlint (exit 0, including unused-disable reporting); git diff --check against the pinned base. Full independent review found nine P2 retention issues, all accepted and repaired; the follow-up restoration review is scoped-clean with no actionable findings.
Remote validation is incomplete at publication: final-head focused tests (CI=1 pnpm test, all 132 changed test files) are queued for a Testbox runner; OPENCLAW_TESTBOX=1 node scripts/check-changed.mjs has started and passed the initial formatting, boundary, and ratchet checks and is running typechecks. Both use the repository Crabbox wrapper. Earlier attempts never executed tests and were stopped before the review restoration. No executed failing validation is being waived, and no rebased test pass or measured runtime is claimed. Hosted openclaw/ci-gate remains the merge gate under the campaign's infrastructure-gap arming rule; final-head remote validation is being followed through while CI runs.
Per-shard counts, coverage, and touched files
x1196
Test LOC: 5845 → 3814 (-2031); declarations: 203 → 111. Historical covered statements 1,742 → 1,741; branches 1,262 → 1,259.
src/security/audit-channel-dm-policy.test.tssrc/security/audit-config-basics.test.tssrc/security/audit-exec-surface.test.tssrc/security/audit-extra.async.test.tssrc/security/audit-gateway-exposure.test.tssrc/security/audit-gateway.test.tssrc/security/audit-hooks-routing.test.tssrc/security/audit-rosterless.test.tssrc/security/audit-workshop-skills.test.tssrc/security/dangerous-config-flags.test.tssrc/security/external-content.test.tssrc/security/fix.test.tssrc/security/install-policy.test.tssrc/security/scan-paths.test.tsx1192
Test LOC: 9887 → 8558 (-1329); declarations: 205 → 159. Historical covered statements 14,601 → 14,601; branches 9,426 → 9,419.
src/agents/embedded-agent-runner/run/abortable.test.tssrc/agents/embedded-agent-runner/run/assistant-failure.failover.test.tssrc/agents/embedded-agent-runner/run/assistant-failure.test.tssrc/agents/embedded-agent-runner/run/attempt-abort.test.tssrc/agents/embedded-agent-runner/run/attempt-bundle-tools.test.tssrc/agents/embedded-agent-runner/run/attempt-client-tools.test.tssrc/agents/embedded-agent-runner/run/attempt-context-guards.test.tssrc/agents/embedded-agent-runner/run/attempt-execution-phase.test.tssrc/agents/embedded-agent-runner/run/attempt-execution-settle.test.tssrc/agents/embedded-agent-runner/run/attempt-normalization.test.tssrc/agents/embedded-agent-runner/run/attempt-phase-lifecycle.test.tssrc/agents/embedded-agent-runner/run/attempt-prompt-context.test.tssrc/agents/embedded-agent-runner/run/attempt-prompt-phase.test.tssrc/agents/embedded-agent-runner/run/attempt-prompt-preflight.test.tssrc/agents/embedded-agent-runner/run/attempt-prompt-tool-policy.test.tssrc/agents/embedded-agent-runner/run/attempt-session-boundary.orphan.test.tsx1194
Test LOC: 3226 → 2515 (-711); declarations: 142 → 97. Historical covered statements 1,380 → 1,379; branches 941 → 940.
src/sessions/agent-harness-session-key.test.tssrc/sessions/conversation-turns.test.tssrc/sessions/input-provenance.test.tssrc/sessions/model-overrides.test.tssrc/sessions/session-id-resolution.test.tssrc/sessions/session-key-case-preservation.test.tssrc/sessions/session-lifecycle-admission.test.tssrc/sessions/stored-model-overrides.test.tssrc/sessions/transcript-events.test.tsx1193
Test LOC: 8660 → 7192 (-1468); declarations: 201 → 160. Historical covered statements 1,769 → 1,769; branches 1,648 → 1,646.
extensions/crabbox/src/crabbox-gateway-methods.test.tsextensions/crabbox/src/crabbox-sandbox-backend.test.tsextensions/crabbox/src/crabbox-tool.test.tsextensions/crabbox/src/crabbox-worker-coordinator-retry.test.tsextensions/crabbox/src/crabbox-worker-node-enrollment-replay.test.tsextensions/crabbox/src/crabbox-worker-node-enrollment.test.tsextensions/crabbox/src/crabbox-worker-prepared-image.test.tsextensions/crabbox/src/crabbox-worker-provider.test.tsextensions/crabbox/src/crabbox-worker-warm-image-allocation.test.tsextensions/crabbox/src/crabbox-worker-warm-image-cli.test.tsextensions/crabbox/src/crabbox-worker-warm-image-lifecycle.test.tsextensions/crabbox/src/crabbox-worker-warm-image-retirement.test.tsextensions/crabbox/src/crabbox-worker-warm-image-store.test.tsextensions/crabbox/src/crabbox-worker-warm-image.test.tsextensions/crabbox/src/doctor.test.tsx1197
Test LOC: 8055 → 7253 (-802); declarations: 183 → 157. Historical covered statements 2,836 → 2,836; branches 1,552 → 1,549.
src/worker/embedded-agent-live.runtime.test.tssrc/worker/github-binding.runtime.test.tssrc/worker/inference-stream.runtime.test.tssrc/worker/native-inference-stream.test.tssrc/worker/native-runtime.test.tssrc/worker/node-workspace-retain-protocol.test.tssrc/worker/transcript-message.test.tssrc/worker/worker-command.runtime.test.tssrc/worker/worker-connection-endpoint.test.tssrc/worker/worker-connection.test.tssrc/worker/worker-process-protocol.test.tssrc/worker/worker-rpc-clients.test.tssrc/worker/worker.runtime.test.tsx1199
Test LOC: 8526 → 6326 (-2200); declarations: 205 → 129. Historical covered statements 2,919 → 2,919; branches 1,969 → 1,968.
extensions/memory-wiki/src/apply.test.tsextensions/memory-wiki/src/bridge.test.tsextensions/memory-wiki/src/claim-health.test.tsextensions/memory-wiki/src/cli.agent-scope.test.tsextensions/memory-wiki/src/cli.test.tsextensions/memory-wiki/src/compile.test.tsextensions/memory-wiki/src/compiled-cache.integration.test.tsextensions/memory-wiki/src/config.test.tsextensions/memory-wiki/src/gateway.test.tsextensions/memory-wiki/src/ingest-human-notes.test.tsextensions/memory-wiki/src/lint.test.tsextensions/memory-wiki/src/markdown.test.tsextensions/memory-wiki/src/obsidian.discovery.test.tsextensions/memory-wiki/src/okf.test.tsextensions/memory-wiki/src/prompt-section.test.tsextensions/memory-wiki/src/query.reads.test.tsx1200
Test LOC: 5158 → 3942 (-1216); declarations: 188 → 131. Historical covered statements 2,457 → 2,457; branches 1,795 → 1,792.
extensions/browser/src/cli/browser-cli-actions-input/register.batch.test.tsextensions/browser/src/cli/browser-cli-actions-input/register.element.test.tsextensions/browser/src/cli/browser-cli-actions-input/register.files-downloads.test.tsextensions/browser/src/cli/browser-cli-actions-input/register.form-wait-eval.test.tsextensions/browser/src/cli/browser-cli-actions-input/shared.test.tsextensions/discord/src/activities/http.test.tsextensions/discord/src/activities/interaction.test.tsextensions/discord/src/activities/presenter.test.tsextensions/discord/src/activities/register.test.tsextensions/qwen/index.test.tsextensions/qwen/stream.test.tsextensions/qwen/video-generation-provider.test.tssrc/commands/doctor/cron/legacy-repair.test.tssrc/commands/doctor/cron/scheduled-tool-policy-migration.test.tssrc/commands/doctor/cron/warnings.test.tsx1203
Test LOC: 5342 → 4087 (-1255); declarations: 159 → 98. Historical covered statements 8,597 → 8,583; branches 5,256 → 5,249.
src/infra/outbound/account-scoped-conversation-bindings.test.tssrc/infra/outbound/channel-bootstrap.runtime.test.tssrc/infra/outbound/channel-resolution.test.tssrc/infra/outbound/channel-selection.test.tssrc/infra/outbound/channel-target-prefix.test.tssrc/infra/outbound/current-conversation-bindings.test.tssrc/infra/outbound/delivery-queue-media-spool.test.tssrc/infra/outbound/delivery-queue-migration.test.tssrc/infra/outbound/delivery-queue-namespaces.test.tssrc/infra/outbound/delivery-queue.reconnect-drain.test.tssrc/infra/outbound/markdown-details.test.tssrc/infra/outbound/message-account-selection.test.tsx1206
Test LOC: 3310 → 2531 (-779); declarations: 149 → 100. Historical covered statements 2,793 → 2,793; branches 1,670 → 1,668.
extensions/browser/src/browser/extension-native-host.test.tsextensions/browser/src/browser/extension-pairing.test.tsextensions/browser/src/browser/extension-setup.test.tsextensions/browser/src/browser/navigation-guard.test.tsextensions/browser/src/browser/paths.test.tsextensions/browser/src/browser/profiles-service.test.tsextensions/browser/src/browser/profiles.test.tsextensions/browser/src/browser/proxy-files.test.tsextensions/browser/src/browser/pw-role-snapshot.test.tsextensions/browser/src/browser/pw-tools-core.download-current-document.test.tsx1178
Test LOC: 7784 → 6299 (-1485); declarations: 185 → 127. Historical covered statements 8,699 → 8,690; branches 6,695 → 6,691.
src/gateway/session-transcript-files.fs.archive-cleanup.test.tssrc/gateway/session-transcript-readers.test.tssrc/gateway/session-transcript-title-reader.test.tssrc/gateway/session-utils-owners.test.tssrc/gateway/session-utils-profile-reference.test.tssrc/gateway/session-utils-store-lookup.test.tssrc/gateway/sessions-resolve-projection.test.tssrc/gateway/sessions-resolve-store.test.tssrc/gateway/sessions-resolve.test.tssrc/gateway/shared-read-responses.test.tssrc/gateway/skill-library-authoring.test.tssrc/gateway/startup-auth.test.ts