Skip to content

test(runtime): remove low-value tests (batch d308) - #178232

Merged
steipete merged 33 commits into
mainfrom
tcr/land-d308-1792481540
Oct 20, 2026
Merged

steipete merged 33 commits into
mainfrom
tcr/land-d308-1792481540

Conversation

@steipete

@steipete steipete commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Repeated fixture setup and overlapping test declarations make the affected runtime, launcher, plugin, and chat suites harder to maintain.

User Impact

No production or user-visible behavior change. This batch consolidates test fixtures and assertions while retaining distinct authority, lifecycle, transport, and recovery contracts.

Why This Change Was Made

Replay campaign batch d308 onto pinned main 692a4d02d3ce528cf460c744baf19899c17e7534. Applied 28 of 30 supplied commits, preserving their messages, plus focused correction commits for CI and review findings. The two z0053 commits were dropped because their fixture/lifecycle rewrite conflicts broadly with current main.

Conflict decisions:

  • z0053: skipped 63b23874472 and 856cffe3c47; retained all four current-main Gateway suites unchanged.

  • z0055: kept current-main inference and WebSocket startup support unchanged across all three commits, preserving generation-bound package, explicit generation-binding, and isolated-client cases. Applied the remaining context, side-question, fingerprint, connection-artifact, and idle cleanup.

  • z0056: retained main's removal of legacy extension factories while applying middleware cleanup. Dropped the final commit's dynamic-tools.test.ts rewrite because its broad conflict crosses current-main replay-safety and middleware cases; retained the earlier nonconflicting reduction and the other files from that commit.

  • z0059: retained all four current-main non-canonical media URL cases, using the shared fetch fixture. No cases were lost to the singleton-table rewrite.

  • Rebase watchdog conflict: retained all four new main cases (queued/running × deferred-maintenance/global-lane). Kept the compatible first-pass watchdog cleanup; dropped the second and third commits' conflicting watchdog-file changes.

No CODEOWNERS patterns match these changed files. No changelog edit (release-owned).

Evidence

  • pnpm install --frozen-lockfile --prefer-offline: passed.
  • node_modules/.bin/oxfmt --write <63 changed files>: passed.
  • node_modules/.bin/oxlint -c .oxlintrc.json <63 changed files>: exit 0.
  • git diff --check 692a4d02d3ce528cf460c744baf19899c17e7534: passed.
  • CI-only instruction: no local Vitest, check-changed, tsgo, coverage, or Testbox execution. Hosted openclaw/ci-gate is the runtime proof and merge gate; no local timing or coverage claim.
  • Production LOC: +0 / -0. Test files: +9983 / -14907. Test-support/fixture files: +448 / -320. Total: +10431 / -15227 (net -4796), across 63 files.
  • Changed-file test/support LOC: 34629 → 29833. Static it/test declaration census: 686 → 641; parameterized rows are not expanded in this census.
  • Independent autoreview completed on the full batch and correction delta. Restored pending one-off crypto shutdown, terminal-only/precompleted Gateway waits, and retained-owner afterEach failure assertions. Rejected the stopped-Matrix restart finding because unchanged sdk/client-startup-recovery.test.ts already asserts that contract. Follow-up review: observe real waiter registration before emitting a terminal event. Rejected the suggestion that derived failure flags can be undefined: each flag is computed from string comparisons in the complete scenario table, so the logical expression is already boolean.
  • Initial CI run https://github.com/openclaw/openclaw/actions/runs/39387853151 exposed defaulted fixture-type errors, a Telegram progress-mode omission, a too-exact nested approval match, plain/type-aware lint issues, and a timeout-ratchet violation. Repaired from job logs; no local runtime/typecheck reruns. Moved one-off crypto tests into the existing registration support module to preserve coverage without growing the oversized SDK test file. The second run https://github.com/openclaw/openclaw/actions/runs/39390353323 exposed an unsupported parameterized-test callback context, an unnecessary boolean cast, and eager test import of the wait owner before Gateway event-listener reset. Corrections await dispatcher completion directly, retain the already-boolean expression, and import the wait owner after Gateway setup. Renamed the new preparation fixture to the recognized .test-support.ts suffix so CI classifies its two test-only consumers correctly. Fresh-head hosted CI remains the required runtime proof.
Per-shard replay inventory and campaign evidence

Source reports are first-pass campaign reports, not current-head coverage measurements. Each records tests/coverage as not run under CI-only instructions; there is no in-shard coverage totals line or supported ≤1% coverage claim. Later supplied commits add consolidation, so the current replay counts below are computed against pinned main.

Shard Changed files Test/support LOC before → after Static declarations before → after Source report coverage
z0050 9 3595 → 2807 (-788) 110 → 89 Not run (CI-only)
z0054 9 3547 → 3152 (-395) 65 → 63 Not run (CI-only)
z0055 6 3182 → 2745 (-437) 55 → 48 Not run (CI-only)
z0056 8 3505 → 2862 (-643) 68 → 68 Not run (CI-only)
z0057 8 3512 → 2977 (-535) 61 → 58 Not run (CI-only)
z0058 8 3531 → 3229 (-302) 85 → 80 Not run (CI-only)
z0059 3 3493 → 3157 (-336) 78 → 78 Not run (CI-only)
z0060 3 3714 → 2889 (-825) 90 → 83 Not run (CI-only)
z0062 4 3129 → 2941 (-188) 53 → 53 Not run (CI-only)
z0063 5 3421 → 3074 (-347) 21 → 21 Not run (CI-only)
z0053 0 (both commits skipped) unchanged unchanged Not run (CI-only)

z0050

  • src/auto-reply/reply/reply-agent-turn-preparation.shared.test.ts
  • src/auto-reply/reply/reply-agent-turn-preparation.test-support.ts
  • src/auto-reply/reply/reply-agent-turn-preparation.test.ts
  • src/auto-reply/reply/reply-elevated.test.ts
  • src/auto-reply/reply/reply-flow.test.ts
  • src/auto-reply/reply/reply-media-paths.ssh.test.ts
  • src/auto-reply/reply/reply-operation-abort.test.ts
  • src/auto-reply/reply/reply-plumbing.test.ts
  • src/auto-reply/reply/reply-run-registry.test.ts

z0054

  • test/matrix-client-crypto-authority.integration.test.ts
  • test/media-progress-telegram-retirement.integration.test.ts
  • test/node-host-launcher.test.ts
  • test/non-isolated-runner.fixture-support.ts
  • test/non-isolated-runner.responses-settlement.test.ts
  • test/non-isolated-runner.sqlite.test.ts
  • test/official-channel-catalog.test.ts
  • test/ollama-linklocal.transport.integration.test.ts
  • test/openclaw-launcher.e2e.test.ts

z0055

  • extensions/codex/src/app-server/settled-turn-prior-context.test.ts
  • extensions/codex/src/app-server/shared-client-connection-artifact.test-support.ts
  • extensions/codex/src/app-server/shared-client-idle.test-support.ts
  • extensions/codex/src/app-server/side-question.model-selection.test.ts
  • extensions/codex/src/app-server/side-question.test.ts
  • extensions/codex/src/app-server/thread-fingerprints.test.ts

z0056

  • extensions/codex/src/app-server/dynamic-tool-execution.test.ts
  • extensions/codex/src/app-server/dynamic-tool-profile.test.ts
  • extensions/codex/src/app-server/dynamic-tool-skills.test.ts
  • extensions/codex/src/app-server/dynamic-tools.test-support.ts
  • extensions/codex/src/app-server/dynamic-tools.test.ts
  • extensions/codex/src/app-server/dynamic-tools.tool-authored-source-reply.test.ts
  • extensions/codex/src/app-server/effective-mcp-catalog.test.ts
  • extensions/codex/src/app-server/ephemeral-turn.test.ts

z0057

  • src/agents/cli-runner/bundle-mcp.discovery-lifecycle.test.ts
  • src/agents/cli-runner/bundle-mcp.requester-lifecycle.test.ts
  • src/agents/cli-runner/bundle-mcp.test-support.ts
  • src/agents/cli-runner/cli-run-settlement.test.ts
  • src/agents/cli-runner/cli-run-transcript.test.ts
  • src/agents/cli-runner/execute.background-work.test.ts
  • src/agents/cli-runner/execute.supervisor-capture.test.ts
  • src/agents/cli-runner/execute.test-support.ts

z0058

  • src/sessions/session-controller-model.test.ts
  • src/sessions/session-controller.admission-rule.test.ts
  • src/sessions/session-controller.admission.test.ts
  • src/sessions/session-controller.identity.test.ts
  • src/sessions/session-controller.lifecycle-diagnostics.test.ts
  • src/sessions/session-controller.mailbox-cleanup.test.ts
  • src/sessions/session-controller.rpc-sources.test.ts
  • src/sessions/session-controller.watchdog.test.ts

z0059

  • ui/src/pages/chat/components/chat-message-attachment-admission.browser.test.ts
  • ui/src/pages/chat/components/chat-message.forwarded-attribution.test.ts
  • ui/src/pages/chat/components/chat-message.test.tsx

z0060

  • extensions/matrix/src/matrix/sdk.test.ts
  • extensions/matrix/src/matrix/sdk/crypto-persistence.test-support.ts
  • extensions/matrix/src/matrix/send.authority.integration.test.ts

z0062

  • extensions/anthropic/provider-policy-api.test.ts
  • extensions/anthropic/session-catalog-history.test.ts
  • extensions/anthropic/session-catalog-runtime.test.ts
  • extensions/anthropic/session-catalog.test.ts

z0063

  • src/gateway/server.chat.gateway-server-chat-lifecycle.test.ts
  • src/gateway/server.session-row-deltas.integration.test.ts
  • src/gateway/server.sessions.fixture-lifecycle.test.ts
  • src/gateway/server.startup-recovery-webchat.test.ts
  • src/gateway/server.subagent-settle-replay.harness.test.ts

@clawsweeper

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

chatgpt-codex-connector Bot commented Oct 20, 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-20T08:23:34.735258Z 8c90c61 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: matrix Channel integration: matrix app: web-ui App: web-ui gateway Gateway runtime agents Agent runtime and tooling extensions: anthropic extensions: codex size: XL labels Oct 20, 2026
@steipete
steipete disabled auto-merge October 20, 2026 07:44
@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 20, 2026
@clawsweeper

clawsweeper Bot commented Oct 20, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs changes before merge.

What this changes

This PR consolidates test fixtures, parameterized scenarios, and assertions across runtime, plugin, launcher, and chat suites.

Example: A Codex side question forwards a command approval with messageChannel=discord and additional runtime metadata.

  • Before: The test accepts the full runtime payload while checking the relevant nested fields.
  • After: The rewritten matcher rejects the additional nested fields, causing the approval test to fail.

Review scores

Measure Result What it means
Overall readiness 🦪 silver shellfish (2/6) Useful test consolidation, but a confirmed assertion regression prevents a clean correctness verdict and remaining CI failures are not fully attributed.
Proof confidence 🦐 gold shrimp (3/6) This maintainer-authored PR changes tests and fixtures without changing shipped behavior; CI provides supporting validation but currently includes a confirmed introduced assertion failure.
Patch quality 🦪 silver shellfish (2/6) 1 actionable review finding remain.

Product

Kind: Test only · Worth it: Yes · Fix scope: Complete
User problem: Repeated setup and overlapping test declarations increase maintenance effort.
Reason: The maintainer-authored direction is established, and consolidating fixtures has value when distinct contracts remain intact.

Merge readiness

⛔ Needs changes before merge - 3 items remain

Keep open: this maintainer-directed test cleanup has value, but an introduced assertion fails CI and GitHub reports conflicts.

Priority: P3
Reviewed head: 4e19c45583c2ac6d3498edef0ecb153bb5ab5202

Before merge

  • [P2] Preserve partial matching for nested approval parameters (P2) - The normal approval path passes the complete sideRunParams object, including config, model, and hostCapabilities. The outer expect.objectContaining does not recursively turn the plain paramsForRun object into a partial matcher, so this assertion now requires that nested object to contain exactly the two listed fields. The reviewed-head CI annotation confirms the resulting failure. Wrap paramsForRun in expect.objectContaining or restore the previous toMatchObject assertion while checking the call count separately.
  • Complete next step - Resolve the GitHub-reported conflicts while preserving current-main test cases.
  • Explain or restore the original intent of Approval payload assertion semantics - cb4d035: The retained test checks relevant approval metadata without requiring the complete runtime parameter object to contain only those fields.

Findings

  • [P2] [P2] Preserve partial matching for nested approval parameters — extensions/codex/src/app-server/side-question.test.ts:1278

Provenance

  • Approval payload assertion semantics changes intended behavior without addressing why it exists (cb4d035: The retained test checks relevant approval metadata without requiring the complete runtime parameter object to contain only those fields.)
Agent review details

How this fits together

These suites exercise runtime and plugin owners using synthetic requests, transport fixtures, and lifecycle events, producing assertions and CI results.

flowchart LR
  A[Test scenarios] --> B[Shared fixtures]
  B --> C[Runtime and plugin owners]
  C --> D[Transport and state fixtures]
  D --> E[Assertions]
  E --> F[CI results]
Loading

Technical review

Best possible solution:

Preserve the consolidation while restoring recursive partial matching for approval metadata.

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

The reviewed-head CI annotation records the failing approval assertion, and the introduced matcher change explains its failure.

Is this the best way to solve the issue?

Shared fixtures and scenario tables are appropriate, but their assertions must retain the original matching semantics.

Full review comments:

  • [P2] [P2] Preserve partial matching for nested approval parameters — extensions/codex/src/app-server/side-question.test.ts:1278
    The normal approval path passes the complete sideRunParams object, including config, model, and hostCapabilities. The outer expect.objectContaining does not recursively turn the plain paramsForRun object into a partial matcher, so this assertion now requires that nested object to contain exactly the two listed fields. The reviewed-head CI annotation confirms the resulting failure. Wrap paramsForRun in expect.objectContaining or restore the previous toMatchObject assertion while checking the call count separately.
    Confidence: 1

Overall correctness: patch is incorrect
Overall confidence: 0.94

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Codex side-thread approval forwarding keeps the original intent (69a0c92: The original change ensured side-thread command approvals reach the active native relay policy surface.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

Acceptance criteria:

  • pnpm test extensions/codex/src/app-server/side-question.test.ts --maxWorkers=1
  • git diff --check
  • Verify the repaired-head checks-node-changed-extensions-bundle-1 result and classify remaining failed checks.

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit cb4d035 adds extensions/codex/src/app-server/side-question.test.ts:2039 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: cb4d0357c84e; files: extensions/codex/src/app-server/side-question.test.ts)
  • Kaspre: Raw commit 69a0c92 adds extensions/codex/src/app-server/side-question.test.ts:509 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: medium; commits: 69a0c925b890; files: extensions/codex/src/app-server/side-question.test.ts)

PR surface

Tests -4094. Total -4094 across 62 files. Added test files: 2.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 62 8045 12139 -4094
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 62 8045 12139 -4094

Review metrics

Metric Value Why it matters
Production versus test LOC Production +0/-0; tests and fixtures +10,625/-15,564, net -4,939. The reduction is confined to test maintenance; preserving the assertions remains necessary.

Labels

Label changes:

  • add P3: This is test-only maintenance with no production 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-only maintenance with no production 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 20, 2026, 3:56 AM ET / 07:56 UTC.

@steipete
steipete force-pushed the tcr/land-d308-1792481540 branch from 4e19c45 to f340f5f Compare October 20, 2026 08:00
@steipete
steipete enabled auto-merge (squash) October 20, 2026 08:00
@steipete
steipete disabled auto-merge October 20, 2026 08:06
@steipete
steipete enabled auto-merge (squash) October 20, 2026 08:18
@steipete
steipete merged commit 539937d into main Oct 20, 2026
128 checks passed
@steipete
steipete deleted the tcr/land-d308-1792481540 branch October 20, 2026 08:45
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 21, 2026
* test(launcher): deslop z0054 tests

* test(launcher): deslop z0054 tests

* test(launcher): deslop z0054 tests

* test(codex): deslop z0055 tests

* test(codex): deslop z0055 tests

* test(codex): deslop z0055 tests

* test(codex): deslop z0056 tests

* test(codex): deslop z0056 tests

* test(codex): deslop z0056 tests

* test(cli-runner): deslop z0057 tests

* test(cli-runner): deslop z0057 tests

* test(cli-runner): deslop z0057 tests

* test(sessions): deslop z0058 tests

* test(sessions): deslop z0058 tests

* test(sessions): deslop z0058 tests

* test(auto-reply): deslop z0050 tests

* test(auto-reply): deslop z0050 tests

* test(auto-reply): deslop z0050 tests

* test(chat): deslop z0059 tests

* test(chat): deslop z0059 tests

* test(chat): deslop z0059 tests

* test(gateway): deslop z0063 tests

* test(gateway): deslop z0063 tests

* test(gateway): deslop z0063 tests

* test(matrix): deslop z0060 tests

* test(matrix): deslop z0060 tests

* test(matrix): deslop z0060 tests

* test(anthropic): deslop z0062 tests

* test: preserve batch d308 contracts and repair CI fixtures

* test: use dispatcher completion directly in finalization cases

* test(codex): keep derived failure flags boolean without casts

* test(gateway): preserve lazy wait-listener initialization

* test: classify preparation fixtures as test support
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: matrix Channel integration: matrix extensions: anthropic extensions: codex 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