Skip to content

test(agents,gateway): remove low-value tests (batch d201) - #164940

Merged
steipete merged 11 commits into
mainfrom
tcr/land-d201-1791121022
Oct 4, 2026
Merged

steipete merged 11 commits into
mainfrom
tcr/land-d201-1791121022

Conversation

@steipete

@steipete steipete commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

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-main src/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.ts

covered statements 4346 -> 4341 (-5); branches 3717 -> 3713 (-4); functions 967 -> 967 (0)

v0013 — 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.ts

covered statements 12152 -> 12137 (-15);
branches 8933 -> 8920 (-13);
functions 2054 -> 2050 (-4)

v0017 — test LOC +1579 / -2124 (net -545); declarations 236 → 163 (-73).

src/daemon/launchd.test.ts, src/daemon/systemd.test.ts, src/gateway/call.test.ts

covered statements 3401 -> 3399 (-2)
branches 2885 -> 2882 (-3)
functions 552 -> 552 (0)

v0012 — 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.ts

covered statements 14489 -> 14472 (-17)
branches 9602 -> 9585 (-17)
functions 2666 -> 2665 (-1)

v0016 — 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.ts

covered statements 4138 -> 4138 (0)
branches 3012 -> 3012 (0)
functions 741 -> 741 (0)
no per-file drops

v0018 — 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.ts

covered statements 2414 -> 2415 (+1)
branches 1615 -> 1616 (+1)
functions 407 -> 407
no per-file drops

v0021 — test LOC +1119 / -2002 (net -883); declarations 229 → 160 (-69).

src/gateway/server-methods/cron.validation.test.ts, src/gateway/server-plugins.test.ts

covered statements 1775 -> 1775 (0); branches 1563 -> 1563 (0); functions 288 -> 288 (0)
no per-file drops

v0019 — 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.ts

covered statements 5440 -> 5440 (0);
branches 4033 -> 4033 (0);
functions 923 -> 923 (0)
no per-file drops

v0015 — 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.ts

covered statements 9699 -> 9669 (-30); branches 7113 -> 7065 (-48); functions 1526 -> 1520 (-6)

The 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.ts

covered statements 9118 -> 9118 (0);
branches 5156 -> 5156 (0);
functions 1670 -> 1670 (0)
no per-file drops

Evidence

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.

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).
@clawsweeper

clawsweeper Bot commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@steipete
steipete enabled auto-merge (squash) October 4, 2026 14:02
@openclaw-barnacle openclaw-barnacle Bot added gateway Gateway runtime cli CLI command changes agents Agent runtime and tooling plugin: workboard size: XL labels Oct 4, 2026
@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Oct 4, 2026
@clawsweeper

clawsweeper Bot commented Oct 4, 2026

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed October 4, 2026, 10:07 AM ET / 14:07 UTC.

ClawSweeper review

What this changes

Consolidates 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
Reviewed head: 22cc42491cd668fc66ad1b645ebe4fecc9bed251

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) Useful test consolidation with retained boundary assertions in the inspected paths and no established blocking defect.
Proof confidence 🌊 off-meta tidepool Not applicable: The supplied repository state identifies a member-authored, test-only cleanup, so contributor runtime proof is exempt; no material production authority or stored-data contract changes trigger additional proof. Reported focused test results are supplemental and were not independently replayed.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The supplied repository state identifies a member-authored, test-only cleanup, so contributor runtime proof is exempt; no material production authority or stored-data contract changes trigger additional proof. Reported focused test results are supplemental and were not independently replayed.
Evidence reviewed 7 items Pinned introduction and scope: The merge-base-to-head delta contains tests and one test-support export removal, with no production, dependency, workflow, configuration, or schema changes. The checkout remained clean and the introduced diff passed whitespace checking.
Retained capability identity assertions: The consolidated message-tool table still checks both forged ambient identity without a capability and trusted capability-bound identity, including the distinct authorization context.
Retained plugin cleanup boundaries: The replacement table preserves rejection of unowned fallback deletion, plugin-owned fallback cleanup, and cleanup through an admin caller; foreign, core, and ambiguously owned additive tools also remain rejected before dispatch.
Findings None None.
Security None None.

How this fits together

These 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
Loading

Before merge

  • Resolve review confidence - ClawSweeper must reach high confidence before merge readiness is known.
Agent review details

Security

None.

PR surface

Tests -3856. Total -3856 across 28 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 28 8025 11881 -3856
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 28 8025 11881 -3856

Review metrics

None.

Technical review

Best 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.

Labels

Label changes:

  • add P3: This is internal test maintenance with no introduced production behavior or user-facing contract change.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The supplied repository state identifies a member-authored, test-only cleanup, so contributor runtime proof is exempt; no material production authority or stored-data contract changes trigger additional proof. Reported focused test results are supplemental and were not independently replayed.

Label justifications:

  • P3: This is internal test maintenance with no introduced production behavior or user-facing contract change.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The supplied repository state identifies a member-authored, test-only cleanup, so contributor runtime proof is exempt; no material production authority or stored-data contract changes trigger additional proof. Reported focused test results are supplemental and were not independently replayed.

Evidence

What I checked:

  • Pinned introduction and scope: The merge-base-to-head delta contains tests and one test-support export removal, with no production, dependency, workflow, configuration, or schema changes. The checkout remained clean and the introduced diff passed whitespace checking. (22cc42491cd6)
  • Retained capability identity assertions: The consolidated message-tool table still checks both forged ambient identity without a capability and trusted capability-bound identity, including the distinct authorization context. (src/agents/tools/message-tool.test.ts:2828, 22cc42491cd6)
  • Retained plugin cleanup boundaries: The replacement table preserves rejection of unowned fallback deletion, plugin-owned fallback cleanup, and cleanup through an admin caller; foreign, core, and ambiguously owned additive tools also remain rejected before dispatch. (src/gateway/server-plugins.test.ts:2245, 22cc42491cd6)
  • Removed helper coverage has an existing owner: The removed compaction helper probes overlap the unchanged conversation-classification suite, which explicitly rejects thinking-only content, heartbeat boilerplate, and tool output following heartbeat-only turns. The production helper remains a direct delegation to that classifier. (src/agents/compaction-real-conversation.test.ts:68, 22cc42491cd6)
  • Validation evidence and limits: The captured PR body reports 2,761 passing focused tests and 15 unchanged platform skips on the pinned head. The linked Testbox workflow itself is canceled and its workflow head differs, so its status does not independently verify that transcript. Tests were not executed during this read-only review; normal exact-head CI remains authoritative. (22cc42491cd6)
  • Current-main area history: Current-main history records Peter Steinberger’s recent agent-runner and Gateway lifecycle refactors, providing routing evidence beyond authorship of this proposed batch. (src/gateway/server-close.ts, 92dc2b187cb7)

Likely related people:

  • Peter Steinberger: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • MertBasar0: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@steipete
steipete disabled auto-merge October 4, 2026 14:08
@steipete

steipete commented Oct 4, 2026

Copy link
Copy Markdown
Contributor Author

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:

  • Stale relay unregister protection remains in the duplicate-module replacement case, followed by a successful successor bridge call.
  • Subagent maintenance protection remains in the canonical maintenance suite for persisted and live active/pending/delivered/kill-reconciliation states.
  • The deleted loop-disable probe stopped before the blocking call and only asserted result shape; it did not provide the above-threshold proof claimed by the finding.
  • Malformed Anthropic SSE classification remains in anthropic-sse-framing.test.ts, including the stable malformed_streaming_fragment error.
  • Final delivery facts, partial/dry-run rejection, and A2A non-redelivery remain in the message execution, message delivery, and sessions-send A2A owner suites.
  • The deleted empty client fixture only restated absence of nodePluginTools; the shared client's real handshake tests validate emitted frames against the closed protocol schema, and node-registry tests cover post-connect publication and revocation.
  • The cron table's trusted flag describes job scheduling policy, not caller authority. Every row explicitly mints a management grant; update retains both policies because it has distinct policy behavior.
  • Empty plugin startup and replacement candidates take the same no-loader path; the retained case asserts unchanged active registry and hooks. Replacement-specific behavior exists only in the nonempty loader branch.
  • The retained plugin quarantine test asserts exact error-diagnostic routing and deduplication through log.error.
  • The archive permission assertion was consolidated, not removed: the AppleDouble archive test still checks the published file has mode 0o600 on non-Windows systems.

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.

@steipete
steipete enabled auto-merge (squash) October 4, 2026 14:44
@steipete
steipete merged commit 86310c8 into main Oct 4, 2026
113 checks passed
@steipete
steipete deleted the tcr/land-d201-1791121022 branch October 4, 2026 14:51
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 5, 2026
…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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling cli CLI command changes gateway Gateway runtime P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. plugin: workboard rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XL status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant