Skip to content

test(core): remove low-value tests (batch d171) - #174237

Merged
steipete merged 34 commits into
mainfrom
tcr/land-d171-1792155596
Oct 16, 2026
Merged

steipete merged 34 commits into
mainfrom
tcr/land-d171-1792155596

Conversation

@steipete

@steipete steipete commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Reduces repetitive test fixtures and duplicate assertion scaffolding in campaign batch d171.

User Impact

No intended production behavior change. Security, authority, recovery, and lifecycle contracts remain covered by the retained tests. This batch changes tests and test support only.

Why This Change Was Made

Consolidates repeated setup, request builders, cleanup, and expectations across voice-call, plugins, update-cli, harness, TUI, daemon, logging, Gateway, and infrastructure tests. The campaign's conservative reductions are not a claim of reaching its 25% target.

Replay base: 163e18fa89e8551718531d2289e78aabb05e6fb3. All 30 requested commits were replayed in order; no whole commits skipped. Conflicting edits to src/plugins/memory-runtime.test.ts in a89d40b008d and 5e5acd680f1 were dropped, preserving current-main lifecycle regressions and the first clean cleanup. All three service-plan edits were dropped to retain current-main runtime/recovery cases. Harness conflicts retained new allowlist regressions and all four unsafe-control cases while applying compatible consolidation. Logging conflicts retained console-capture, CPU/heap profile, and diagnostic tests unchanged; backend-liveness retained only its initial clean cleanup. Infra conflicts retained agent-events.routing and approval-gateway-resolver unchanged, and retained the first clean changes in approval-native-route-coordinator and the first two clean changes in approval-handler-runtime. The orphaned logging profile helper was removed; two references in preserved harness tests were updated to the imported alias. Production files are unchanged. The mock-export baseline also drops four obsolete entries after real-export preservation or explicit isolation annotations. CI required shrinking the timeout-race baseline for approval-handler-runtime.test.ts from 3 references to its single remaining reference.

Evidence

  • pnpm install --frozen-lockfile --prefer-offline: passed.
  • Changed-file node_modules/.bin/oxfmt --write, plain node_modules/.bin/oxlint -c .oxlintrc.json, and git diff --check: passed before publication.
  • Per the maintainer's CI-only directive, no local tests, typecheck, check-changed, coverage, or Crabbox/Testbox ran. Hosted openclaw/ci-gate is the behavioral proof and merge gate.
  • CI identified fixture-name/type errors, mock export/isolation annotations, and the stale timeout baseline. These are repaired without weakening assertions; the new head receives fresh CI. The latest type failure was confined to overly narrow lazy-cron mock inference; its start/listPage mocks now use the existing service contract. Independent full-diff review found three actionable coverage regressions. All were accepted: terminal-outcome, schtasks.install, and schtasks.installed-package tests are restored exactly to the replay base, retaining rollback/lease failures, the Windows managed-environment audit, and per-candidate invalid-state coverage. The correction review's sole additional finding was rejected: querying is read twice in the restored schtasks.install file, and plain oxlint passes. A focused review of the final mock-type correction runs during fresh CI.
  • No changed path matches the current CODEOWNERS entries.
Shard inventory and replay deltas

Counts below compare the replay base to this PR, not the older source-shard reports. Declarations are static it/test declarations (not runtime-expanded cases). Test support is counted separately; source coverage was explicitly not run under CI-only mode in every supplied shard report. No coverage totals exist to quote.

Shard Test LOC before → after Declarations before → after Test support LOC before → after
x7132 1847 → 1644 (-203) 34 → 29 (-5) 359 → 389 (30)
x7133 751 → 640 (-111) 18 → 17 (-1) 0 → 0 (0)
x7134 3908 → 3105 (-803) 125 → 122 (-3) 56 → 68 (12)
x7135 3907 → 3303 (-604) 76 → 69 (-7) 0 → 0 (0)
x7138 3903 → 3060 (-843) 86 → 76 (-10) 0 → 66 (66)
x7139 3903 → 3099 (-804) 95 → 88 (-7) 0 → 0 (0)
x7140 1235 → 1127 (-108) 17 → 17 (0) 1387 → 1318 (-69)
x7141 3903 → 3127 (-776) 77 → 73 (-4) 0 → 0 (0)
x7142 2982 → 2550 (-432) 84 → 78 (-6) 0 → 0 (0)
x7144 3901 → 3162 (-739) 90 → 85 (-5) 0 → 53 (53)

Files by shard:

  • x7132: src/cli/update-cli/update-command-fixtures.test-support.ts, src/cli/update-cli/update-command-service-publication.test.ts, src/cli/update-cli/update-command-service-transition.test-support.ts, src/cli/update-cli/update-command-service-unavailable.test.ts, src/cli/update-cli/update-command-target.n1-prefix.test.ts, src/cli/update-cli/update-command-task-delivery.test.ts, src/cli/update-cli/update-command-terminal-record.test.ts. Coverage: not run (CI-only source report).
  • x7133: src/logging/config.test.ts, src/logging/diagnostic-backend-liveness.test.ts, src/logging/diagnostic-heartbeat-context.test.ts. Coverage: not run (CI-only source report).
  • x7134: src/tui/tui-attachment-failures.test.ts, src/tui/tui-command-handlers.test.ts, src/tui/tui-event-handlers.test.ts, src/tui/tui-handler-test-support.ts, src/tui/tui-submit-test-helpers.ts, src/tui/tui.submit-handler.test.ts. Coverage: not run (CI-only source report).
  • x7135: src/plugins/marketplace.download.test.ts, src/plugins/marketplace.test.ts, src/plugins/memory-audience.test.ts, src/plugins/memory-background-reload.test.ts, src/plugins/memory-embedding-provider-runtime.test.ts, src/plugins/memory-provider-runtime.test.ts, src/plugins/memory-runtime.test.ts. Coverage: not run (CI-only source report).
  • x7138: extensions/voice-call/src/cli.test.ts, extensions/voice-call/src/media-stream.playback-marks.test.ts, extensions/voice-call/src/media-stream.test-support.ts, extensions/voice-call/src/media-stream.test.ts, extensions/voice-call/src/runtime.realtime-routing.test.ts, extensions/voice-call/src/runtime.test.ts, extensions/voice-call/src/tunnel.process.test.ts, extensions/voice-call/src/tunnel.test.ts. Coverage: not run (CI-only source report).
  • x7139: src/agents/harness/policy.test.ts, src/agents/harness/prompt-compaction-hook-helpers.test.ts, src/agents/harness/provider-route-selection.test.ts, src/agents/harness/registry.test.ts, src/agents/harness/runtime-plugin.test.ts, src/agents/harness/structured-input-execution.test.ts, src/agents/harness/structured-input.test.ts, src/agents/harness/tool-authority.runtime.test.ts. Coverage: not run (CI-only source report).
  • x7140: src/daemon/schtasks.installed-diagnostics.test-support.ts, src/daemon/schtasks.installed-package.test-support.ts, src/daemon/schtasks.stop.test.ts, src/daemon/schtasks.test.ts. Coverage: not run (CI-only source report).
  • x7141: src/gateway/server-cron-lazy.test.ts, src/gateway/server-database-engine.postgres.test.ts, src/gateway/server-discovery-runtime.test.ts, src/gateway/server-http.authority-outcomes.test.ts, src/gateway/server-http.hooks-delivery.test.ts, src/gateway/server-http.probe.test.ts, src/gateway/server-http.rejection-transport.test.ts. Coverage: not run (CI-only source report).
  • x7142: src/infra/agent-activity-events.test.ts, src/infra/agent-events.test.ts, src/infra/agent-run-delegated-authority.test.ts, src/infra/approval-handler-bootstrap.test.ts, src/infra/approval-handler-runtime.test.ts, src/infra/approval-native-route-coordinator.test.ts. Coverage: not run (CI-only source report).
  • x7144: src/gateway/conversation-list.admission.test.ts, src/gateway/conversation-route-ownership.worker.test.ts, src/gateway/conversation-send-turn.test-support.ts, src/gateway/conversation-send.test.ts, src/gateway/conversation-turn.test.ts, src/gateway/credentials-secret-inputs.test.ts, src/gateway/credentials.test.ts, src/gateway/cron-creator-authority-grant.test.ts, src/gateway/cron-exit-watchers.test.ts. Coverage: not run (CI-only source report).

Production: +0/−0. Tests: +9160/−14583 (net -5423). Test support: +403/−311 (net 92). Shrink-only baseline: +1/−5.

@clawsweeper

clawsweeper Bot commented Oct 16, 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 16, 2026 13:15
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-16T13:50:59.465380Z 1944582 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@openclaw-barnacle openclaw-barnacle Bot added channel: voice-call Channel integration: voice-call gateway Gateway runtime cli CLI command changes agents Agent runtime and tooling size: XL labels Oct 16, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1340d0f0c2

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@@ -690,12 +530,12 @@ describe("MediaStreamHandler security hardening", () => {

expect(Buffer.concat(receivedAudio).toString()).toBe("early");
expect(onConnectCalls).toBe(1);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Assert the replacement connection spy

When this test reaches the successful early-media path, both remaining references to onConnectCalls throw a ReferenceError because the refactor removed that counter and replaced it with the onConnect mock. Consequently, the voice-call test file fails instead of verifying the behavior; assert the new spy at both locations.

AGENTS.md reference: AGENTS.md:L85-L87

Useful? React with 👍 / 👎.

@steipete
steipete disabled auto-merge October 16, 2026 13:21
Retain the early-media and metadata-scope assertions after fixture renames. Preserve mocked export contracts, declare isolated runtime boundaries, and shrink the timeout baseline to the remaining reference. Correct async cancellation and dynamic loader fixture types.
@steipete
steipete enabled auto-merge (squash) October 16, 2026 13:24
@steipete
steipete disabled auto-merge October 16, 2026 13:37
@clawsweeper

clawsweeper Bot commented Oct 16, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs changes before merge.

What this changes

This PR consolidates repeated test fixtures and assertions across core and voice-call suites and shrinks one timeout baseline.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) Source review supports the cleanup and PostgreSQL conformance passed, but broad validation has not cleared the required gate.
Proof confidence 🦐 gold shrimp (3/6) This maintainer-authored test-only cleanup changes no shipped behavior and does not require ordinary live behavior proof.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Test only · Worth it: Yes · Fix scope: Complete
Reason: The maintainer-directed consolidation reduces repeated maintenance work without introducing a new product contract.

Merge readiness

⛔ Needs changes before merge - 1 item remains

Keep open: this maintainer-directed cleanup provides useful test consolidation, and source inspection found no definite new defect.

Priority: P3
Reviewed head: 2658e25f83f089ef89144e4f69de7967f844bc8d

Before merge

  • Complete next step - Inspect the failed exact-head check diagnostics, repair failures caused by this PR, and establish evidence for any inherited failures.

Findings

None.

Agent review details

How this fits together

The test infrastructure supplies synthetic inputs to core and plugin owners, checks their observable results, and reports failures through CI.

flowchart LR
  A[Synthetic fixtures] --> B[Shared test support]
  B --> C[Core and plugin owners]
  C --> D[Contract assertions]
  D --> E[CI gate]
Loading

Technical review

Best possible solution:

Land the consolidation with distinct regression contracts preserved and required CI checks satisfied.

Do we have a high-confidence way to reproduce the issue?

This is test cleanup rather than a product bug report; no target code or tests were executed during this read-only review.

Is this the best way to solve the issue?

Shared fixtures and parameterized cases are appropriate here; inspected authority, cancellation, transport, and recovery cases retain their distinct assertions.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 88ef99e66fc9.

Provenance checked

  • Harness regression consolidation keeps the original intent (6153557: Earlier cleanup consolidated redundant setup while retaining distinct authority and lifecycle regressions.)
  • Memory-audience publication and revocation keeps the original intent (7492616: Memory operations must survive unrelated activity while rejecting genuinely stale or revoked audiences.)
  • HTTP rejection transport keeps the original intent (d7e280f: Rejected uploads must receive complete responses while later pipelined work remains fenced out.)
  • Windows managed-environment audit keeps the original intent (13f9deb: Launcher environment provenance must allow the audit owner to identify embedded managed values; parser and audit coverage remain separately retained.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

  • Pinned change scope: The verified introduced range changes tests, test support, and a shrink-only baseline; production code, dependencies, and workflows are unchanged. (2658e25f83f0)
  • Earlier review finding repaired: The discussion's earlier missing-counter finding is resolved: both early-media checks now assert the replacement onConnect spy. (extensions/voice-call/src/media-stream.test.ts:532, 2658e25f83f0)
  • Distinct revocation cases retained: The memory-audience table retains metadata publication, parent reset, grant release, and caller abort, including rejection before provider I/O. (src/plugins/memory-audience.test.ts:347, 2658e25f83f0)
  • Removed audit composition has retained contracts: The Windows launcher round-trip still checks inline environment provenance, while service-audit.test.ts separately checks managed-environment exposure. (src/daemon/service-audit.test.ts:281, 88ef99e66fc9)
  • Exact-head CI remains red: The CI gate failed after lint, test-type, and baseline-ratchet failures; PostgreSQL conformance passed. Available annotations do not establish each failure's cause. Log retrieval was blocked by the proxy's Azure storage allowlist, so no failure is attributed to this PR without supporting diagnostics. (2658e25f83f0)
  • Earlier campaign work is distinct: The full body of test(agents): remove low-value tests (batch d171) #164260 describes an earlier cleanup with different edits; its repeated batch identifier does not establish that this PR is redundant.

PR surface

Tests -3311, Other 0. Total -3311 across 68 files. Added test files: 4.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 67 5302 8613 -3311
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 1 1 1 0
Total 68 5303 8614 -3311

Review metrics

Metric Value Why it matters
Production versus test LOC Production +0/−0; tests +9,421/−15,229; test support +400/−293. The pinned diff removes repetitive test scaffolding; the net support growth serves shared fixtures without adding production machinery.

Labels

Label changes:

  • add P3: This is test maintenance with no intended shipped behavior change.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • add status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.

Label justifications:

  • P3: This is test maintenance with no intended shipped behavior change.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.

Rating scale

6/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.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

Reviewed October 16, 2026, 9:43 AM ET / 13:43 UTC.

Restore the terminal-outcome, Windows install audit, and installed candidate-check tests after independent review found lost safety coverage. Preserve mocked call signatures and literal identity fields, forward the complete injection authority contract, and remove four obsolete mock-baseline entries.
@steipete
steipete enabled auto-merge (squash) October 16, 2026 13:47
@steipete
steipete disabled auto-merge October 16, 2026 13:57
@steipete
steipete enabled auto-merge (squash) October 16, 2026 14:06
@steipete
steipete merged commit 79e502f into main Oct 16, 2026
117 checks passed
@steipete
steipete deleted the tcr/land-d171-1792155596 branch October 16, 2026 14:26
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 17, 2026
* test(voice-call): deslop x7138 tests

* test(voice-call): deslop x7138 tests

* test(plugins): deslop x7135 tests

* test(plugins): deslop x7135 tests

* test(plugins): deslop x7135 tests

* test(update-cli): deslop x7132 tests

* test(update-cli): deslop x7132 tests

* test(update-cli): deslop x7132 tests

* test(harness): deslop x7139 tests

* test(harness): further deslop x7139 tests

* test(harness): preserve independent x7139 expectations

* test(harness): further compact x7139 fixtures

* test(tui): deslop x7134 tests

* test(tui): deslop x7134 tests

* test(tui): deslop x7134 tests

* test(daemon): deslop x7140 tests

* test(daemon): deslop x7140 tests

* test(daemon): deslop x7140 tests

* test(logging): deslop x7133 tests

* test(logging): deslop x7133 tests

* test(logging): deslop x7133 tests

* test(gateway): deslop x7144 tests

* test(gateway): deslop x7144 tests

* test(gateway): deslop x7144 tests

* test(gateway): deslop x7141 tests

* test(gateway): deslop x7141 tests

* test(gateway): deslop x7141 tests

* test(infra): deslop x7142 tests

* test(infra): deslop x7142 tests

* test(infra): deslop x7142 tests

* test: reconcile d171 fixtures with current main

* test: repair d171 fixture references and CI ratchets

Retain the early-media and metadata-scope assertions after fixture renames. Preserve mocked export contracts, declare isolated runtime boundaries, and shrink the timeout baseline to the remaining reference. Correct async cancellation and dynamic loader fixture types.

* test: retain d171 failure boundaries and precise fixture types

Restore the terminal-outcome, Windows install audit, and installed candidate-check tests after independent review found lost safety coverage. Preserve mocked call signatures and literal identity fields, forward the complete injection authority contract, and remove four obsolete mock-baseline entries.

* test(gateway): preserve lazy cron mock contracts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling channel: voice-call Channel integration: voice-call cli CLI command changes gateway Gateway runtime size: XL

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant