Repository navigation
test(agents,gateway): remove low-value tests (batch d201) - #164940
Conversation
Consolidate related Gateway client, config reload, and node registry cases into tables while retaining distinct authority, lifecycle, error, and protocol assertions. Move duplicate prepared-auth and signed-mode checks into stronger same-flow cases and remove one absent-field metadata check. Declarations: 228 -> 172 (-24.56%). Executed tests: 319 -> 316 (-0.94%). Test LOC: 9594 -> 8747 (-8.83%). This already-pruned shard remains below the requested reduction targets; further deletion would remove distinct security boundaries, recorded regressions, and source-path coverage. Blacksmith Testbox: 316 tests passed. Final coverage: statements 2414 -> 2415; branches 1615 -> 1616; functions 407 -> 407; no excluded groups or per-file drops. Plain local oxlint, formatting, and whitespace checks pass. No production code or shared test helpers changed. Remote check:changed passed, including gateway-root typecheck, all dead-export scans, boundary/ratchet checks, and lint (zero warnings and zero errors).
|
🦞👀 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 4, 2026, 10:07 AM ET / 14:07 UTC. ClawSweeper reviewWhat this changesConsolidates overlapping agent, Gateway, CLI, service, transport, Workboard, and backup tests into shared fixtures and tables, and removes an unused test-support export. Merge readiness⛔ Blocked before merge - 1 item remains Keep open as useful test maintenance. Inspected consolidations retain distinct failure assertions, and no concrete introduced defect was established; the supplied repository state also identifies the author as a member. Priority: P3 Review scores
Verification
How this fits togetherThese suites exercise OpenClaw’s agent execution, Gateway coordination, and supporting services. They feed controlled requests and failures through those owners and check delivery, authorization, persistence, and cleanup outcomes. flowchart TD
A[Requests and fault fixtures] --> B[Shared test fixtures]
B --> C[Agent execution]
B --> D[Gateway coordination]
B --> E[Storage and services]
C --> F[Behavior assertions]
D --> F
E --> F
Before merge
Agent review detailsSecurityNone. PR surfaceTests -3856. Total -3856 across 28 files. View PR surface stats
Review metricsNone. Technical reviewBest possible solution: Keep regression assertions at their owning boundaries while sharing setup and table cases, without adding production seams for tests. Do we have a high-confidence way to reproduce the issue? Not applicable: this PR consolidates tests rather than reporting a runtime defect; no failing behavior was executed during review. Is this the best way to solve the issue? Yes for the inspected consolidations: shared tables preserve distinct failure outcomes and remove overlapping setup. Static inspection does not establish exhaustive regression equivalence across the entire batch. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 1e49231d063b. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Independent review follow-up: accepted three coverage gaps and restored them in the existing tables: omitted wait progress-privacy metadata, seven forbidden source-reply routing/credential/content arguments, and same-agent/null cron ownership updates. The repair review is clean through P2. The other ten findings were rejected after checking the retained proof and production owners:
Validation of the repaired tree passed: 519 focused tests and the full changed-file gate, exit 0, on Blacksmith Testbox. The original complete batch run passed 2,761 tests with 15 unchanged platform skips. |
…64940) * test(workboard,ai): deslop v0010 tests * test(agents): deslop v0013 tests * test(daemon,gateway): deslop v0017 tests * test(agents): deslop v0012 tests * test(cli,cron): deslop v0016 tests * test(gateway): deslop v0018 tests Consolidate related Gateway client, config reload, and node registry cases into tables while retaining distinct authority, lifecycle, error, and protocol assertions. Move duplicate prepared-auth and signed-mode checks into stronger same-flow cases and remove one absent-field metadata check. Declarations: 228 -> 172 (-24.56%). Executed tests: 319 -> 316 (-0.94%). Test LOC: 9594 -> 8747 (-8.83%). This already-pruned shard remains below the requested reduction targets; further deletion would remove distinct security boundaries, recorded regressions, and source-path coverage. Blacksmith Testbox: 316 tests passed. Final coverage: statements 2414 -> 2415; branches 1615 -> 1616; functions 407 -> 407; no excluded groups or per-file drops. Plain local oxlint, formatting, and whitespace checks pass. No production code or shared test helpers changed. Remote check:changed passed, including gateway-root typecheck, all dead-export scans, boundary/ratchet checks, and lint (zero warnings and zero errors). * test(gateway): deslop v0021 tests * test(gateway): deslop v0019 tests * test(agents): deslop v0015 tests * test(gateway,infra): deslop v0023 tests * test: retain distinct authority and privacy table cases
What Problem This Solves
Repeated test setup and overlapping cases make these suites harder to maintain. This is the explicitly approved d201 batch of the test-reduction campaign.
User Impact
No user-visible or production behavior changes. Retains distinct authority, cancellation, persistence, ordering, rollback, and protocol regressions while consolidating related cases and removing redundant probes.
Why This Change Was Made
Replayed ten validated campaign commits onto main at
1e5bfe69a8b6a74755114c0cbfbf4b41cefef796. Nine replayed without conflicts. In v0015, retained the entire current-mainsrc/auto-reply/reply/directive-handling.model.test.ts: its newer numeric-selection, runtime, persistence-race, and authority cases conflicted with the campaign rewrite. Only the message-tool and media-only edits from that shard are included. No full commits skipped. Review then restored ten table cases covering omitted progress-privacy metadata, restricted source-reply arguments, and immutable cron ownership; no new declarations or production code were added.Production LOC: +0 / -0. Test LOC: +13,734 / -21,597 (net -7,863). Test-support LOC: +0 / -1 (unused re-export). Total: 28 files, net -7,864 lines. No paths match the current CODEOWNERS rules.
Per-shard files, replay deltas, and original coverage evidence
Declaration counts below count source declarations, including table declarations once; they are not executed-case counts. LOC/declarations are measured from this replay. Coverage totals are copied from the original in-shard reports, not a fresh coverage run of this combined PR. Several source shards did not meet aspirational reduction targets; meaningful retained coverage takes precedence.
v0010 — test LOC +1003 / -1229 (net -226); declarations 167 → 138 (-29).
extensions/workboard/src/store.test.ts,packages/ai/src/transports/anthropic-transport-stream.test.tsv0013 — test LOC +2175 / -3599 (net -1424); declarations 227 → 158 (-69).
src/agents/embedded-agent-subscribe.handlers.tools.test.ts,src/agents/harness/native-hook-relay.test.ts,src/agents/subagents/registry/subagent-registry.test.tsv0017 — test LOC +1579 / -2124 (net -545); declarations 236 → 163 (-73).
src/daemon/launchd.test.ts,src/daemon/systemd.test.ts,src/gateway/call.test.tsv0012 — test LOC +1256 / -2275 (net -1019); declarations 222 → 154 (-68).
src/agents/agent-tools.before-tool-call.e2e.test.ts,src/agents/embedded-agent-runner/compact.hooks.owner-test-support.ts,src/agents/embedded-agent-runner/compact.hooks.test.ts,src/agents/embedded-agent-runner/tool-result-truncation.test.tsv0016 — test LOC +1606 / -2032 (net -426); declarations 225 → 157 (-68).
src/cli/capability-cli.test.ts,src/cli/config-cli.test.ts,src/cron/isolated-agent/delivery-dispatch.double-announce.test.tsv0018 — test LOC +1289 / -2136 (net -847); declarations 228 → 172 (-56).
src/gateway/client.test.ts,src/gateway/config-reload.test.ts,src/gateway/node-registry.test.tsv0021 — test LOC +1119 / -2002 (net -883); declarations 229 → 160 (-69).
src/gateway/server-methods/cron.validation.test.ts,src/gateway/server-plugins.test.tsv0019 — test LOC +1129 / -1992 (net -863); declarations 215 → 173 (-42).
src/gateway/server-channels.test.ts,src/gateway/server-chat.agent-events.test.ts,src/gateway/server-close.test.tsv0015 — test LOC +793 / -1186 (net -393); declarations 130 → 104 (-26).
src/agents/tools/message-tool.test.ts,src/auto-reply/reply/get-reply-run.media-only.test.tsThe original v0015 coverage includes the directive file whose cleanup was dropped here.
v0023 — test LOC +1785 / -3022 (net -1237); declarations 220 → 168 (-52).
src/gateway/talk/handlers/index.test.ts,src/gateway/talk/relay/index.test.ts,src/infra/backup-create.test.tsEvidence
Local frozen installation, formatting, diff-check, and plain oxlint passed.
Focused Blacksmith Testbox validation on head 22cc424 passed with 2,761 tests and 15 unchanged platform skips across all 27 touched test files. The repository runner also completed its prerequisite E2E build; the duplicated E2E summary is counted once. Command: CI=1 pnpm install --frozen-lockfile --prefer-offline, then CI=1 pnpm test with every touched test path listed above. Remote command time: 846.734 seconds including source preparation and build. Testbox workflow; lease tbx_01m43j951bs8essww1r7d03ztx stopped.
The initial delegated changed-file lease remained queued without a runner and was stopped when review required a revised tree. A fresh Blacksmith lease then verified repaired tree 5df6fc4df1f4b9ff54cebf0c0026c7e7fe6e4fad: all 519 tests in the three repaired files passed, followed by the complete changed-file gate on all 28 paths (core and extension types, formatting, type-aware lint, all dead-export scans, boundaries, and guards). Command: CI=1 pnpm test , then OPENCLAW_CHECK_CHANGED_REMOTE_CHILD=1 OPENCLAW_CHANGED_LANES_RAW_SYNC=1 CI=1 node scripts/check-changed.mjs -- <all 28 changed paths>, through the Crabbox wrapper on the same lease. Combined remote command: 1,727.965 seconds, exit 0. Testbox workflow; lease tbx_01m43m39m5gsdxsanmtsps06m9 stopped. The initial allocation gap is resolved. A post-command portal-sync warning did not affect the successful command or wrapper exit.
Full independent review reported 13 possible coverage gaps. Three were accepted and repaired in the existing tables; ten were rejected after checking retained assertions, canonical owner suites, and production branch behavior. The incremental repair review is clean through P2. The PR review follow-up records each disposition. The original head passed hosted CI; the final head must pass its own required gate.