Repository navigation
test(gateway, state, plugins): remove low-value tests (batch d009) - #166762
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 7, 2026, 6:33 PM ET / 22:33 UTC (Revision 3). ClawSweeper reviewWhat this changesThe branch consolidates tests and fixtures across Gateway, state, execution, and plugins, removes redundant variants, and updates CI test inventories. Merge readiness⛔ Blocked before merge - 4 items remain The consolidation remains useful, but the previously reported loss of two independent namespace compatibility checks is unresolved at the final head. The CI prerequisite correction addresses a separate problem. Priority: P2 Review scores
Verification
How this fits togetherThese suites check OpenClaw’s runtime, storage, and transport contracts. CI inventories select the surviving tests to detect regressions before release. flowchart LR
A[Runtime contracts] --> B[Test fixtures]
B --> C[Contract tests]
D[Changed paths] --> E[CI test selection]
E --> C
C --> F[Regression results]
Before merge
Findings
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 the consolidation while preserving both namespace compatibility contracts in the retained-store keeper suite. Do we have a high-confidence way to reproduce the issue? Yes: the pinned before/after source comparison establishes the removal of both independent checks, and the final commit leaves that suite unchanged. No runtime failure was reproduced or test executed. Is this the best way to solve the issue? No: consolidation is appropriate, but the short-name keeper cases cannot detect overbroad reservation of retained.* or incorrectly limiting the prefixed physical namespace. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 9a4adfaea037. LabelsLabel changes: No label changes. Label justifications:
EvidenceAcceptance criteria:
What 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 (2 earlier review cycles) |
…penclaw#166762) * test(diagnostics-otel): deslop w1091 tests * test(talk): deslop w1089 tests * test(codex): deslop w1088 tests * test(process): deslop w1097 tests * test(state): deslop w1090 tests * test(gateway): deslop w1093 tests * test(scripts): deslop w1096 tests * test(whatsapp): deslop w1092 tests * test(agents): deslop w1094 tests * test(gateway-client): deslop w1098 tests * test: retain distinct contract coverage in d009 * test(plugin-state): carry runtime prerequisite to consolidated suite * test(plugin-state): preserve retained namespace compatibility
What Problem This Solves
Redundant test variants and fragmented fixtures increase maintenance across diagnostics, Talk, the Codex plugin, process supervision, state, Gateway HTTP, plugin stores, WhatsApp, agent execution, and the Gateway client.
User Impact
No user-visible behavior change. Production code is unchanged. The surviving suites retain authority, lifecycle, ordering, protocol, storage, and known-regression coverage while duplicate cases are removed and related fixtures consolidated.
Why This Change Was Made
Replay all ten validated campaign commits in batch d009 onto current main. No commits were skipped. The replay changes 95 test files (+6,207/-11,347; net -5,140 lines) and seven test inventories/build prerequisites/baselines (+2/-23; net -21 lines). Application production LOC: +0/-0; the build-prerequisite correction itself is +1/-1 in development tooling. Baseline edits are shrink-only.
Two conflicts were resolved against current main:
agent-consult-runtime.storage.test.ts; retain main's removal of the obsoletelegacyLineageabsence assertion rather than reintroducing it at the destination.The
test(scripts)commit for w1096 covers plugin state/blob-store tests and their CI inventories. No changed path matches the current CODEOWNERS rules.Independent review identified seven unique boundaries that the replay now retains: workspace-transfer credential/namespace protection, disabled-signal OTLP environment handling, ambiguous WhatsApp sends, older Gateway capability negotiation, successful-close agent re-admission, absent-path creation custody, and permission-denied state lookup. Five additional findings were rejected against retained owner tests: universal proxy rejection, shared MCP admission closure, transport-independent security-log normalization plus stdout serialization, detached-process abort/deadline ownership, and persisted same/cross-agent sandbox inheritance.
Hosted CI initially found four failures in
test/scripts/ci-test-timings.test.ts: a runtime-placement fixture expected the unmeasured reader to contribute cost, but its deleted authority-suite path no longer selected a runtime consumer. The canonical build-prerequisite inventory had the same stale path. Both now point toplugin-state-store.runtime.test.ts, where the authority cases moved. Timing assertions, thresholds, concurrency and capacity policy are unchanged. A search for all other deleted test paths found no remaining references underscripts/ortest/.Public review also identified two independent retained-store compatibility checks. Both are restored in the keeper suite: historical
retained.*logical namespaces remain bounded and separate from internal@retained.*storage, and a full 128-byte logical namespace persists across retained-store reopening while 129 bytes is rejected. Storage semantics, schema and configuration are unchanged.Evidence
Final head:
ac0e78834e96cdaffa87604613a00589c9a2e281. Runtime-prerequisite correction head:98a47f58331a55c55264b30784202bafac041109. Full-batch validation head before the two-path CI correction:fe7d6947b2f323f0ddc206c77465f04846ed21d2, replay base:a6c143f73176d1b1b381dcef7334c139fb7a5816.Local
oxfmt --write, plainoxlint -c .oxlintrc.jsonon every surviving changed TS/JS path, andgit diff --check: passed; plain lint exited 0 again immediately before publication.Blacksmith Testbox:
CI=1 pnpm install --frozen-lockfile --prefer-offline && CI=1 pnpm test <all 67 surviving changed test files>passed all 14 selected Vitest shards in 666.84s, including required E2E runtime build and existing platform skips. Source/tree verified by the wrapper. Leasetbx_01m4c25gdvbygtk2nbkjtadm7b; run.OPENCLAW_TESTBOX=1 node scripts/check-changed.mjs -- <all 100 changed paths>: passed (exit 0), including core/extension/script types, structural guards, dead-export scans and full selected type-aware lint. Leasetbx_01m4c30c4rnqfyceayrghg2xb9; run. Three nonfatal max-lines warnings concern untouched files:src/agents/worktrees/service-preparation.ts,src/agents/tools/message-tool-execution.ts, andui/src/components/session-organizer-operations.runtime.ts.Independent full-diff autoreview: seven findings accepted and restored, five rejected against retained owner coverage as detailed above. Fresh correction review: scoped-clean through P2, no accepted/actionable finding remains.
All task-owned leases stopped. The original queued lease was stopped before applying review corrections; both final-head validation runs completed successfully. The wrapper's successful exit/timing records are authoritative for delegated Testbox proof; backing Actions runs may show cancellation when a completed lease is stopped.
Runtime-prerequisite correction proof on Blacksmith Testbox:
pnpm test test/scripts/ci-test-timings.test.ts test/scripts/ci-node-test-plan.test.ts test/scripts/test-projects-build-admission.test.ts src/plugin-state/plugin-state-store.runtime.test.tspassed all 504 tests across three Vitest shards (158.86s), including the four formerly failing timing variants and runtime preparation for the relocated suite. The changed-file gate onscripts/lib/vitest-build-prerequisites.mtsandtest/scripts/ci-test-timings.test.tsalso passed: script/root-test types, dead-export scans, targeted type-aware lint, formatting and structural guards. Run, stopped leasetbx_01m4c6c9qh0q4b1j2m71fdzdqh, combined exit 0.The two-path correction received a fresh scoped-clean autoreview through P2. Prior full-batch proofs remain valid for unchanged files.
Final-head retained-store proof:
pnpm test src/plugin-state/plugin-state-store.retained.test.ts --maxWorkers=1passed all 10 tests (Vitest 9.60s; wrapper wall time 26.47s). Its targetedcheck-changedgate passed the state/logging test graph, structural guards, dead-export scans and type-aware lint. Fresh autoreview is scoped-clean through P2. Run, stopped leasetbx_01m4c7jk4vtr9jbcdt2chq5r86, combined exit 0.Hosted CI on the runtime-prerequisite correction head completed green before this final test-only restoration; final-head hosted CI remains the merge gate.
No local validation gap remains.
The following totals are the original in-shard coverage measurements, not a new coverage measurement against today's main. Each shard passed the campaign's <=1% covered-statement/branch loss gate. Meaningful authority, lifecycle, regression, and coverage keepers were retained even when that prevented the original 30% declaration reduction target. No cases were folded merely to reduce declaration counts.
Original w1088 and w1094 full changed-check reruns were incomplete due to Testbox infrastructure; their focused tests and coverage passed. w1093 used the permitted source-audit fallback for per-case uniqueness because the per-case tool did not support its nested projects; aggregate coverage and its gates passed.
Files touched per shard
w1091
extensions/diagnostics-otel/src/service.agent-attribution.test.tsextensions/diagnostics-otel/src/service.commentary.test.tsextensions/diagnostics-otel/src/service.event-loop.test.tsextensions/diagnostics-otel/src/service.gateway-rpc.test.tsextensions/diagnostics-otel/src/service.otlp-export.test.tsextensions/diagnostics-otel/src/service.plugin-usage-attribution.test.tsextensions/diagnostics-otel/src/service.restart.test.tsextensions/diagnostics-otel/src/service.test.tsw1089
scripts/lib/ci-proof-test-inventory.mtssrc/talk/agent-consult-runtime.lineage.test.tssrc/talk/agent-consult-runtime.storage.test.tssrc/talk/agent-consult-runtime.test.tssrc/talk/client-voice-session.digest-retry.test.tssrc/talk/client-voice-session.recovery.test.tssrc/talk/client-voice-session.startup.test.tssrc/talk/client-voice-session.test.tssrc/talk/session-runtime.close.test.tssrc/talk/session-runtime.native.test.tssrc/talk/session-runtime.test.tstest/vitest/vitest.database-worker-core-paths.mjsw1088
config/max-lines-baseline.txtextensions/codex/doctor-contract-api.network-proxy.test.tsextensions/codex/doctor-contract-api.test.tsextensions/codex/harness.cyber-failover.test.tsextensions/codex/harness.session-runtime-ownership.test.tsextensions/codex/harness.test.tsw1097
config/test-mock-exports-baseline.txtsrc/process/supervisor/service-child-relay-host.awaited-output.test.tssrc/process/supervisor/service-child-relay-host.integration.test.tssrc/process/supervisor/service-child-relay-host.test.tssrc/process/supervisor/supervisor.anchored-shell.real.test.tssrc/process/supervisor/supervisor.no-detach.real.test.tssrc/process/supervisor/supervisor.readiness.test.tssrc/process/supervisor/supervisor.rejection.test.tssrc/process/supervisor/supervisor.test.tsw1090
src/state/openclaw-agent-execution.close-wedge.test.tssrc/state/openclaw-agent-execution.creation-witness.test.tssrc/state/openclaw-agent-execution.registration.test.tssrc/state/openclaw-state-db-readonly.error-mapping.test.tssrc/state/openclaw-state-db-readonly.exclusion.test.tssrc/state/openclaw-state-db-readonly.reader-cleanup.test.tssrc/state/openclaw-state-db-readonly.retained.test.tssrc/state/openclaw-state-db-readonly.snapshot-admission.test.tssrc/state/openclaw-state-db-readonly.source-identity.test.tssrc/state/openclaw-state-db-readonly.test.tssrc/state/openclaw-state-db-readonly.warm-source.test.tssrc/state/openclaw-state-db-readonly.worker-lifecycle.test.tsw1093
src/gateway/server-http.canvas.test.tssrc/gateway/server-http.control-ui-lazy.test.tssrc/gateway/server-http.control-ui.test.tssrc/gateway/server-http.device-pairing-ingress.test.tssrc/gateway/server-http.hooks-delivery.test.tssrc/gateway/server-http.hooks-request-timeout.test.tssrc/gateway/server-http.mcp-app-admission.test.tssrc/gateway/server-http.mcp-oauth-callback.test.tssrc/gateway/server-http.node-workspace-transfer.test.tssrc/gateway/server-http.openai-compat.test.tssrc/gateway/server-http.probe.clock-rollback.test.tssrc/gateway/server-http.probe.test.tsw1096
scripts/lib/ci-policy-test-watch.mtsscripts/lib/ci-proof-test-inventory.mtssrc/plugin-state/plugin-blob-store.admission.test.tssrc/plugin-state/plugin-blob-store.readonly.test.tssrc/plugin-state/plugin-blob-store.test.tssrc/plugin-state/plugin-state-store.authority.test.tssrc/plugin-state/plugin-state-store.errors.test.tssrc/plugin-state/plugin-state-store.expiry.test.tssrc/plugin-state/plugin-state-store.import.test.tssrc/plugin-state/plugin-state-store.namespace-independence.test.tssrc/plugin-state/plugin-state-store.prepared.test.tssrc/plugin-state/plugin-state-store.retained.test.tssrc/plugin-state/plugin-state-store.runtime.test.tssrc/plugin-state/plugin-state-store.test.tstest/vitest/vitest.database-worker-core-paths.mjsw1092
extensions/whatsapp/src/auto-reply.broadcast-groups.combined.test.tsextensions/whatsapp/src/auto-reply.web-auto-reply.connection-and-logging.e2e.test.tsextensions/whatsapp/src/auto-reply.web-auto-reply.error-delivery.test.tsextensions/whatsapp/src/auto-reply.web-auto-reply.media-delivery.test.tsextensions/whatsapp/src/auto-reply.web-auto-reply.routing.test.tsextensions/whatsapp/src/send.delivery-recovery.test.tsextensions/whatsapp/src/send.test.tsextensions/whatsapp/src/send.voice-delivery.test.tsscripts/lib/ci-proof-test-inventory.mtstest/vitest/vitest.extension-database-workers-paths.mjsw1094
config/test-mock-exports-baseline.txtsrc/agents/bash-tools.exec-background-followup.test.tssrc/agents/bash-tools.exec-foreground-failures.test.tssrc/agents/bash-tools.exec-github-credential.test.tssrc/agents/bash-tools.exec-liveness.test.tssrc/agents/bash-tools.exec-target.test.tssrc/agents/bash-tools.exec-timeout-seconds.test.tssrc/agents/bash-tools.exec.approval-id.test.tssrc/agents/bash-tools.exec.background-abort.test.tsw1098
packages/gateway-client/src/client.cloudflare-access.test.tspackages/gateway-client/src/client.device-auth.test.tspackages/gateway-client/src/client.handshake.test.tspackages/gateway-client/src/client.request-timeout.test.tspackages/gateway-client/src/client.tls.test.tspackages/gateway-client/src/client.watchdog.test.tspackages/gateway-client/src/protocol-client.events.test.tspackages/gateway-client/src/protocol-client.handshake.test.tspackages/gateway-client/src/protocol-client.request.test.tspackages/gateway-client/src/protocol-client.sequence.test.tspackages/gateway-client/src/protocol-client.socket-factory.test.ts