Skip to content

test(gateway,plugins,channels): remove low-value tests (batch d449) - #180485

Merged
steipete merged 22 commits into
mainfrom
tcr/land-d449-1792660458
Oct 22, 2026
Merged

steipete merged 22 commits into
mainfrom
tcr/land-d449-1792660458

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

Redundant assertions and repeated fixtures make these test families harder to maintain and run.

User Impact

No user-visible runtime change. This batch consolidates test fixtures and overlapping proof while preserving current-main behavior. No runtime production code or public API changes.

Why This Change Was Made

Replay the bounded d449 cleanup batch onto pinned main 6a53d6fc6e424182d1b4510c03e1072b8eb62167. Keep current-main regressions and lifecycle fixes when the older campaign scaffolding conflicts. Gateway voice and terminal lifecycle cases now share their owning suites; channel catalog/contract fixtures use shared helpers; Mattermost, Tlon, plugins, state, memory ranking, and WhatsApp tests shed repeated setup and assertions.

Evidence

CI-only validation, as requested: dependency installation with Node 26.12.1; changed-file oxfmt, plain oxlint, and git diff --check. No local Vitest, check-changed, typecheck, or Testbox runs. Required openclaw/ci-gate provides runtime/type proof on this PR head. Local test wall time and coverage are not measured; all twelve source shard reports explicitly say tests and coverage were not run under CI-only mode. No coverage percentage claim is made for this replay.

No CODEOWNERS patterns match the changed paths.

Replay decisions

20 source commits applied; 10 skipped:

  • y0605: skipped 07b93d76f02d, 87208e91838a, 9e57d35f1ea4. Current main has revised request factories, additional projection cases, and different suite boundaries; retain its LLM tests rather than transplanting the dependent older capture harness.
  • y0606: applied 69e85ff514c5; skipped a0dfcaee0258, 7b72fd3a46a6. Preserve current loopback authority/receipt fixtures and their cleanup instead of moving a divergent older suite into the transport fixture.
  • y0608: skipped bd6428481496, bfe99072e97f, 307069fc3043. Current Skills tests have since moved to async boundaries and settled lifetimes; keep those complete tests and supporting scaffolding.
  • y0610: skipped d629b43c3130, cfb3067e5f6a. Current Twilio tests have different AMD callback assertions and lifecycle cleanup; do not replace them with the older merged-stream fixture.
  • Mattermost inventory conflict: initially removed the delivery-trace entry while keeping main's monitor-auth entry; review then restored the complete trace suite and its protected inventory entry. Final inventory is unchanged.
  • Synthetic auth conflict: retain main's separate persisted/derived tests while sharing snapshot/assertion setup.
  • Terminal conflict: keep main's node-relay suite intact, including explicit unregister/timer cleanup; apply the other terminal hunks.
  • Memory conflict: keep main's embeddings suite and generic embedding bridge suite intact; apply only the independent ranking cleanup.

Review

Independent review found three P2 issues. Accepted all three: restored the creator namespace migration test's maintenance guard, injected-failure rollback, integrity checks and restorable backup; restored the generic embedding bridge test in the staged result; restored the Mattermost real draft/delivery trace composition and its protected CI entry. No findings rejected.

Focused follow-up review of the restorations: scoped-clean through P2; all three findings resolved.

Source reports describe the initial shard cleanup, before subsequent fixture-consolidation commits. Their original family LOC/declaration counts are historical context, not the final replay totals. Final diff counts follow below.

Final replay size and shard evidence

Counts below are physical test/support lines added/deleted and static it/test declarations in changed files, not executed case counts. Coverage for every row: not measured (CI-only mode), as stated in its source shard report.

Shard Added / deleted LOC Declaration count before → after
y0601 +98 / −202 44 → 40
y0604 +463 / −552 35 → 32
y0606 +110 / −183 44 → 41
y0607 +209 / −324 32 → 29
y0609 +409 / −566 50 → 52
y0611 +398 / −590 56 → 50
y0612 +687 / −1309 14 → 17
y0613 +677 / −1287 75 → 42
y0614 +110 / −236 11 → 6
y0605, y0608, y0610 skipped; no final diff unchanged

Runtime production LOC: +0 / −0. Test/test-support LOC: +3161 / −5248. Test-routing tooling: +0 / −1 (removed the moved Gateway voice suite's obsolete path). Total: +3161 / −5249, net −2088.

Changed files by shard

y0601:

  • extensions/mattermost/src/channel-actions-setup-status.contract.test.ts
  • extensions/mattermost/src/channel.test.ts
  • extensions/mattermost/src/session-route.test.ts
  • extensions/mattermost/src/setup.test.ts

y0604:

  • src/gateway/talk/handlers/catalog-speech.test.ts
  • src/gateway/talk/handlers/realtime-relay-close.test.ts
  • src/gateway/talk/handlers/target.test.ts
  • src/gateway/talk/handlers/voice.test.ts
  • test/vitest/vitest.gateway-server-paths.mjs

y0606:

  • extensions/tlon/src/channel.runtime.test.ts
  • extensions/tlon/src/core.test.ts
  • extensions/tlon/src/outbound-tool-trace-sanitize.test.ts
  • extensions/tlon/src/security.test.ts
  • extensions/tlon/src/settings.test.ts
  • extensions/tlon/src/tlon-api.test.ts

y0607:

  • src/plugins/compaction-provider.test.ts
  • src/plugins/compiled-sdk-host.test.ts
  • src/plugins/dev-source-root.test.ts
  • src/plugins/document-extractors.runtime.test.ts
  • src/plugins/effective-plugin-ids.test.ts
  • src/plugins/embedding-providers.test.ts
  • src/plugins/extractor-runtime.generation.test.ts
  • src/plugins/installs.test.ts
  • src/plugins/synthetic-auth.runtime.test.ts

y0609:

  • src/state/backup-run-records.test.ts
  • src/state/config-machine-state-write.test.ts
  • src/state/database-runtime-schema-checks.test.ts
  • src/state/local-onboarding-state.test-support.ts
  • src/state/onboarding-recommendations.test.ts
  • src/state/state-domain-publication.test.ts

y0611:

  • src/gateway/terminal/launch.test.ts
  • src/gateway/terminal/session-manager.detach.test.ts
  • src/gateway/terminal/session-manager.eviction.test.ts
  • src/gateway/terminal/session-manager.test.ts

y0612:

  • src/channels/plugins/contracts/test-helpers/bundled-channel-plugin-loader.ts
  • src/channels/plugins/contracts/test-helpers/channel-catalog-contract.ts
  • src/channels/plugins/contracts/test-helpers/channel-plugin-catalog-contract-suites.ts
  • src/channels/plugins/contracts/test-helpers/config-write-contract-suites.ts
  • src/channels/plugins/contracts/test-helpers/registry-backed-contract-shards.ts
  • src/channels/plugins/contracts/test-helpers/registry-session-binding.ts
  • src/channels/plugins/contracts/test-helpers/session-binding-registry-backed-contract.ts
  • src/channels/plugins/contracts/test-helpers/surface-contract-suite.ts
  • src/channels/plugins/contracts/test-helpers/threading-directory-contract-suites.ts

y0613:

  • extensions/whatsapp/src/inbound/access-control.test.ts
  • extensions/whatsapp/src/inbound/durable-receive.test.ts
  • extensions/whatsapp/src/inbound/extract.test.ts
  • extensions/whatsapp/src/inbound/media.node.test.ts
  • extensions/whatsapp/src/inbound/outbound-mentions.test.ts
  • extensions/whatsapp/src/inbound/send-api.test.ts
  • extensions/whatsapp/src/inbound/send-result.test.ts

y0614:

  • extensions/memory-core/src/memory/mmr.test.ts
  • extensions/memory-core/src/memory/temporal-decay.test.ts

Original per-shard report totals (before later consolidation commits): y0601 1,795→1,448 LOC, 54→49 declarations; y0604 2,008→1,980 LOC, 39→39; y0605 1,272→1,167 LOC, 40→38; y0606 1,733→1,660 LOC, 51→48; y0607 1,784→1,740 LOC, 45→45; y0608 1,912→1,833 LOC, 39→38; y0609 1,916→1,898 LOC, 50→50; y0610 1,568→1,373 LOC, 55→49; y0611 1,803→1,696 LOC, 63→61; y0612 1,777→1,687 LOC, 14→14; y0613 1,741→1,529 LOC, 78→63; y0614 1,564→1,476 LOC, 39→37. All report tests/coverage not run; none establishes a coverage-drop percentage.

@clawsweeper

clawsweeper Bot commented Oct 22, 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 22, 2026 09:20
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 22, 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-22T09:32:53.750724Z 22be2a9 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: mattermost Channel integration: mattermost channel: tlon Channel integration: tlon channel: whatsapp-web Channel integration: whatsapp-web gateway Gateway runtime extensions: memory-core Extension: memory-core size: XL labels Oct 22, 2026
@steipete
steipete disabled auto-merge October 22, 2026 09:27
@steipete
steipete enabled auto-merge (squash) October 22, 2026 09:28

@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: 22be2a96f6

ℹ️ 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".

});
},
);
it("finalizes a failed resize before reporting the backend error", async () => {

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.

P2 Badge Restore backend-reported exit error coverage

When a relay backend reports an error through onExit, this replacement no longer verifies that TerminalSessionManager removes the session and emits terminal.exit with reason: "error" and the original message. The former relay row exercised that callback, whereas node-relay.test.ts:326-358 only proves the relay produces it and the surviving process-exit test covers only { exitCode: 0 }; the resize exception here enters a different manager method. A regression in the manager's backend-error callback branch can therefore pass all remaining tests.

Useful? React with 👍 / 👎.

@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 22, 2026
@clawsweeper

clawsweeper Bot commented Oct 22, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs changes before merge.

What this changes

This PR consolidates test fixtures and removes overlapping assertions across Gateway, plugins, channels, state, and memory tests.

Example: A terminal backend reports ROUTE_CHANGED through its exit callback.

  • Before: A manager test verifies that terminal.exit preserves the backend error.
  • After: The replacement covers resize failure but no longer exercises the backend-error exit callback.

Review scores

Measure Result What it means
Overall readiness 🦪 silver shellfish (2/6) Useful consolidation, but three distinct regression contracts are lost despite successful supporting CI checks.
Proof confidence 🌊 off-meta tidepool Not applicable: This maintainer-authored test-only cleanup has no changed shipped behavior requiring contributor media; exact-head CI supplies supporting execution evidence.
Patch quality 🦪 silver shellfish (2/6) 3 actionable review findings remain.

Product

Kind: Test only · Worth it: Yes · Fix scope: Complete
User problem: Repeated fixtures and overlapping assertions increase test maintenance cost.
Reason: The maintainer-authored direction is approved and the consolidation uses existing owners; distinct regression contracts still need preservation.

Merge readiness

⛔ Needs changes before merge - 6 items remain

Keep this maintainer-authored PR open: the cleanup is worthwhile, but three deletions remove distinct regression contracts.

Priority: P3
Reviewed head: 22be2a96f6ef97e18e4901f5be7f86eabca9b20d

Before merge

  • Restore backend-reported exit error coverage (P2) - The replacement removes the relay row that invokes the manager’s registered onExit callback with an error such as ROUTE_CHANGED. The surviving resize failure enters updateSession instead, and node-relay.test.ts only checks that the backend produces the callback. Consequently, a regression that classifies backend errors as process_exit or drops their error text can pass the remaining tests. Restore this callback case in the consolidated manager suite, including terminal.exit reason and original error assertions.
  • Retain sandbox revocations across failed hot reloads (P2) - This hunk deletes the sequence that prepares sandbox mode all, then prepares mode off after the first hot reload fails, and verifies access remains denied until commit. The remaining case changes the second preparation to restartPending=true, exercising a different restriction bucket, while the disabled-terminal case checks global enablement rather than per-agent sandbox restrictions. Clearing commitRestrictions on each hot preparation would now escape these tests and reopen a host terminal before a successful reload. Restore the hot-to-hot sandbox sequence alongside the restart case.
  • Preserve remote timestamps through hybrid ranking (P2) - Removing the mergeHybridResults scenario leaves memorySourceMtimes exercised only through applyTemporalDecayToHybridResults directly. If hybrid ranking stops forwarding memorySourceMtimes, those helper tests still pass, while a remote imports/note.md indexed 30 days ago incorrectly retains score 1 instead of decaying to approximately 0.5. Restore the composition case through mergeHybridResults, preferably in hybrid.test.ts, retaining its remote timestamp and evergreen/date precedence assertions.
  • Explain or restore the original intent of Terminal backend-error assertions - c788c2f: The prior cleanup retained distinct terminal lifecycle and node-relay coverage rather than treating all backend failures as equivalent.
  • Explain or restore the original intent of Terminal cumulative sandbox revocations - 7e8ea61: Stage restrictions before reload and prevent failed reloads from granting terminal access.
  • Explain or restore the original intent of Remote memory timestamp composition - 14cf168: Remote workspace memory ranking must use indexed host timestamps rather than Gateway filesystem timestamps.

Findings

  • [P2] Restore backend-reported exit error coverage — src/gateway/terminal/session-manager.test.ts:72-78
  • [P2] Retain sandbox revocations across failed hot reloads — src/gateway/terminal/launch.test.ts:205-209
  • [P2] Preserve remote timestamps through hybrid ranking — extensions/memory-core/src/memory/temporal-decay.test.ts:34-36

Provenance

  • Terminal backend-error assertions changes intended behavior without addressing why it exists (c788c2f: The prior cleanup retained distinct terminal lifecycle and node-relay coverage rather than treating all backend failures as equivalent.)
  • Terminal cumulative sandbox revocations changes intended behavior without addressing why it exists (7e8ea61: Stage restrictions before reload and prevent failed reloads from granting terminal access.)
  • Remote memory timestamp composition changes intended behavior without addressing why it exists (14cf168: Remote workspace memory ranking must use indexed host timestamps rather than Gateway filesystem timestamps.)
Agent review details

How this fits together

These suites exercise OpenClaw’s Gateway and plugin owners using synthetic transport inputs, temporary state, and shared fixtures, producing assertions consumed by CI.

flowchart LR
  A[Test scenarios] --> B[Shared fixtures]
  B --> C[Gateway owners]
  B --> D[Channel and plugin owners]
  B --> E[State and memory owners]
  C --> F[Contract assertions]
  D --> F
  E --> F
Loading

Technical review

Best possible solution:

Retain the fixture consolidation while restoring the backend-error, failed hot-reload, and remote hybrid-ranking contracts in their existing owner suites.

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

This PR reports no runtime bug; the coverage losses are established by comparing removed scenarios, surviving tests, and their production owners without executing target code.

Is this the best way to solve the issue?

Shared fixtures and owner-suite consolidation are appropriate, but replacing distinct callback, reload-settlement, and ranking-composition contracts with adjacent tests weakens the stated preservation invariant.

Full review comments:

  • [P2] Restore backend-reported exit error coverage — src/gateway/terminal/session-manager.test.ts:72-78
    The replacement removes the relay row that invokes the manager’s registered onExit callback with an error such as ROUTE_CHANGED. The surviving resize failure enters updateSession instead, and node-relay.test.ts only checks that the backend produces the callback. Consequently, a regression that classifies backend errors as process_exit or drops their error text can pass the remaining tests. Restore this callback case in the consolidated manager suite, including terminal.exit reason and original error assertions.
    Confidence: 0.99
  • [P2] Retain sandbox revocations across failed hot reloads — src/gateway/terminal/launch.test.ts:205-209
    This hunk deletes the sequence that prepares sandbox mode all, then prepares mode off after the first hot reload fails, and verifies access remains denied until commit. The remaining case changes the second preparation to restartPending=true, exercising a different restriction bucket, while the disabled-terminal case checks global enablement rather than per-agent sandbox restrictions. Clearing commitRestrictions on each hot preparation would now escape these tests and reopen a host terminal before a successful reload. Restore the hot-to-hot sandbox sequence alongside the restart case.
    Confidence: 0.97
  • [P2] Preserve remote timestamps through hybrid ranking — extensions/memory-core/src/memory/temporal-decay.test.ts:34-36
    Removing the mergeHybridResults scenario leaves memorySourceMtimes exercised only through applyTemporalDecayToHybridResults directly. If hybrid ranking stops forwarding memorySourceMtimes, those helper tests still pass, while a remote imports/note.md indexed 30 days ago incorrectly retains score 1 instead of decaying to approximately 0.5. Restore the composition case through mergeHybridResults, preferably in hybrid.test.ts, retaining its remote timestamp and evergreen/date precedence assertions.
    Confidence: 0.98

Overall correctness: patch is incorrect
Overall confidence: 0.97

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Channel contract fixture consolidation keeps the original intent (bcd1588: Share contract fixtures while preserving independent channel behaviors; the canonical public-surface test loader now resolves source surfaces directly.)
  • WhatsApp admission and delivery fixtures keeps the original intent (7d48769: Reduce repeated setup while retaining admission, accepted-delivery, transport, and media contracts.)
  • Talk close-persistence suite relocation keeps the original intent (d60f85f: Accepted voice work must settle during shutdown; its close-persistence scenario matrix survives in the voice suite.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

Acceptance criteria:

  • pnpm test src/gateway/terminal/session-manager.test.ts src/gateway/terminal/launch.test.ts --maxWorkers=1
  • pnpm test extensions/memory-core/src/memory/hybrid.test.ts extensions/memory-core/src/memory/temporal-decay.test.ts --maxWorkers=1
  • git diff --check
  • Require successful affected lint/type checks and openclaw/ci-gate on the repaired head.

What I checked:

Likely related people:

  • stevenlee-oai: Raw commit 0738f13 adds src/gateway/terminal/session-manager.test.ts:60 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: medium; commits: 0738f1313cea; files: src/gateway/terminal/session-manager.test.ts)

PR surface

Tests -2089. Total -2089 across 51 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 51 3077 5166 -2089
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 51 3077 5166 -2089

Review metrics

Metric Value Why it matters
Production versus test changes Production +0/-0; tests and test support +3077/-5165; test routing +0/-1. The reduction is confined to test maintenance, but distinct boundary coverage must survive consolidation.

Labels

Label changes:

  • add P3: This is test-maintenance cleanup with no runtime behavior change.
  • add rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🌊 off-meta tidepool 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 runtime behavior change.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🌊 off-meta tidepool 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 22, 2026, 5:45 AM ET / 09:45 UTC.

@steipete
steipete merged commit 6a570d1 into main Oct 22, 2026
138 checks passed
@steipete
steipete deleted the tcr/land-d449-1792660458 branch October 22, 2026 09:53
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 23, 2026
…penclaw#180485)

* test(mattermost): deslop y0601 tests

* test(gateway): deslop y0604 tests

* test(gateway): consolidate y0604 fixtures

* test(gateway): merge y0604 voice lifecycle suites

* test(plugins): deslop y0607 tests

* test(plugins): consolidate y0607 fixture scaffolding

* test(plugins): consolidate y0607 tables and fixtures

* test(tlon): deslop y0606 tests

* test(state): deslop y0609 tests

* test(state): consolidate y0609 fixture and observation setup

* test(state): deduplicate migration and publication contracts

Keep creator provenance checks; delegate generic rollback and maintenance gates to the migration-owner suites. Drop the manual node:sqlite backup replay. Retain custom publication identity through credential-authority integration coverage and parameterize pending/completed onboarding resets.

* test(terminal): deslop y0611 tests

* test(terminal): consolidate y0611 fixtures and overlap

* test(terminal): remove duplicate y0611 boundary checks

* test(memory): deslop y0614 tests

* test(memory): consolidate y0614 embedding and ranking coverage

* test(channels): deslop y0612 tests

* test(channels): consolidate y0612 contract helper family

* test(whatsapp): deslop y0613 tests

* test(whatsapp): consolidate y0613 inbound family

* test: retain distinct delivery and migration coverage

* test: preserve fixture types in cleanup consolidation
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

channel: mattermost Channel integration: mattermost channel: tlon Channel integration: tlon channel: whatsapp-web Channel integration: whatsapp-web extensions: memory-core Extension: memory-core 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