Repository navigation
test(agents,gateway,channels,infra): remove low-value tests (batch d004) - #166566
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, 8:22 AM ET / 12:22 UTC (Revision 2). ClawSweeper reviewWhat this changesThe branch removes redundant agent, Gateway, channel-ingress, and heartbeat tests, moves retained coverage into existing suites, and shrinks associated test inventories. Merge readiness⛔ Blocked before merge - 3 items remain The cleanup remains useful and is not superseded by current main. No blocking defect was identified in the inspected consolidations and restored boundary coverage; this review does not establish exhaustive equivalence for every deleted case. Priority: P3 Review scores
Verification
How this fits togetherThese suites check how OpenClaw admits agent work, handles Gateway requests, queues channel messages, and schedules heartbeat turns. The cleanup changes test coverage and test selection without changing the production implementations. flowchart TD
A[Agent and Gateway scenarios] --> C[Retained owner tests]
B[Channel and heartbeat scenarios] --> C
C --> D[Production boundaries]
E[Test inventories] --> F[CI test selection]
C --> F
F --> G[Validation 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 meaningful lifecycle, isolation, authorization, and regression assertions in their canonical test owners while removing redundant fixtures. Do we have a high-confidence way to reproduce the issue? Not applicable: this PR addresses test redundancy rather than a reported runtime defect; no runtime reproduction was attempted. Is this the best way to solve the issue? Yes for the inspected consolidations: moving retained assertions into existing owner suites avoids competing fixtures, and the six repaired boundary contracts are present. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 1b395594318b. LabelsLabel changes: No label 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)
|
|
Fresh CI on the final rebased head The earlier terminal-font CI for the initially submitted head Both failures were reproduced independently from a clean, detached checkout of main at
Clean-main commands: CI=1 pnpm test test/scripts/ci-workflow-guards.test.ts -t 'keeps private Control UI servers and resource-sensitive files under one serial owner'
CI=1 OPENCLAW_CI_STATIC_EVIDENCE=1 node scripts/run-tsgo-core-test-shards.mjs --stripe 2/5 --concurrency 2The failing tests, UI implementation, UI type configuration, and private-server ownership config are outside this batch's diff. No timeout, retry, assertion, or check was weakened. These are separate main repairs under the authorized campaign pre-existing-failure exception. The initial independent review's six accepted coverage findings were repaired; the restoration review is clean through P2. The automated review also reports no actionable finding. Its generic config/storage compatibility checklist is driven by |
2fca29d to
08fd3f2
Compare
…04) (openclaw#166566) * test(agents): deslop w1026 tests * test(agents): deslop w1039 tests * test(gateway): deslop w1043 tests * test(cli-runner): deslop w1040 tests * test(channels): deslop w1042 tests * test(agents): deslop w1045 tests * test(gateway): deslop w1044 tests * test(infra): deslop w1046 tests * test(auth-profiles): deslop w1041 tests * test(agents): deslop w1047 tests * test: retain distinct boundary coverage in batch d004
What Problem This Solves
The agent, Gateway, channel ingress, and heartbeat suites contain redundant variants and split fixtures that add maintenance cost without distinct behavior coverage.
User Impact
Internal test cleanup only; no production behavior, API, configuration, or storage changes. This batch removes duplicate cases and consolidates retained lifecycle, authority, isolation, and regression coverage into existing test owners.
Why This Change Was Made
Replays ten coverage-gated campaign shards onto main at
de38a04548251cbd6cc7e190c1470412c077908b. All ten source commits are applied; none are skipped. Removed-file routing entries and mock-baseline entries shrink with their corresponding test deletions.One modify/delete conflict was resolved by retaining main's entire
src/infra/heartbeat-runner.sender-prefers-delivery-target.test.ts. Commit513871f9ca8(#166362) had strengthened it to assert background reply destinations, so that deletion was dropped. A later rebase preserved the new Androidnotifications-eventdisabled-cadence case from #166522 while retaining the intended deletion of the olderrestart-sentinelduplicate. Six distinct contract assertions identified during review were restored in existing test owners; other shard hunks were retained. No production seam is removed.Actual replay diff: production +0/-0 LOC; tests +3,734/-9,841 LOC (net -6,107); exclusive test support +121/-252 (net -131); test routing/baseline tooling +0/-13. Total +3,855/-10,106 (net -6,251) across 95 files. Current CODEOWNERS has no matching owned path in this diff.
Evidence
Final candidate:
08fd3f2519dad95b508dfa6771cb1211c77dcd2b(ten replay commits plus one focused review-restoration commit).pnpm install --frozen-lockfile --prefer-offline: passed.node_modules/.bin/oxfmt --write <changed files>,git diff --check, and plainnode_modules/.bin/oxlint -c .oxlintrc.json <changed TS/JS files>: passed; oxlint exit 0.tbx_01m4b2ehfhsha7mfwkqj81kpsj.OPENCLAW_TESTBOX=1 node scripts/check-changed.mjs -- <all 95 changed paths>with the remote-child flags. Its preliminary checks passed, and the full core test-type check failed only onui/src/components/terminal/terminal-panel-fonts.test.ts(56,5): TS2353, wheresignalis absent from the connection-controller parameter type. Later changed-gate steps were not reached; this is not a full greencheck:changedclaim.19cc8e6568f28df938905306fee31d1082478d98: the identical terminal-font type error and the missingterminal-fonts.e2e.test.tsprivate-server ownership entry. The failing files and their owners are outside this diff. Exact commands and main proof.The coverage figures below are the completed in-shard before/after measurements, not a new whole-batch coverage claim. Every shard's statement and branch loss is below 1%. The originally stale w1042/w1046 handoffs were reconciled against their later successful recovery runs. Their final full changed-file checks had not completed during shard recovery; batch validation is recorded above. w1046's completed comparison loses six statements in
src/infra/outbound/targets.ts; its aggregate losses remain 0.182% statements and 0.389% branches. Cases protecting the original Telegram topic/plain-chat routing assertions were restored before the final shard coverage run.Several shard reports record unsupported case-level coverage comparisons or transformed-source mismatches and use source-review fallback. Their aggregate coverage comparisons completed. Declaration targets were not forced by removing distinct authority, ordering, or regression cases.
Review follow-through
The initial review raised 16 potential gaps. Six were accepted and repaired: account-scoped heartbeat allowlists, loopback-port-stable resume hashes, fresh WHAM cooldown mapping, heap-profile/snapshot authorization, malformed approval request scopes, and placement claim redaction. The remaining ten were rejected after tracing retained tests to their production owners:
native-mcp-policy.test.tsretains default allow/deny proof; CLI adapter tests retain each projection.auth-profiles/oauth.ts.session-override.selection.test.tsretains actual profile deletion with healthy siblings; missing personal-owner isolation remains insession-override.user-link.test.ts.store-update.test.tsretains real gateway-owner locator proof.bundle-mcp.gemini.test.tsretains actual settings-file exclusion;bundle-mcp.test.tsretains the shared provider-pin decision.src/media/parse.test.tsretains private/loopback rejection andchat.directive-tags.test.tsretains Gateway RFC1918 handling through that parser.server-methods-list.test.tsexplicitly asserts admin scope, sidecar startup gating, registration, and control-plane write classification.sessions-suggestions.visibility.test.tsretains exact Alice/Bob filtering through real request dispatch.!dispatched.okrelease owner.ingress-monitor.test.tsretains lane mismatch/dead-letter proof and the admission suite retains delayed cancellation and null-result rejection.Per-shard replay accounting, coverage totals, and changed files
Declaration counts below cover each replay commit's touched test files, so unchanged shard files are excluded. Test-support declarations are counted separately. LOC deltas are from the actual replay on main.
w1039 additionally removes two declarations and 130 LOC from its exclusive test helper. w1041 removes one unused test-helper re-export (net -1 LOC). w1046 retains main's strengthened destination regression, reducing the deletion by one declaration and 60 original shard lines.
w1026
Files:
config/test-mock-exports-baseline.txt,scripts/lib/ci-proof-test-inventory.mts,src/agents/agent-tool-definition-adapter.after-tool-call.fires-once.test.ts,src/agents/agent-tool-definition-adapter.after-tool-call.test.ts,src/agents/agent-tool-definition-adapter.logging.test.ts,src/agents/agent-tool-definition-adapter.test.ts,src/agents/context.eager-warmup.test.ts,src/agents/context.lookup.test.ts,src/agents/context.test.ts,src/agents/prepared-model-catalog.scoped-thinking.test.ts,src/agents/prepared-model-catalog.test.ts.w1039
Files:
src/agents/embedded-agent-runner/run-entry.failures.test-support.ts,src/agents/embedded-agent-runner/run-entry.test.ts,src/agents/embedded-agent-runner/run-orchestrator.projection.test.ts,src/agents/embedded-agent-runner/run-orchestrator.suspension.test.ts,src/agents/embedded-agent-runner/runs.steering.test.ts,src/agents/embedded-agent-runner/runs.test.ts,src/agents/embedded-agent-runner/tool-result-context-guard.image.test.ts,src/agents/embedded-agent-runner/tool-result-context-guard.prepared-counts.test.ts,src/agents/embedded-agent-runner/tool-result-context-guard.test.ts.w1043
Files:
scripts/lib/ci-proof-test-inventory.mts,src/gateway/server-methods/environments.node-command-authority.test.ts,src/gateway/server-methods/environments.pool.test.ts,src/gateway/server-methods/environments.prepare.test.ts,src/gateway/server-methods/environments.test.ts,src/gateway/server-methods/plugin-approval.scope.test.ts,src/gateway/server-methods/plugin-approval.test.ts,src/gateway/server-methods/session-catalog.home-isolation.test.ts,src/gateway/server-methods/session-catalog.session-share.test.ts,src/gateway/server-methods/session-catalog.test.ts.w1040
Files:
src/agents/cli-runner/bundle-mcp.codex.test.ts,src/agents/cli-runner/bundle-mcp.gemini.test.ts,src/agents/cli-runner/bundle-mcp.resume.test.ts,src/agents/cli-runner/bundle-mcp.test.ts,src/agents/cli-runner/bundle-mcp.user-config.test.ts,src/agents/cli-runner/bundle-mcp.web-search.test.ts,src/agents/cli-runner/execute.pending-cancellation.test.ts,src/agents/cli-runner/execute.supervisor-capture.test.ts.w1042
Files:
src/channels/message/ingress-monitor.admission.test.ts,src/channels/message/ingress-monitor.capacity.test.ts,src/channels/message/ingress-monitor.inspection.test.ts,src/channels/message/ingress-monitor.shutdown.test.ts,src/channels/message/ingress-monitor.test.ts,src/channels/message/ingress-queue.dead-letters.test.ts,src/channels/message/ingress-queue.pruning.test.ts,src/channels/message/ingress-queue.read-only-access.test.ts,src/channels/message/ingress-queue.test.ts,test/vitest/vitest.database-worker-core-paths.mjs.w1045
Files:
config/test-mock-exports-baseline.txt,src/agents/agent-model-discovery.auth.test.ts,src/agents/agent-model-discovery.endpoint.test.ts,src/agents/agent-model-discovery.membership.test.ts,src/agents/bash-tools.exec-runtime.cleanup.test.ts,src/agents/bash-tools.exec-runtime.test.ts,src/agents/models-config.providers.auth-provenance.test.ts,src/agents/sandbox.context.github-identity.test.ts,src/agents/sandbox.resolveSandboxContext.test.ts.w1044
Files:
config/test-mock-exports-baseline.txt,src/gateway/server-methods/chat-reply-media.authority.test.ts,src/gateway/server-methods/chat-reply-media.test.ts,src/gateway/server-methods/chat-reply-media.workspace.test.ts,src/gateway/server-methods/diagnostics.cpu-profile.test.ts,src/gateway/server-methods/diagnostics.heap-profile.test.ts,src/gateway/server-methods/diagnostics.heap-snapshot.test.ts,src/gateway/server-methods/diagnostics.test.ts,src/gateway/server-methods/session-change-event.fallback.test.ts,src/gateway/server-methods/session-change-event.prepared.test.ts,src/gateway/server-methods/session-change-event.test.ts,src/gateway/server-methods/sessions-suggestions.provider-review.test.ts,src/gateway/server-methods/sessions-suggestions.store-binding.test.ts,src/gateway/server-methods/sessions-suggestions.test.ts,src/gateway/server-methods/sessions-suggestions.visibility.test.ts.w1046
Files:
src/infra/heartbeat-runner.ack-token-heartbeat-acks.test.ts,src/infra/heartbeat-runner.broadcast-outcomes.test.ts,src/infra/heartbeat-runner.event-ownership.test.ts,src/infra/heartbeat-runner.exact-session-busy.test.ts,src/infra/heartbeat-runner.identity.test.ts,src/infra/heartbeat-runner.isolated-key-stability.test.ts,src/infra/heartbeat-runner.model-override.test.ts,src/infra/heartbeat-runner.response-prefix-template.test.ts,src/infra/heartbeat-runner.returns-default-unset.test.ts,src/infra/heartbeat-runner.scheduler.test.ts,src/infra/heartbeat-runner.session-created.test.ts,src/infra/heartbeat-runner.session-state.test.ts,src/infra/heartbeat-runner.settings.test.ts.w1041
Files:
src/agents/auth-profiles/session-override.agent-scope.test.ts,src/agents/auth-profiles/session-override.rotation.test.ts,src/agents/auth-profiles/session-override.selection.test.ts,src/agents/auth-profiles/session-override.test-support.ts,src/agents/auth-profiles/session-override.test.ts,src/agents/auth-profiles/session-override.user-pin.test.ts,src/agents/auth-profiles/usage.inherited-owner.test.ts,src/agents/auth-profiles/usage.test.ts.w1047
Files:
src/agents/prepared-model-runtime.cancelled-admission.test.ts,src/agents/prepared-model-runtime.reload-auth-adoption.test.ts,src/agents/prepared-model-runtime.reload-auth.test.ts,src/agents/prepared-model-runtime.remote-publication.test.ts,src/agents/prepared-model-runtime.sources.test.ts,test/vitest/vitest.database-worker-core-paths.mjs.