Skip to content

test(core): remove low-value tests (batch d169) - #174192

Merged
steipete merged 30 commits into
mainfrom
tcr/land-d169-1792150690
Oct 16, 2026
Merged

steipete merged 30 commits into
mainfrom
tcr/land-d169-1792150690

Conversation

@steipete

@steipete steipete commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Repeated test setup and assertion scaffolding make the affected suites harder to maintain. This is the maintainer-requested d169 test-cleanup batch, replayed onto current main.

User Impact

No intended user-visible behavior change. Production code is unchanged. The change consolidates fixtures and assertions while retaining current-main regressions that the older campaign did not contain.

Why This Change Was Made

Replay the requested cleanup commits without importing earlier, unlisted campaign changes. Keep current-main tests and contracts wherever a proposed consolidation depends on a previous reduction or an obsolete helper layout.

Evidence

  • Dependency installation: pnpm install --frozen-lockfile --prefer-offline passed.
  • All 60 changed TypeScript test/support files: node_modules/.bin/oxfmt --write <changed files> and node_modules/.bin/oxlint -c .oxlintrc.json <changed files> passed (exit 0).
  • git diff --check against the replay base passed.
  • Per the maintainer's CI-only instruction, no local tests, coverage, typecheck, check-changed, or Testbox runs were performed. The source shard reports also explicitly state coverage was not run; there are no in-shard coverage totals to claim. Hosted openclaw/ci-gate is the runtime/typecheck proof and merge gate.
  • Independent review runs alongside hosted CI; actionable findings will be repaired before completion.
  • No paths in this diff match the repository's current CODEOWNERS rules.

Initial replay decisions

28 of 30 source commits applied, with the following omissions. All other nonconflicting changes in applied commits were retained.

  • Skipped fd57e898e4f692eca72483bbed3081a68eaacb57 (x7113): all seven files depend on earlier campaign helpers absent from main and overlap newer routing/session assertions. No auto-reply changes are included.
  • Skipped 5261b844be2822b65101746a48c64dc1ca869257 (x7118): follow-up fixture rewrite depends on the omitted HTTP/install reductions and conflicts throughout the current files.
  • x7108: the first commit retains all four original/reasoning rows and the newer ordering cases in chat-thread-input-order.test.ts. The two later commits' changes to that file are omitted; their changes to other chat files remain.
  • x7111: omit plugin-lifecycle-lease.test.ts changes in all three commits. Preserve the full operation/cleanup outcome matrix, both shared-state lease cases, and runtime/cleanup waiter coverage.
  • x7115: omit sqlite-schema-contract.test.ts changes in all three commits and sqlite-schema-contract.worker.test.ts in the second. Preserve the current diagnostic import boundary, vector/view regressions, and fingerprint-based cold-worker proof.
  • x7109: omit models.test.ts changes from the second and third commits; retain the first cleanup and all newer capability/authentication cases.
  • x7095: omit onboard-skills.test.ts; retain newer Linuxbrew and default/saved package-manager cases.
  • x7118 first commit: retain only infra-runtime.test.ts. Omit home-directory, HTTP body/response/lifecycle, and archive-install rewrites because they rely on earlier case reductions or changed current-main fixtures. Plain lint exposed shadowed installer callbacks in install-from-npm-spec.test.ts; source inspection also found its narrowed helper no longer accepted current-main callbacks, so that file's hunk was dropped.
  • x7125: omit the second commit's session-state-events.test.ts rewrite, preserving the first cleanup and newer watcher-session cases.
  • x7120: omit the third commit's model-fallback.probe.test.ts rewrite, preserving earlier cleanup plus newer overload/resource-exhaustion regressions.
  • x7114: omit codex-install-assertions.test.ts; preserve current binding/session-store contract overrides and configure/plugin assertions.

CI repair

The first hosted run exposed fixture regressions and type errors introduced by the replay. No failing check is treated as pre-existing. The corrected head restores the original versions of the following files, rather than weakening assertions or importing missing campaign prerequisites:

  • extensions/active-memory/index.test.ts
  • extensions/feishu/src/docx-create-loopback.test.ts
  • extensions/feishu/src/drive-comments-loopback.test.ts
  • extensions/feishu/src/docx-table-actions.test.ts
  • src/agents/model-fallback.probe.test.ts
  • src/gateway/server-methods/model-discovery-policy.test.ts
  • src/gateway/server-methods/models-auth-login.catalog.integration.test.ts
  • src/sessions/session-lifecycle-diagnostics.test.ts
  • src/infra/infra-runtime.test.ts
  • src/secrets/provider-integrations.test.ts
  • ui/src/pages/chat/chat-submit-handoff.test.ts
  • extensions/feishu/src/drive.test.ts
  • src/gateway/server-methods/models.test.ts

The new Feishu loopback helper was removed with its callers' rewrites. Remaining repairs preserve fixture contracts: the admission hook returns the wrapped result on both paths; tuple identities retain their fixed arity; the filesystem interceptor accepts the real optional flags type; a heterogeneous assertion callback is invoked explicitly; and mock-isolation annotations describe the mocked external/state boundaries. The unused generic on the chat fixture was removed. The interrupted original review is not counted as completed; the corrected head receives a fresh independent review.

Final review and ratchet correction

The independent full-diff review identified a real loss of constructor-argument forwarding coverage; the final correction restores the parameterized constructor and both argument-bearing calls. Two proposed type findings were rejected after checking current source: RuntimeEnv.exit returns void, and TranscriptEvent is unknown, so the reported incompatibilities do not apply. Review method: full-diff review plus a focused review of the corrective commit.

The last CI type error is fixed at the fixture producer: makeTarget preserves the input tuple type. The 14 obsolete mock-export baseline rows named by CI are removed exactly; no baseline entries are added. All earlier runtime-test failures cleared in the corrected run, but the final head must satisfy fresh hosted CI.

Shard inventory

Actual changed-file counts against the pinned replay base. LOC includes test-support files. Declarations are static it/test call sites, not executed/expanded cases; table consolidation can reduce this number without removing rows.

Shard Files LOC before → after (delta) Declarations before → after Coverage
x7113 0 0 → 0 (0) 0 → 0 Not run (CI-only report)
x7108 6 3474 → 3085 (-389) 80 → 78 Not run (CI-only report)
x7111 8 3042 → 2766 (-276) 70 → 68 Not run (CI-only report)
x7116 7 3314 → 2601 (-713) 48 → 48 Not run (CI-only report)
x7115 6 3067 → 2656 (-411) 76 → 74 Not run (CI-only report)
x7109 1 804 → 711 (-93) 17 → 17 Not run (CI-only report)
x7117 1 215 → 192 (-23) 4 → 4 Not run (CI-only report)
x7095 5 3424 → 2683 (-741) 59 → 55 Not run (CI-only report)
x7118 0 0 → 0 (0) 0 → 0 Not run (CI-only report)
x7125 6 3313 → 2631 (-682) 79 → 72 Not run (CI-only report)
x7120 5 3442 → 2969 (-473) 64 → 57 Not run (CI-only report)
x7124 4 2012 → 1482 (-530) 43 → 43 Not run (CI-only report)
x7119 7 3918 → 3106 (-812) 103 → 84 Not run (CI-only report)
x7114 4 2323 → 2146 (-177) 56 → 54 Not run (CI-only report)

Test files: +9,382 / −14,970 lines (net −5,588). Test support: +378 / −110 (net +268). Mock-export baseline: +0 / −14. Combined: +9,760 / −15,094 (net −5,334). Production: +0 / −0. There are 60 TypeScript test/support files and one shrink-only baseline file.

Files by shard
  • x7113: no remaining changes.
  • x7108: ui/src/pages/chat/chat-steer-order.test.ts, ui/src/pages/chat/chat-thread-fixtures.test-support.ts, ui/src/pages/chat/chat-thread-grouping.test.ts, ui/src/pages/chat/chat-thread-input-order.test.ts, ui/src/pages/chat/chat-thread-live-final.test.ts, ui/src/pages/chat/chat-thread.test.ts.
  • x7111: src/plugins/plugin-instance-callbacks.test.ts, src/plugins/plugin-instance-invocation.test.ts, src/plugins/plugin-instance-iterables.test.ts, src/plugins/plugin-instance-value-views.test.ts, src/plugins/plugin-instance.consumer.test.ts, src/plugins/plugin-instance.retention.test.ts, src/plugins/plugin-instance.test-support.ts, src/plugins/plugin-instance.test.ts.
  • x7116: src/secrets/resolve.test.ts, src/secrets/runtime-auth-refresh-failure.test.ts, src/secrets/runtime-auth-store-inline-refs.test.ts, src/secrets/runtime-command-secrets.test.ts, src/secrets/runtime.coverage.test.ts, src/secrets/runtime.fast-path.test.ts, src/secrets/runtime.test.ts.
  • x7115: src/infra/sqlite-readonly-worker-session.test.ts, src/infra/sqlite-schema-facts.test.ts, src/infra/sqlite-schema-header.test.ts, src/infra/sqlite-snapshot.test-support.ts, src/infra/sqlite-snapshot.test.ts, src/infra/sqlite-snapshot.transfer.test.ts.
  • x7109: src/gateway/server-methods/models-auth-login.test.ts.
  • x7117: extensions/active-memory/escalation.test.ts.
  • x7095: src/commands/onboarding-plugin-install.test.ts, src/commands/reset.sessions.test.ts, src/commands/sandbox-explain.test.ts, src/commands/sandbox.test.ts, src/commands/sessions.test.ts.
  • x7118: no remaining changes.
  • x7125: src/sessions/session-diff-baseline.test.ts, src/sessions/session-key-case-preservation.test.ts, src/sessions/session-lifecycle-admission.pending.test.ts, src/sessions/session-lifecycle-admission.test.ts, src/sessions/session-state-events.test.ts, src/sessions/session-state-events.worker-boundary.test.ts.
  • x7120: src/agents/model-fallback.e2e.test-support.ts, src/agents/model-fallback.reply-entry.e2e.test.ts, src/agents/model-fallback.run-embedded.e2e.test.ts, src/agents/model-fallback.terminal-boundary.test.ts, src/agents/model-fallback.test.ts.
  • x7124: extensions/feishu/src/comment-handler.test.ts, extensions/feishu/src/directory.test.ts, extensions/feishu/src/dm-delivery-loopback.test.ts, extensions/feishu/src/docx.test.ts.
  • x7119: test/scripts/release-scenarios-assertions.test.ts, test/scripts/release-stable-post.test.ts, test/scripts/release-stable.test-support.ts, test/scripts/release-stable.test.ts, test/scripts/release-telegram-candidate-archive.test.ts, test/scripts/release-tooling-identity.test.ts, test/scripts/release-upgrade-baseline.test.ts.
  • x7114: test/scripts/codesign-mac-app.test.ts, test/scripts/codex-app-server-protocol-source.test.ts, test/scripts/codex-npm-plugin-live-audit.test.ts, test/scripts/compiler-input-snapshot.test.ts.

Additional shrink-only maintenance: config/test-mock-exports-baseline.txt.

@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 12:03
@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-16T12:53:40.362553Z 92e6b73 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 app: web-ui App: web-ui gateway Gateway runtime commands Command implementations docker Docker and sandbox tooling agents Agent runtime and tooling channel: feishu Channel integration: feishu extensions: active-memory size: XL labels Oct 16, 2026
@steipete
steipete disabled auto-merge October 16, 2026 12:13
@steipete
steipete enabled auto-merge (squash) October 16, 2026 12:17
@steipete
steipete disabled auto-merge October 16, 2026 12:29
@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Oct 16, 2026
@clawsweeper

clawsweeper Bot commented Oct 16, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs changes before merge.

What this changes

This PR consolidates test fixtures and assertions across runtime, plugin, storage, release, Feishu, and chat suites.

Example: Feishu sends a reply to chat:oc_secondary_conversation using the secondary account.

  • Before: The loopback test repeats the send setup and request assertions inline.
  • After: Shared helpers retain the chat_id routing and Bearer tat-secondary assertions.

Review scores

Measure Result What it means
Overall readiness 🦪 silver shellfish (2/6) Hosted runtime checks support the consolidation, but a confirmed baseline defect blocks CI and a separate compiler failure remains unclassified.
Proof confidence 🦐 gold shrimp (3/6) This maintainer-authored test-only cleanup changes no shipped behavior; ordinary live-behavior proof is not required.
Patch quality 🦪 silver shellfish (2/6) 1 actionable review finding remain.

Product

Kind: Test only · Worth it: Yes · Fix scope: Complete
User problem: Repeated fixtures and assertion scaffolding increase test maintenance cost.
Reason: The maintainer-authored direction is approved, and consolidation leaves production behavior unchanged.

Merge readiness

⛔ Needs changes before merge - 2 items remain

Keep this maintainer-approved cleanup open; moved and annotated mocks leave stale baseline entries that fail a required CI gate.

Priority: P3
Reviewed head: 1db9f4e61ee5737256e8b9a2e16fabcc2106de95

Before merge

  • Prune baseline entries for moved and annotated mocks (P2) - Extracting these mocks removes their registrations from both fallback suites, but config/test-mock-exports-baseline.txt still contains the old source-path fingerprints. Newly annotated onboarding, sandbox, Feishu, and secret-coverage mocks likewise leave obsolete allowances. The ratchet treats removed entries as a failure at scripts/check-test-mock-exports.mts:217-222, matching this head's mock-exports CI failure. Prune the obsolete entries without adding allowances or weakening the checker.
  • Complete next step - Inspect the compiler diagnostic from check-test-types-core-4 and establish whether it requires a branch repair or an evidenced outside-cause disposition.

Findings

  • [P2] Prune baseline entries for moved and annotated mocks — src/agents/model-fallback.e2e.test-support.ts:28-29
Agent review details

How this fits together

These suites feed synthetic configurations, events, and transport responses through production owners and check their outputs and lifecycle behavior.

flowchart TD
  A[Test fixtures] --> B[Production owners]
  C[Controlled transports] --> B
  B --> D[Behavior assertions]
  D --> E[Hosted test checks]
  A --> F[Mock export ratchet]
  E --> G[CI gate]
  F --> G
Loading

Technical review

Best possible solution:

Retain the fixture consolidation, prune obsolete mock fingerprints, and resolve the remaining compiler gate according to its actual diagnostic.

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

The unchanged baseline contains fingerprints for removed mock locations, and the checker deterministically rejects stale entries; hosted CI independently reports mock-exports failure.

Is this the best way to solve the issue?

Shared fixtures and retained behavior assertions fit the approved cleanup direction, but their exact-fingerprint ledger must be updated with the extraction.

Full review comments:

  • [P2] Prune baseline entries for moved and annotated mocks — src/agents/model-fallback.e2e.test-support.ts:28-29
    Extracting these mocks removes their registrations from both fallback suites, but config/test-mock-exports-baseline.txt still contains the old source-path fingerprints. Newly annotated onboarding, sandbox, Feishu, and secret-coverage mocks likewise leave obsolete allowances. The ratchet treats removed entries as a failure at scripts/check-test-mock-exports.mts:217-222, matching this head's mock-exports CI failure. Prune the obsolete entries without adding allowances or weakening the checker.
    Confidence: 0.99

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 5719a1efd41d.

Provenance checked

  • Plugin lifecycle and value-boundary tests keeps the original intent (05a2844: Accepted work retains its supplying plugin through completion and cleanup; later value-boundary changes preserve executable ownership while passing data by reference.)
  • Chat ordering and commentary tests keeps the original intent (fix: Control UI shows run commentary twice during long tool runs #167054: Exact producer identities prevent duplicate commentary, with steers and unsaved live text following explicit ordering rules.)
  • Mock fingerprint baseline keeps the original intent (07e2877: Incomplete first-party mocks require export preservation or explicit isolation, and grandfathered fingerprints may only shrink.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

Acceptance criteria:

  • pnpm check:test-mock-exports --base bc8b7dd
  • git diff --check
  • Hosted checks-fast-baseline-ratchets passes on the repaired head.
  • Hosted check-test-types-core-4 and openclaw/ci-gate pass on the repaired head, or receive an evidenced disposition through the repository's native workflow.

What I checked:

PR surface

Tests -2847. Total -2847 across 60 files. Added test files: 4.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 60 6387 9234 -2847
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 60 6387 9234 -2847

Review metrics

Metric Value Why it matters
Production versus test LOC Production +0/-0; tests and support +9,757/-15,080 The net reduction is entirely test maintenance; shared support accounts for some additions.

Labels

Label changes:

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

Label justifications:

  • P3: This is test-maintenance cleanup with no intended user-facing behavior change.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦐 gold shrimp and patch quality is 🦪 silver shellfish.
  • 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, 8:35 AM ET / 12:35 UTC.

@steipete
steipete enabled auto-merge (squash) October 16, 2026 12:42
@steipete
steipete merged commit a489782 into main Oct 16, 2026
117 checks passed
@steipete
steipete deleted the tcr/land-d169-1792150690 branch October 16, 2026 12:51
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 17, 2026
* test(chat): deslop x7108 tests

* test(chat): deslop x7108 tests

* test(chat): deslop x7108 tests

* test(plugins): deslop x7111 tests

* test(plugins): further deslop x7111 tests

* test(plugins): further deslop x7111 tests

* test(secrets): deslop x7116 tests

* test(sqlite): deslop x7115 tests

* test(sqlite): deslop x7115 tests

* test(sqlite): deslop x7115 tests

* test(gateway): deslop x7109 tests

* test(gateway): deslop x7109 tests

* test(gateway): deslop x7109 tests

* test(active-memory): deslop x7117 tests

* test(active-memory): deslop x7117 tests

* test(active-memory): deslop x7117 tests

* test(commands): deslop x7095 tests

* test(infra): deslop x7118 tests

* test(sessions): deslop x7125 tests

* test(sessions): deslop x7125 tests

* test(agents): deslop x7120 tests

* test(agents): deslop x7120 tests

* test(agents): deslop x7120 tests

* test(feishu): deslop x7124 tests

* test(feishu): deslop x7124 tests

* test(release): deslop x7119 tests

* test(release): further deslop x7119 tests

* test(scripts): deslop x7114 tests

* test: preserve current contracts in replayed fixtures

* test: retain constructor coverage and tuple fixture types
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling app: web-ui App: web-ui channel: feishu Channel integration: feishu commands Command implementations docker Docker and sandbox tooling extensions: active-memory gateway Gateway runtime P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. 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