Repository navigation
test(agents,gateway,plugins): remove low-value tests (batch d224) - #165945
Conversation
Remove 26 declarations and 27 expanded cases without folding. Consolidate orphan recovery into the ordering suite and retain authority, lifecycle-race, and regression coverage. All 98 retained cases and check-changed pass. Covered statements decrease 0.18% and branches 0.40% from the repaired baseline.
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. Reviewed October 6, 2026, 12:43 AM ET / 04:43 UTC. ClawSweeper reviewWhat this changesThe PR removes redundant agent, Gateway session, and plugin installer tests, consolidates retained cases, and updates the CI test inventory. Merge readiness✅ Ready for maintainer review Keep open: this is a useful test-reduction batch, and the reviewed diff introduces no concrete blocking defect. Related merged work supplies fixture repairs rather than superseding this cleanup. Priority: P3 Review scores
Verification
How this fits togetherThese suites validate agent prompt preparation, Gateway session lifecycle operations, and plugin installation. Test fixtures exercise those owners, while the CI inventory determines which retained suites run. flowchart TD
A[Test fixtures] --> B[Agent prompt preparation]
A --> C[Gateway session lifecycle]
A --> D[Plugin installation]
B --> E[Behavior assertions]
C --> E
D --> E
F[CI test inventory] --> E
Before mergeNone. Agent review detailsSecurityNone. PR surfaceTests -2608, Other -1. Total -2609 across 25 files. View PR surface stats
Review metricsNone. Technical reviewBest possible solution: Retain the consolidated suites and their distinct lifecycle, recovery, integrity, and rollback assertions while reducing redundant fixture work. Do we have a high-confidence way to reproduce the issue? Not applicable: this is test cleanup, and no introduced behavioral failure was established by source review. Is this the best way to solve the issue? Yes: consolidation and removal of redundant cases are a maintainable approach, with retained boundary assertions and no runtime implementation changes. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against a6d546de7f5b. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
…enclaw#165945) * test(plugins): deslop w0124 tests * test(agents): deslop w0118 tests * test(gateway): deslop w0122 tests Remove 26 declarations and 27 expanded cases without folding. Consolidate orphan recovery into the ordering suite and retain authority, lifecycle-race, and regression coverage. All 98 retained cases and check-changed pass. Covered statements decrease 0.18% and branches 0.40% from the repaired baseline. * test(gateway): deslop w0126 tests
… (review feedback) ClawSweeper [P1] "Preserve creation for existing unsupported thinking settings": with a saved subagent thinking level (e.g. `high`) and an off-only child, the visible spawn path skipped the capability clamp and forwarded `high` explicitly. `sessions.create` rejects an explicit level the prepared catalog does not support, so creation failed with INVALID_REQUEST where the shipped visible path (which omitted the field) created the child. Visible spawns already reject per-call `thinking`, so the candidate level is always a saved subagent/agent default or the caller's inherited level, never an explicit request. Both are now clamped through the same prepared-catalog, runtime-row-aware path that inherited levels used. An unreadable catalog still omits the field. The clamp moves to sessions-spawn-visible-thinking.ts so sessions-spawn-visible.ts stays under its max-lines cap. Regression: server.sessions.agent-model-catalog.test.ts drives the real visible spawn into the real sessions.create handler with saved subagent thinking `high` and an off-only child. It asserts the child is created and persists `off`, and probes the same handler with the unclamped `high` to show INVALID_REQUEST. With the production fix reverted, only this case fails, with the real Gateway rejection. Also repairs branch-owned tests broken by recent main merges and the line-cap ratchet: - restore the gateway test's real prepareModelChoice (vi.mock now spreads the original module, pruning its now-obsolete mock-export baseline entry) and stop pinning the harness-owned Ultra suggestion list; - declare loadModelCatalog on SessionsSpawnToolOptions (it already flowed through createSessionsSpawnTool) and move tests off retired agents.list; - drop a test main deleted in openclaw#165945 that a merge resurrected; - move the branch's visible-thinking, visible worktree-fork, and visible-child projection tests into sibling files so no over-cap test file grows; - remove the review's flagged low-value tests (mock-manufactured rejection, duplicate off-only replay, snapshot-shape runtime-row replays). Refs: openclaw#137435 Beads: openclaw-cy3n Co-Authored-By: Claude <[email protected]>
What Problem This Solves
The plugin installer, embedded agent runner, and Gateway session suites repeat contracts already covered at stronger boundaries, increasing test maintenance and execution cost.
User Impact
No user-visible behavior change. This is the explicitly requested d224 test-reduction batch; runtime production code is unchanged. Distinct security, run-authority, recovery-order, lifecycle-race, and regression coverage remains.
Why This Change Was Made
Remove redundant fixture variants and helper projections, retain the cache-continuity test in the context-injection suite, and move the unchanged six-case orphan-recovery table into the recovery-order suite. Remove its retired test filename from the CI proof inventory.
The replay is based on
3c66417c08e3d96ab14930262aa3cd47feaa42ac. Four cleanup commits were applied with their original messages:6da37dffb878,6e61a01728f8,98903d78973e, and1e4527712289.Six fixture repairs were omitted because current main already carries the repair or its replacement:
71c8434ef379: main'scbe3ff13b844(refactor(runtime): deslop unused internal options #165198) explicitly verifies that staged installs leave success emission to the publishing caller. Kept that current test rather than replacing it with the campaign's publication-path variant.4586521412c0:3cda99dcbe3c(fix(sessions): preserve user input during restart recovery #165502) already repairs retained-user-input fixtures and removes the obsolete local orphan marker. Kept main's current context-engine harness.75d8c94eb918:83f38b7a593f(refactor(agents): deslop CLI backends harness #165512) already uses the singular tool wrapper; the conflict differed only in the map parameter name. Kept main's version.52376b5ca48c:ddcae5101d78(perf(agents): carry prepared exec policy into delegate tool construction #165012) already supplies admitted tool-construction arguments; replay was empty.1e45cc0c382d:12785be2ff02(perf(sessions): bound transcript source reads #165221) already supplies paged transcript reader fixtures; replay was empty.b3dfdc6667d4:ddcae5101d78(perf(agents): carry prepared exec policy into delegate tool construction #165012) already awaits scoped tool preparation; replay was empty.The w0126 conflict was a duplicate bare-session-key test that main had simplified from a one-row table. Applied the intended deletion to the current form; preserved surrounding fixed-store ownership coverage. All other cleanup hunks applied without conflicts. No baseline files changed. None of the changed paths matches a current CODEOWNERS rule.
Shard scope and historical coverage evidence
These are the original in-shard measurements, not a new coverage measurement of the rebased branch. Every shard retained distinct cases instead of forcing a deletion quota; no cases were folded.
src/plugins/install.npm-spec.e2e.test.ts,install.npm-spec.test.ts,install.test.ts; supportinstall.npm-dependencies.test-support.ts,install.npm-spec.test-support.ts,update-npm-metadata.test-support.tssrc/agents/embedded-agent-runner/run/:attempt.spawn-workspace.cache-ttl.test.ts(deleted),attempt.spawn-workspace.context-engine.test.ts,attempt.spawn-workspace.context-injection.test.ts,attempt.subscription-cleanup.test.ts,attempt.test.ts,attempt.tool-search-run-plan.test.tssrc/gateway/:server.sessions.process-cleanup.test.ts,server.sessions.recover-orphan.test.ts(deleted),server.sessions.recovery-order.test.ts,server.sessions.reset-cleanup.test.ts,server.sessions.reset-concurrency.test.ts,server.sessions.reset-hooks.succession.test.ts,server.sessions.reset-hooks.test.ts,server.sessions.reset-models.test.ts,server.sessions.store-paths.test.ts,server.sessions.store-rpc.test.ts;scripts/lib/ci-proof-test-inventory.mtssrc/gateway/session-utils.test.ts,src/gateway/session-utils.subagent.test.tsExact original coverage totals:
covered statements 4682 -> 4682 (0); branches 3531 -> 3531 (0); functions 953 -> 953 (0).covered statements 13158 -> 13157 (-1); branches 8641 -> 8642 (1); functions 2464 -> 2463 (-1).covered statements 17792 -> 17760 (-32); branches 10784 -> 10741 (-43); functions 3305 -> 3298 (-7).covered statements 3329 -> 3329 (0); branches 2578 -> 2578 (0); functions 592 -> 592 (0).Qualification: w0124's comparable coverage excludes four originally failing plugin-config files (
install.archive-dependencies.test.ts,install.path.test.ts,install.test.ts,install.work-deadline.test.ts); it establishes zero loss for comparable npm/E2E groups, not complete zero loss across the full shard. All 124 final shard tests passed. w0122 drops 0.18% covered statements and 0.40% covered branches; five selected archive-owner cases also passed. w0118's historical default changed-check encountered inherited line-cap debt, while checks against its supplied shard base passed. Fresh replay validation is reported separately below.Final replay numstat across 25 paths: tests +367/−2,923, test support +46/−98, test tooling +0/−1, runtime production +0/−0; total +413/−3,022, net −2,609 lines.
Evidence
oxfmt --writeon all changed existing files, plainoxlint -c .oxlintrc.jsonon changed TS/MTS files, andgit diff --check: passed.69fbea2c31ff79b193431950b7bf511eae06db7a: 452 tests passed across 20 files / 7 Vitest shards, includinginstall.npm-spec.e2e.test.tsand the additional installer-update owner suite. Command:CI=1 pnpm install --frozen-lockfile --prefer-offline && CI=1 pnpm test <all changed surviving test files> src/plugins/update.test.ts. Remote command 924.1 seconds, including cold preparation/build; Vitest group durations totaled 210.4 seconds. Leasetbx_01m47pqcczxz13cnzzr9a4axkn, Testbox run, exit 0. The external runner portal-sync warning occurred after successful execution and did not affect the result.OPENCLAW_TESTBOX=1 node scripts/check-changed.mjs -- <all 25 changed paths>: dry-run classified core-test/script/tooling lanes. At publication, execution is blocked on Blacksmith allocation: leasetbx_01m47qv4bqwtftwdxx445hrvysremains queued without a runner after nearly five minutes. No changed-check validation has executed or failed. This is an explicit infrastructure gap under the campaign arming rule; the required hosted CI gate remains the merge gate.