Skip to content

test(core,plugins): remove low-value tests (batch d196) - #174993

Merged
steipete merged 34 commits into
mainfrom
tcr/land-d196-1792203000
Oct 17, 2026
Merged

steipete merged 34 commits into
mainfrom
tcr/land-d196-1792203000

Conversation

@steipete

@steipete steipete commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Reduces repeated fixture setup and assertion plumbing across the campaign's test suites.

User Impact

No user-visible behavior change. Current-main regression cases and mock-isolation contracts are preserved.

Why This Change Was Made

Replay batch d196 onto pinned main 9a81e55bab1f36075ad44972bd1fe8e53af372b9 (initial base: c0e26d5c72b949fabe1baf50c828e4793ad703a1). Of 30 supplied commits, 29 were replayed (some partially); the Docker commit was skipped. Five follow-up commits repair source-review/CI findings and drop unsafe or ratchet-incompatible cleanup.

Production LOC: +0 / -0. Final test/support LOC: +9886 / -15650, net -5764, across 63 files. Lines in retained changed files: 32814 → 27050. No production seams, runtime files, config baselines, workflows, dependencies, or CODEOWNERS-owned paths changed.

Evidence

  • pnpm install --frozen-lockfile --prefer-offline: passed, lockfile unchanged.
  • node_modules/.bin/oxfmt --write <changed files>: exit 0 on the initial 85-file replay and the 25-file and 11-file CI repair sets, plus the final single-file snapshot repair.
  • node_modules/.bin/oxlint -c .oxlintrc.json <changed TS files>: exit 0 on both sets.
  • git diff --check: exit 0.
  • CI-only instruction honored: no local Vitest, check-changed, tsgo, coverage, build, Crabbox, or Testbox runs. No leases created. Hosted openclaw/ci-gate remains the merge gate.
  • Source review repaired the retained config-scoping test's explicit gateway response fixture.
  • CI run 38995195084 identified batch issues: explicit undefined SQLite constructor options; widened memory-source fixture type; stale signal-branch comparison; error-capture return consistency; unbound mock method references; stale max-lines directives; cron missing-property versus undefined matching; a floating process-fixture start; and rewritten mock-factory fingerprints. This head fixes those or restores the affected cleanup files to pinned main. Assertions, timeouts, retries, and runtime behavior were not weakened.
  • Separate Critical Quality/OpenGrep/CodeQL failures were GitHub installation API rate-limit errors, not proof of passing code. One diagnosed failed-only retry of Critical Quality and OpenGrep also hit rate limits. No red check was bypassed.
  • All selected hosted checks passed on aaf1057744dded31f6fe28b5051850a13f6541a0. The subsequent one-line assertion restoration requires fresh current-head CI; prior-head results are not claimed as current-head proof.
  • Independent three-pass review completed. Accepted: restored tool: "message" in the messaging target telemetry assertion. Rejected: the maintenance-expiry refusal type assertion was not lost; the shared assertion after both branches still requires StateDatabaseOfflineMaintenanceError. No extra duplicate assertion was added.

Final shard inventory

Measured against pinned main; includes support files. Declaration counts are static it/test/platform-alias source counts, not executed cases. Source reports describe earlier shard passes and are not final replay counts.

Shard Files Test/support LOC Static declarations Coverage evidence
x7378 2 1613 → 1208 (-405) 26 → 25 (-1) Not run: source report used CI-only mode
x7380 7 3746 → 3346 (-400) 69 → 69 (0) Not run: source report used CI-only mode
x7402 7 2768 → 2521 (-247) 15 → 14 (-1) Not run: source report used CI-only mode
x7405 7 2595 → 2046 (-549) 42 → 42 (0) Not run: source report used CI-only mode
x7406 7 3933 → 3100 (-833) 81 → 75 (-6) Not run: source report used CI-only mode
x7407 5 2777 → 2224 (-553) 54 → 52 (-2) Not run: source report used CI-only mode
x7409 3 1599 → 1216 (-383) 40 → 35 (-5) Not run: source report used CI-only mode
x7410 7 3460 → 3005 (-455) 81 → 73 (-8) Not run: source report used CI-only mode
x7411 5 3299 → 2567 (-732) 76 → 69 (-7) Not run: source report used CI-only mode
x7412 5 2413 → 2215 (-198) 49 → 47 (-2) Not run: source report used CI-only mode
x7413 4 3371 → 2690 (-681) 52 → 40 (-12) Not run: source report used CI-only mode
x7415 4 1240 → 912 (-328) 20 → 20 (0) Not run: source report used CI-only mode
x7404 0 retained 0 0 Skipped

No in-shard coverage totals line exists in the supplied reports: each says tests/coverage were not run under CI-only instructions. No <=1% coverage-loss claim is made.

Retained files by shard

x7378

  • src/commands/backup-verify-manifest.update-recovery.test.ts
  • src/commands/channels.add.test.ts

x7380

  • extensions/memory-core/src/dreaming-phases.test.ts
  • extensions/memory-core/src/dreaming-startup-cleanup.test.ts
  • extensions/memory-core/src/dreaming-state.test.ts
  • extensions/memory-core/src/dreaming-sweep-narrative.test.ts
  • extensions/memory-core/src/memory-budget.test.ts
  • extensions/memory-core/src/memory-entry-origins.test.ts
  • extensions/memory-core/src/memory-events.test.ts

x7402

  • src/cli/update-cli/update-command-lease-service.test-support.ts
  • src/cli/update-cli/update-command-legacy-finalize.test.ts
  • src/cli/update-cli/update-command-lifecycle-repair.test-support.ts
  • src/cli/update-cli/update-command-maintenance-contention.test-support.ts
  • src/cli/update-cli/update-command-metadata-diagnostics.test.ts
  • src/cli/update-cli/update-command-migrated-windows.test.ts
  • src/cli/update-cli/update-command-mutable-signals.test.ts

x7405

  • src/infra/outbound/session-binding-routing.worker.test.ts
  • src/infra/outbound/session-binding-service.async-read.test.ts
  • src/infra/outbound/session-binding-service.test.ts
  • src/infra/outbound/source-delivery-plan.test.ts
  • src/infra/outbound/source-reply-mirror.test.ts
  • src/infra/outbound/target-resolver.test.ts
  • src/infra/outbound/targets.test-helpers.ts

x7406

  • src/cron/run-diagnostics.test.ts
  • src/cron/run-history-detail.test.ts
  • src/cron/run-history.test.ts
  • src/cron/schedule.test.ts
  • src/cron/scratch-store.test.ts
  • src/cron/service.persists-delivered-status.test.ts
  • src/cron/service.trigger-eval.test.ts

x7407

  • src/gateway/tool-resolution.swarm-collector.test.ts
  • src/gateway/tools-invoke-http.test.ts
  • src/gateway/tools-invoke.policy.test-support.ts
  • src/gateway/update-run-watcher.interruption.test.ts
  • src/gateway/update-run-watcher.schema-publication.test.ts

x7409

  • src/agents/model-selection-resolve.test.ts
  • src/agents/model-selection.catalog-overlay.test.ts
  • src/agents/model-selection.test.ts

x7410

  • src/infra/sqlite-maintenance-fixture.test-support.ts
  • src/infra/sqlite-transaction.diagnostics.test.ts
  • src/infra/sqlite-transaction.test.ts
  • src/infra/sqlite-wal-checkpoint.test.ts
  • src/infra/sqlite-wal.checkpoint-tick.test.ts
  • src/infra/sqlite-wal.idle.test.ts
  • src/infra/sqlite-wal.test.ts

x7411

  • src/plugins/copy-bundled-plugin-metadata.test.ts
  • src/plugins/current-plugin-metadata-snapshot.test.ts
  • src/plugins/dashboard-capabilities.test.ts
  • src/plugins/discovery-checkout.test.ts
  • src/plugins/discovery.test.ts

x7412

  • src/system-agent/approval-intent.test.ts
  • src/system-agent/assistant.configured.test.ts
  • src/system-agent/chat-engine.test-support.ts
  • src/system-agent/chat-engine.test.ts
  • src/system-agent/chat-turn-router.operations.test.ts

x7413

  • test/scripts/plugin-publication-artifact.test.ts
  • test/scripts/plugin-release-git-lifecycle.test.ts
  • test/scripts/plugin-release-pretag-pack-check.process-tree.test.ts
  • test/scripts/plugin-sdk-api-diff.test.ts

x7415

  • src/agents/openai-transport-stream.deepseek-and-shaping.test.ts
  • src/agents/openai-transport-stream.failed-sse.test.ts
  • src/agents/openclaw-gateway-tool.test.ts
  • src/agents/openclaw-owned-tool-runtime-contract.test.ts

Conflict and dropped-hunk record

  • Skipped d00a0c35e9db9d915b324e91b802ad2edc808e33 in full. Its four Docker files depended on earlier, unlisted fixture refactors such as runPromotion/publishPrepared. No unlisted commits were imported.

  • System-agent: retained main's embedded + CLI failed-completion cases; dropped the second-pass assistant.configured/chat-engine file rewrites, and the later conflicting owner-change fixture simplification. Other system-agent cleanup remains.

  • Agent tools: retained config.get result scoping; dropped requester-yield rewrites to retain acknowledgment bounds/defaults, missing-child, running-process and earlier-turn cases. Dropped streaming rewrite to retain Azure policy, partial-snapshot and idless-tool-call coverage.

  • SQLite: retained throw + Promise-returning post-COMMIT owner failures, snapshot/Promise-operation regressions and Linux SMB/CIFS/9p cases. Dropped later overlapping sqlite-transaction rewrites and final sqlite-wal rewrite; earlier safe fixture cleanup remains.

  • The channels-remove conflict originally preserved main's additional deletion case in the consolidated table. Final CI-driven restoration below supersedes that resolution and retains the entire pinned-main file.

  • Final CI drop: restored these 12 files to pinned main because their rewritten closed mock factories violate the exact-factory ratchet. This avoids new isolation exceptions or baseline expansion; it also restores the update-finalizer assertions and their original imports intact.

  • src/agents/model-selection-manifest-workspace.test.ts

  • src/agents/model-selection.plugin-runtime.test.ts

  • src/agents/model-transport-debug.test.ts

  • src/agents/models-config.providers.auth-provenance.test.ts

  • src/agents/openclaw-tools.session-status.test.ts

  • src/cli/update-cli/update-command-lifecycle.test.ts

  • src/commands/channels.config-only-status-output.test.ts

  • src/commands/channels.list.test.ts

  • src/commands/channels.logs.test.ts

  • src/commands/channels.remove.test.ts

  • src/commands/channels.resolve.test.ts

  • src/commands/channels.status.command-flow.test.ts

Fresh-main conflict resolution

Rebased onto 9a81e55bab1f36075ad44972bd1fe8e53af372b9 after GitHub reported a merge conflict. The sole conflict was session-binding-service.async-read.test.ts: retained main's three method-specific deprecation warning expectations and kept compatible fixture consolidation. git range-diff confirmed the other 33 commits are patch-equivalent. The final head is 2a1f97f8afcc8dd2b75625cc98395209a7999782; hosted CI is the proof for this head.

Second CI repair pass

CI run 38996003460 exposed additional fixture-contract mismatches in later type partitions, a closed-handle admission failure, and an update-watcher timeout. Under the operator's drop-uncertain-hunk rule, these ten cleanup files were restored to pinned main; no assertion was weakened and no timeout/retry added:

  • src/agents/model-visibility-policy.test.ts
  • src/infra/outbound/targets.test.ts
  • src/infra/sqlite-wal.agent-admission.test.ts
  • src/system-agent/agent-turn.test.ts
  • src/system-agent/approval-intent.resources.test.ts
  • src/system-agent/chat-turn-router.operations.test.ts
  • test/scripts/plugin-sdk-api-release-evidence.test.ts
  • src/gateway/tools-invoke-http.abort.test.ts
  • src/plugins/doctor-contract-artifact.test.ts
  • src/gateway/update-run-watcher.test.ts

These restorations supersede earlier per-file resolution notes where they overlap. The new configured-inference support module then had only one consumer, so its snapshot fixture was folded back into chat-engine.test-support and the unused new module removed. Current-head CI, not the superseded failures above, determines readiness.

Final snapshot fixture repair

CI run 38996840144 cleared the earlier issues and reported one remaining type error: the restored router test supplied a partial config snapshot to the now-typed shared mock. The final head constructs it with the existing complete configSnapshot fixture and preserves its published path/hash/config values. This small repair is the only retained change in chat-turn-router.operations.test.ts; the broader cleanup there remains dropped. Plain oxfmt, oxlint, and diff-check passed. No local typecheck/test rerun was made.

@clawsweeper

clawsweeper Bot commented Oct 17, 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.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 17, 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-17T03:54:15.174177Z 2a1f97f 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.

@steipete
steipete enabled auto-merge (squash) October 17, 2026 02:27
@openclaw-barnacle openclaw-barnacle Bot added gateway Gateway runtime extensions: memory-core Extension: memory-core cli CLI command changes commands Command implementations agents Agent runtime and tooling size: XL labels Oct 17, 2026
@steipete
steipete disabled auto-merge October 17, 2026 02:29
@steipete
steipete enabled auto-merge (squash) October 17, 2026 02:30
@steipete
steipete disabled auto-merge October 17, 2026 02:34
@steipete
steipete enabled auto-merge (squash) October 17, 2026 02:43
@steipete
steipete disabled auto-merge October 17, 2026 02:52
@steipete
steipete enabled auto-merge (squash) October 17, 2026 02:56
@steipete
steipete disabled auto-merge October 17, 2026 03:05
@steipete
steipete enabled auto-merge (squash) October 17, 2026 03:07
@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Oct 17, 2026
@clawsweeper

clawsweeper Bot commented Oct 17, 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 plugin suites.

Example: Gateway shutdown starts while schema publication is pending.

  • Before: A regression explicitly verifies that neither ledger reader starts after publication settles.
  • After: That regression is deleted; the retained shutdown test checks publication settlement and scheduling without checking subsequent ledger reads.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) Useful consolidation supported by current-head CI, with one distinct lifecycle regression removed.
Proof confidence 🦐 gold shrimp (3/6) This maintainer-authored test-only cleanup has no changed shipped behavior requiring a separate live demonstration.
Patch quality 🦐 gold shrimp (3/6) 1 actionable review finding remain.

Product

Kind: Test only · Worth it: Yes · Fix scope: Complete
User problem: Repeated fixtures and assertion plumbing increase test maintenance without changing product behavior.
Reason: The maintainer-directed consolidation has clear maintenance value, provided distinct regression contracts remain covered.

Merge readiness

⛔ Needs changes before merge - 2 items remain

Keep open: this maintainer-directed cleanup is useful, but it removes a distinct regression protecting watcher shutdown from starting another ledger read.

Priority: P3
Reviewed head: aaf1057744dded31f6fe28b5051850a13f6541a0

Before merge

  • Preserve the shutdown regression against late ledger reads (P2) - The deleted test covers shutdown beginning while schema publication is awaited, followed by publication settling. It specifically detects removal of the closing check immediately after await schedulePublication() in scanOnce. The retained joins in-flight schema publication test checks settlement and timer behavior but never checks ledger.reads; a late ledger read can occur without failing those assertions. Preserve this distinct regression, preferably by adding the no-ledger-read assertion to that existing held-publication test.
  • Explain or restore the original intent of Watcher shutdown during schema publication - df1f0d8: Prevent a shutdown watcher from beginning another ledger read after awaited schema publication settles.

Findings

  • [P2] Preserve the shutdown regression against late ledger reads — src/gateway/update-run-watcher.schema-publication.test.ts:144-147

Provenance

  • Watcher shutdown during schema publication changes intended behavior without addressing why it exists (df1f0d8: Prevent a shutdown watcher from beginning another ledger read after awaited schema publication settles.)
Agent review details

How this fits together

The test suites supply controlled inputs to production owners and check routing, storage, lifecycle, and release contracts.

flowchart LR
  A[Test scenarios] --> B[Shared fixtures]
  B --> C[Production owners]
  C --> D[Controlled external boundaries]
  D --> E[Observed results]
  E --> F[Contract assertions]
Loading

Technical review

Best possible solution:

Keep the consolidation and preserve the no-read-after-shutdown assertion in the existing held-publication test.

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

Source and introduction history establish the lost regression; no target code or mutation experiment was run during this read-only review.

Is this the best way to solve the issue?

Shared fixtures and tables are appropriate, but the shutdown read assertion protects a separate lifecycle contract and should survive consolidation.

Full review comments:

  • [P2] Preserve the shutdown regression against late ledger reads — src/gateway/update-run-watcher.schema-publication.test.ts:144-147
    The deleted test covers shutdown beginning while schema publication is awaited, followed by publication settling. It specifically detects removal of the closing check immediately after await schedulePublication() in scanOnce. The retained joins in-flight schema publication test checks settlement and timer behavior but never checks ledger.reads; a late ledger read can occur without failing those assertions. Preserve this distinct regression, preferably by adding the no-ledger-read assertion to that existing held-publication test.
    Confidence: 0.96
    Late finding: first raised on code an earlier review cycle already covered.

Overall correctness: patch is incorrect
Overall confidence: 0.92

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Plugin publication process-tree coverage keeps the original intent (50b675f: Require Git process-tree extinction before trust decisions and exact source-package readback.)
  • Plugin artifact verification keeps the original intent (54cc90b: Bind publication to immutable artifact identity and verified bytes without exposing credentials to target-controlled packaging.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

Acceptance criteria:

  • pnpm test src/gateway/update-run-watcher.test.ts src/gateway/update-run-watcher.schema-publication.test.ts --maxWorkers=1
  • node scripts/check-changed.mjs -- src/gateway/update-run-watcher.test.ts src/gateway/update-run-watcher.schema-publication.test.ts
  • git diff --check

What I checked:

PR surface

Tests -3500. Total -3500 across 63 files. Added test files: 1.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 63 5714 9214 -3500
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 63 5714 9214 -3500

Review metrics

Metric Value Why it matters
Production versus test LOC Production +0/-0; tests/support +9,807/-15,572, net -5,765 The reduction comes entirely from test maintenance; retaining distinct regression contracts remains necessary.

Labels

Label changes:

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

Label justifications:

  • P3: This is test-maintenance work with no introduced production behavior change.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🦐 gold shrimp.
  • 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, 11:25 PM ET / October 17, 2026, 03:25 UTC.

@steipete
steipete disabled auto-merge October 17, 2026 03:42
@steipete
steipete force-pushed the tcr/land-d196-1792203000 branch from aaf1057 to 2a1f97f Compare October 17, 2026 03:51
@steipete
steipete enabled auto-merge (squash) October 17, 2026 03:52
@steipete
steipete merged commit 663b776 into main Oct 17, 2026
133 of 135 checks passed
@steipete
steipete deleted the tcr/land-d196-1792203000 branch October 17, 2026 04:19
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 18, 2026
)

* test(update-cli): deslop x7402 tests

* test(update-cli): deslop x7402 tests

* test(update-cli): deslop x7402 tests

* test(outbound): deslop x7405 tests

* test(outbound): deslop x7405 tests

* test(memory-core): deslop x7380 tests

* test(gateway): deslop x7407 tests

* test(gateway): deslop x7407 tests

* test(gateway): deslop x7407 tests

* test(cron): deslop x7406 tests

* test(cron): deslop x7406 tests

* test(cron): deslop x7406 tests

* test(plugins): deslop x7411 tests

* test(plugins): deslop x7411 tests

* test(channels): deslop x7378 tests

* test(system-agent): deslop x7412 tests

* test(system-agent): deslop x7412 tests

* test(system-agent): deslop x7412 tests

* test(agents): deslop x7415 tests

* test(agents): deslop x7415 tests

* test(plugins): deslop x7413 tests

* test(plugins): further deslop x7413 tests

* test(plugins): consolidate x7413 artifact fixtures

* test(sqlite): deslop x7410 tests

* test(sqlite): deslop x7410 tests

* test(sqlite): deslop x7410 tests

* test(agents): deslop x7409 tests

* test(agents): deslop x7409 tests

* test(agents): deslop x7409 tests

* test(gateway): keep retained config scoping fixture explicit

* test: repair CI fixtures and retain guarded mock factories

* test: retain current fixture contracts in campaign replay

* test(system-agent): reuse complete config snapshot fixture

* test(agents): retain messaging target tool identity assertion
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 commands Command implementations extensions: memory-core Extension: memory-core gateway Gateway runtime P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: XL status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant