Skip to content

test(gateway,agents,ui): remove low-value tests (batch d020) - #167300

Merged
steipete merged 12 commits into
mainfrom
tcr/land-d020-1791470875
Oct 8, 2026
Merged

steipete merged 12 commits into
mainfrom
tcr/land-d020-1791470875

Conversation

@steipete

@steipete steipete commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

What Problem This Solves

This maintainer-requested test-reduction batch removes redundant test variants and duplicate file-level setup across setup, Gateway, web fetch, native harness, auto-reply, state, plugin settings, Doctor, and authentication tests.

User Impact

No user-visible or runtime production behavior changes. Remaining tests preserve distinct authority, lifecycle, ordering, and regression coverage. Tests lose 3,107 lines net (+4,117 / -7,224); test inventories and shrink-only baselines lose another 11 lines. Runtime production LOC: +0 / -0.

Why This Change Was Made

Batch d020 replays ten already-validated campaign shards onto current main. All ten patches initially applied unchanged (stable patch IDs match), with no conflicts or skipped commits. Review retained five existing cases: Guardian endpoint rejection before thread creation, explicitly disabled required-root tools, reverse-order catalog install intent, unapplied runtime-failure handling, and partial uninstall failure after inventory disappearance. These are the only dropped deletion hunks; no production changes were introduced. Nineteen deleted test files are consolidated into existing owner suites or have redundant coverage removed; obsolete routing entries are removed with them. The two baseline edits only remove entries.

The original shard runs measured covered statements and branches before and after each reduction; every loss remained below 1%. These are original in-shard coverage results, not a fresh coverage measurement of the combined replay. No shard reached the campaign's 30% declaration-reduction target: the retained contracts took priority over that target. Some nested-project case-coverage probes used the campaign's documented fallback; aggregate coverage and focused tests still ran.

No changed path matches the current CODEOWNERS rules.

Evidence

  • All ten source commits initially replayed without conflicts; stable patch IDs matched. Review retained five existing cases: Guardian endpoint refusal before thread creation, explicitly disabled required-root host tools, reverse-order catalog install requests, unapplied runtime-failure handling, and partial-uninstall failure after inventory disappearance.
  • Local frozen dependency installation, targeted Oxfmt, plain Oxlint on changed TS/JS files, and git diff --check: passed.
  • Original shard focused tests and coverage: passed; exact original coverage totals are below. Several shard-wide changed checks reported then-existing baseline defects; those historical failures are not being used to qualify current CI.
  • Fresh remote validation gap: Blacksmith Testbox tbx_01m4dzy9wb6b24b15ae8fqcphy remained queued without a runner and was stopped before incorporating the first review fix. AWS fallback cbx_f2fb2d55f42f reached a sync-quiet watchdog; that source transfer was stopped when review required further changes. Its result recorded commandMs: 0; no test or changed-check payload executed. Both leases were stopped. The final focused tests and changed-check gate therefore remain unverified remotely at publication. This batch uses the campaign's infrastructure-gap allowance; hosted CI is the merge gate.
  • Intended fresh commands: CI=1 pnpm test <49 retained changed test paths> test/scripts/ci-proof-test-inventory.test.ts, followed by OPENCLAW_TESTBOX=1 OPENCLAW_CHECK_CHANGED_REMOTE_CHILD=1 CI=1 node scripts/check-changed.mjs -- <all changed paths> on the remote candidate.

Review dispositions: retained the five cases above. Managed-hook refusal remains covered through real startup in run-attempt-native-process-authority.test.ts; ACP-shaped keys without current metadata remain covered through real sessionsCommand in sessions.acp-model-display.test.ts. The removed memory-audience fixture stripped its fabricated audience before delegation and only asserted mocked argument forwarding; real host-bound currency checks remain in hook-context.test.ts and provider audience tests.

Additional review dispositions: ambient expiry retained refresh material and reached the same planner state; unavailable-profile ambient denial stays in provider-model-route-auth.test.ts. Adopted failure notices use the normal final-delivery suppression, covered by the send-policy and message-tool-only dispatch suites. Structural SQLite corruption refusal and byte preservation remain in sqlite-index-corruption.test.ts and CHECK classification in sqlite-integrity.test.ts. ACP disposal uses the shared shutdown-step warning/continuation owner, retained through cron and subsystem failures; ACP-specific ordering remains tested. Icon retries remain in the icon-loader and credential-ordering owners. Publication before result application and retry after enable failure remain covered by the shared mutation owner and browser runtime tests. The partial-uninstall failure row was retained because its error must survive the disappearance of the plugin row and selected local detail route.

The final restoration diff passed independent autoreview at P2; all accepted findings are addressed, and the rejected findings are explained above.

Per-shard files, test LOC/declaration deltas, and original coverage totals
Shard Test LOC added / deleted (net) Declarations before -> after
w1190 +90 / -241 (-151) 48 -> 46 (-2)
w1182 +815 / -1202 (-387) 49 -> 40 (-9)
w1188 +286 / -667 (-381) 48 -> 37 (-11)
w1184 +370 / -588 (-218) 49 -> 45 (-4)
w1185 +392 / -539 (-147) 48 -> 45 (-3)
w1187 +711 / -1028 (-317) 48 -> 44 (-4)
w1191 +588 / -1099 (-511) 48 -> 41 (-7)
w1186 +515 / -1011 (-496) 49 -> 43 (-6)
w1183 +130 / -491 (-361) 49 -> 37 (-12)
w1195 +220 / -358 (-138) 46 -> 44 (-2)

w1190

covered statements 1218 -> 1218 (0); branches 821 -> 821 (0); functions 236 -> 236 (0)

Files touched: src/wizard/setup.inference-recovery.integration.test.ts, src/wizard/setup.migration-transaction.test.ts, src/wizard/setup.test.ts, src/wizard/setup.workspace-validation.test.ts.

w1182

covered statements 2104 -> 2104 (0); branches 1327 -> 1327 (0); functions 301 -> 301 (0)

Files touched: scripts/lib/ci-proof-test-inventory.mts, src/gateway/conversation-list.test.ts, src/gateway/conversation-list.worker-read.test.ts, src/gateway/session-sharing-preparation.admission.test.ts, src/gateway/session-sharing-preparation.creation-settlement.test.ts, src/gateway/session-sharing-preparation.test.ts, src/gateway/session-utils-model.acp-owner.test.ts, src/gateway/session-utils-model.identity.test.ts, src/gateway/session-utils-model.thinking-default.test.ts, test/vitest/vitest.gateway-server-paths.mjs.

w1188

covered statements 588 -> 588 (0); branches 328 -> 328 (0); functions 77 -> 77 (0)

Files touched: config/test-mock-exports-baseline.txt, src/agents/tools/web-fetch.cache.test.ts, src/agents/tools/web-fetch.cf-markdown.test.ts, src/agents/tools/web-fetch.headers.test.ts, src/agents/tools/web-fetch.provider-fallback.test.ts, src/agents/tools/web-fetch.signal.test.ts, src/agents/tools/web-fetch.ssrf.test.ts.

w1184 (landed counts include the restored endpoint admission test; coverage below is from the original shard reduction)

covered statements 12400 -> 12340 (-60); branches 9767 -> 9700 (-67); functions 2383 -> 2374 (-9)

Files touched: extensions/codex/src/app-server/run-attempt.fork-provenance.test.ts, extensions/codex/src/app-server/run-attempt.hooks.test.ts, extensions/codex/src/app-server/run-attempt.input-attachments.test.ts, extensions/codex/src/app-server/run-attempt.native-config.test.ts, extensions/codex/src/app-server/run-attempt.native-hook-fallback.test.ts, extensions/codex/src/app-server/run-attempt.native-hook-relay.test.ts, extensions/codex/src/app-server/run-attempt.notification-burst.test.ts, extensions/codex/src/app-server/run-attempt.prompt-hook-audience.test.ts, extensions/codex/src/app-server/run-attempt.protocol-validation.test.ts, test/vitest/vitest.extension-database-workers-paths.mjs.

w1185

covered statements 3937 -> 3936 (-1); branches 2814 -> 2813 (-1); functions 797 -> 797 (0)

Files touched: src/auto-reply/reply/dispatch-from-config.restart-tombstone.test.ts, src/auto-reply/reply/dispatch-from-config.source-completion.test.ts, src/auto-reply/reply/dispatch-from-config.terminal-recovery.test.ts, src/auto-reply/reply/dispatch-from-config.tts-stream.test.ts, src/auto-reply/reply/dispatch-from-config.turn-model-selection-differential.test.ts.

w1187

covered statements 3276 -> 3276 (0); branches 1633 -> 1633 (0); functions 647 -> 647 (0)

Files touched: src/state/openclaw-state-lease-heartbeat.activation.test.ts, src/state/openclaw-state-lease-heartbeat.diagnostics.test.ts, src/state/openclaw-state-lease-heartbeat.lifetime.test.ts, src/state/openclaw-state-lease-heartbeat.startup.test.ts, src/state/openclaw-state-lease-heartbeat.test.ts, src/state/openclaw-state-read-worker.mcp.test.ts, src/state/openclaw-state-read-worker.settlement.test.ts, src/state/openclaw-state-read-worker.test.ts, test/vitest/vitest.database-worker-core-paths.mjs.

w1191 (landed counts include retained install-intent and failure cases; original coverage totals follow)

covered statements 4241 -> 4233 (-8); branches 3198 -> 3181 (-17); functions 924 -> 922 (-2)

Files touched: ui/src/pages/plugins/plugins-page.generations.test.ts, ui/src/pages/plugins/plugins-page.icon-loading.test.ts, ui/src/pages/plugins/plugins-page.icons.test.ts, ui/src/pages/plugins/plugins-page.mcp-auth.test.ts, ui/src/pages/plugins/plugins-page.persisted-install.test.ts, ui/src/pages/plugins/plugins-page.routing.test.ts, ui/src/pages/plugins/plugins-page.runtime.test.ts, ui/src/pages/plugins/plugins-page.schema.test.ts, ui/src/pages/plugins/plugins-page.settings-navigation.test.ts, ui/src/pages/plugins/plugins-page.test.ts.

w1186

covered statements 2956 -> 2956 (0); branches 1846 -> 1846 (0); functions 560 -> 560 (0)

Files touched: src/commands/doctor-maintenance.admission-freshness.test.ts, src/commands/doctor-maintenance.admission-warm.test.ts, src/commands/doctor-maintenance.database-writes.test.ts, src/commands/doctor-maintenance.finish-revalidation.test.ts, src/commands/doctor-maintenance.foreground-update.test.ts, src/commands/doctor-maintenance.installation.test.ts, src/commands/doctor-maintenance.native-identity.test.ts, src/commands/doctor-maintenance.readiness.test.ts, src/commands/doctor-maintenance.schema-preflight.test.ts, src/commands/doctor-maintenance.service-identity.test.ts, src/commands/doctor-maintenance.service-inspection.test.ts, src/commands/doctor-maintenance.serving-owner.test.ts.

w1183

covered statements 2452 -> 2436 (-16); branches 2110 -> 2097 (-13); functions 471 -> 469 (-2)

Files touched: config/max-lines-baseline.txt, src/agents/runtime-plan/prepare-auth.ambient-credential.test.ts, src/agents/runtime-plan/prepare-auth.metadata.test.ts, src/agents/runtime-plan/prepare-auth.route-intent.test.ts, src/agents/runtime-plan/prepare-auth.test.ts.

w1195

covered statements 10818 -> 10821 (+3); branches 5499 -> 5501 (+2); functions unchanged

Files touched: src/gateway/server-close.plugin-failure.test.ts, src/gateway/server-close.test.ts.

@clawsweeper

clawsweeper Bot commented Oct 8, 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 8, 2026 15:30
@openclaw-barnacle openclaw-barnacle Bot added app: web-ui App: web-ui gateway Gateway runtime scripts Repository scripts commands Command implementations agents Agent runtime and tooling extensions: codex size: XL labels Oct 8, 2026
@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: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Oct 8, 2026
@clawsweeper

clawsweeper Bot commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed October 8, 2026, 11:38 AM ET / 15:38 UTC.

ClawSweeper review

What this changes

This PR consolidates test suites, removes redundant variants, and updates test inventories and shrink-only baselines.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) Useful test consolidation with no concrete defect found, supported by historical shard validation rather than completed combined-head execution.
Proof confidence 🦐 gold shrimp (3/6) Not applicable: This maintainer-sponsored test-only PR changes no production owner or user-visible behavior, so contributor runtime proof is not required. Historical shard tests support the cleanup, but do not establish final combined execution; no stored-data contract changes.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Test only · Worth it: Yes
Reason: The approved campaign reduces repeated test setup and redundant variants while retaining meaningful contracts. Existing area history supports this maintenance direction.

Merge readiness

⛔ Blocked before merge - 1 item remains

Keep open: this is useful, maintainer-sponsored test cleanup that remains distinct from current main. Source review found no concrete blocking defect; final-head execution evidence remains limited.

Priority: P3
Reviewed head: fe2fcf19fc2ed53eac3cd5ddd528625de3ca0868

Before merge

  • Resolve review confidence - ClawSweeper must reach high confidence before merge readiness is known.

Findings

None.

Provenance

  • src/wizard/setup tests: original intent not found (unknown: Available file history shows subsequent roster and fixture changes, but incomplete historical object availability prevented establishing the introduction of every removed setup variant.)
Agent review details

How this fits together

OpenClaw's automated tests exercise agent execution, Gateway lifecycle, state storage, setup, and plugin settings. Test inventories assign these suites to CI lanes, which report whether the covered contracts still hold.

flowchart TD
  A[Agent and Gateway contracts] --> C[Retained test suites]
  B[Setup and plugin settings contracts] --> C
  C --> D[Test inventory and lane selection]
  D --> E[CI execution]
  E --> F[Regression results]
Loading

Technical review

Best possible solution:

Keep distinct regressions in their existing owner suites and use the normal exact-head CI gate to validate the combined cleanup.

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

Not applicable: this PR addresses duplicate test maintenance rather than a reported runtime defect.

Is this the best way to solve the issue?

Yes: consolidating cases into existing suites and retiring obsolete routing is an appropriate approach; source inspection found no concrete introduced failure.

AGENTS.md: found and applied where relevant.

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

Provenance checked

Testing

Proof path: in-process harness. Added test files: 49.

Security

None.

Evidence

What I checked:

  • Pinned scope and clean checkout: The introduced delta changes tests, test inventories, and shrinking baselines; runtime production code is unchanged. Read-only diff checking passed and the checkout remained clean. (fe2fcf19fc2e)
  • Maintainer authority verified: GitHub reports repository admin permission for steipete, resolving the inconsistent author-association values in the supplied context. The PR body describes a maintainer-requested campaign.
  • Distinct recovery coverage retained: The source-completion scenarios moved into the TTS-stream suite, including ambiguous delivery, final-only media, failed suffix recovery, and concurrent fragment preparation. (src/auto-reply/reply/dispatch-from-config.tts-stream.test.ts:146, fe2fcf19fc2e)
  • Authority and lifecycle cases retained: Sharing admission still covers metadata changes, reset ABA, unknown invalidation, and retirement; the heartbeat suite retains real worker-write rollback when caller authority is revoked before commit. (src/state/openclaw-state-lease-heartbeat.test.ts:431, fe2fcf19fc2e)
  • Test routing cutover: Deleted-suite routing entries are removed, while the retained protocol-validation, heartbeat, source-completion, and model-projection owners remain registered. (scripts/lib/ci-proof-test-inventory.mts:3039, fe2fcf19fc2e)
  • Current-main distinction and merge composition: Among the reviewed paths, main's changes since the introduction base affect the separate scheduled-app-authority files. The recorded test merge has the exact supplied base and head parents; base-only runtime changes are not PR deletions. (cf1479b22c2c)

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Patrick Erichsen: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

PR surface

Tests -3113, Other -5. Total -3118 across 74 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 71 4100 7213 -3113
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 3 0 5 -5
Total 74 4100 7218 -3118

Labels

Label changes:

  • add P3: This is test-maintenance cleanup with no runtime behavior, configuration, or public-contract change.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Label justifications:

  • P3: This is test-maintenance cleanup with no runtime behavior, configuration, or public-contract change.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

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 need explicit maintainer commands such as @clawsweeper autofix or @clawsweeper automerge.

@steipete
steipete merged commit 27f2f43 into main Oct 8, 2026
155 of 160 checks passed
@steipete
steipete deleted the tcr/land-d020-1791470875 branch October 8, 2026 15:50
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 9, 2026
…w#167300)

* test(wizard): deslop w1190 tests

* test(gateway): deslop w1182 tests

* test(web-fetch): deslop w1188 tests

* test(codex): deslop w1184 tests

* test(auto-reply): deslop w1185 tests

* test(state): deslop w1187 tests

* test(ui): deslop w1191 tests

* test(doctor): deslop w1186 tests

* test(agents): deslop w1183 tests

* test(gateway): deslop w1195 tests

* test(codex): retain reviewer endpoint admission boundary

* test: retain independent authority and recovery cases
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 commands Command implementations extensions: codex 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. scripts Repository scripts size: XL status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant