Skip to content

test(core): remove low-value tests (batch d420) - #180132

Merged
steipete merged 27 commits into
mainfrom
tcr/land-d420-1792631473
Oct 22, 2026
Merged

steipete merged 27 commits into
mainfrom
tcr/land-d420-1792631473

Conversation

@steipete

@steipete steipete commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Consolidates duplicated test setup, assertions, and sibling suites across Doctor, Gateway, wizard, plugins, infrastructure, agent sessions, and commands. This is test maintenance; there is no user-visible or production behavior change. Distinct authority, lifecycle, migration, transport, and recovery coverage is retained.

Replay and impact

Replayed 23 of the 30 requested commits onto pinned main 38f36ca1fbaac41ff95f48cee5a6c010a0f0cec2. Seven commits were skipped: two cross-file provider consolidations with missing fixture prerequisites, one already-empty import cleanup, and four dependent fixture/baseline follow-ups. Conflicting files retain current main rather than replacing newer tests with older campaign fixtures.

Production LOC: +0 / -0. Test/support LOC: +6302 / -9196 (net -2894). Test tooling/config: +0 / -30. No dependencies, public APIs, schemas, runtime settings, or release notes changed. No CODEOWNERS-listed paths are touched.

Evidence

  • Frozen-lockfile dependency installation passed.
  • Changed existing TS/JS files: direct oxfmt and plain oxlint both exited 0.
  • git diff --check against the pinned base passed.
  • Per the operator's CI-only rule: no local Vitest, check-changed, tsgo, coverage, or Testbox runs. No leases used. Runtime/type proof belongs to this PR's exact-head openclaw/ci-gate.
  • Source shard reports explicitly say tests and coverage were not run under CI-only mode. Therefore there are no in-shard measured coverage totals to claim. Static declaration deltas below are syntax counts, not executed test counts. No runtime speedup is claimed.
  • Independent autoreview completed: nine distinct boundary-coverage restorations accepted; six findings rejected after source verification. CI fixture/type repairs and subsequent reviews are recorded below.

Per-shard diff

Counts below describe the replayed diff, not the older full campaign report. Declaration delta counts added minus removed it/test declarations (including tables); table expansion is not estimated.

Shard Test/support LOC added / removed Declaration delta Coverage totals
y0290 +669 / -784 -2 Not measured (CI-only source report)
y0291 +178 / -369 -3 Not measured (CI-only source report)
y0293 +411 / -587 -1 Not measured (CI-only source report)
y0292 +421 / -780 -5 Not measured (CI-only source report)
y0294 +1039 / -1534 -11 Not measured (CI-only source report)
y0295 +1330 / -1884 -16 Not measured (CI-only source report)
y0296 +1307 / -1928 -6 Not measured (CI-only source report)
y0297 +876 / -1234 -9 Not measured (CI-only source report)
y0298 +71 / -106 +0 Not measured (CI-only source report)
Changed files by shard

y0290

scripts/lib/ci-proof-test-inventory.mts, src/commands/doctor-migration-backup.scoped.test.ts, src/commands/doctor-migration-backup.test.ts, src/commands/doctor-post-upgrade.test.ts, src/commands/doctor-sandbox.warns-sandbox-enabled-without-docker.test.ts, src/commands/doctor-session-canonical-keys.completions.test.ts, src/commands/doctor-session-canonical-keys.owner-repair.test.ts, src/commands/doctor-session-delivery-state.test.ts, src/commands/doctor-session-incognito-key-repair.test.ts, src/commands/doctor-session-snapshots.test.ts, test/vitest/vitest.database-worker-core-paths.mjs

y0291

src/gateway/server/event-loop-health.test.ts, src/gateway/server/hooks.wake-admission.test.ts, src/gateway/server/readiness.test.ts, src/gateway/server/ws-connection.serialized-json.test.ts, src/gateway/server/ws-connection.test.ts, src/gateway/server/ws-origin-policy.test.ts

y0293

config/test-mock-exports-baseline.txt, src/gateway/mcp-app-channel-action.test.ts, src/gateway/mcp-app-extension-runtime.test.ts, src/gateway/mcp-app-form-resources.test.ts, src/gateway/mcp-app-host-files.test.ts, src/gateway/mcp-app-sandbox-http.test.ts, src/gateway/mcp-app-standalone.test.ts, src/gateway/mcp-grant-store.test.ts, src/gateway/mcp-http.async-scope.test.ts, src/gateway/mcp-http.configured-mcp-authority.test.ts, src/gateway/mcp-http.exec-completion.test.ts, src/gateway/mcp-http.keepalive.test.ts, src/gateway/mcp-http.question-authority.test.ts, src/gateway/mcp-http.test-support.ts

y0292

src/wizard/navigation-prompter.test.ts, src/wizard/session.test.ts, src/wizard/setup.app-recommendations.test.ts, src/wizard/setup.credentials.test-support.ts, src/wizard/setup.default-agent.test.ts, src/wizard/setup.inference-verification.test.ts, src/wizard/setup.migration-resources.test.ts, src/wizard/setup.migration-stage.test.ts, src/wizard/setup.migration-transaction.test.ts, src/wizard/setup.model-auth.test.ts, src/wizard/setup.plugin-config.test.ts, src/wizard/setup.test.ts, src/wizard/setup.workspace-validation.test.ts

y0294

src/plugins/activation-planner.test.ts, src/plugins/active-runtime-registry.test.ts, src/plugins/channel-catalog-registry.workspace.test.ts, src/plugins/channel-validation.test.ts, src/plugins/claw-managed-capability-consent.integration.test.ts, src/plugins/copy-bundled-plugin-metadata.test.ts, src/plugins/dashboard-capabilities.test.ts, src/plugins/enable.test.ts, src/plugins/gateway-startup-plugin-plan.acpx.test.ts, src/plugins/gateway-startup-plugin-providers.test.ts, src/plugins/interactive.test.ts, src/plugins/managed-npm-retention.test.ts, src/plugins/migration-provider-runtime.test.ts, src/plugins/openai-compatible-embedding-provider.integration.test.ts, src/plugins/payload-verification.test.ts, src/plugins/post-core-dependency-health.integration.test.ts, src/plugins/session-catalog-history-import.test.ts, src/plugins/session-catalog.test.ts, src/plugins/tools.inspection.test.ts, src/plugins/tools.onboarding.test.ts, src/plugins/trusted-approval-install.integration.test.ts, src/plugins/worker-provider-maintenance.test.ts, src/plugins/worker-provider-registry.test.ts

y0295

config/test-mock-exports-baseline.txt, src/infra/restart-coordinator.test.ts, src/infra/restart-handoff.test.ts, src/infra/restart-stale-pids.cwd.test.ts, src/infra/restart-stale-pids.escalation.test.ts, src/infra/restart-stale-pids.test.ts, src/infra/restart-suspension.test.ts, src/infra/restart.deferral-timeout.test.ts, src/infra/restart.test.ts, src/infra/worker-task-pool.cleanup.test.ts, src/infra/worker-task-pool.native-sections.test-support.ts, src/infra/worker-task-pool.owned.test-support.ts, src/infra/worker-task-pool.owned.test.ts, src/infra/worker-task-pool.preparation.test.ts, src/infra/worker-task-pool.retirement-failure.test.ts, src/infra/worker-task-pool.test-support.ts, src/infra/worker-task-server.test.ts, test/vitest/vitest.database-worker-core-paths.mjs

y0296

scripts/lib/ci-proof-test-inventory.mts, src/agents/sessions/agent-session-code-mode-source.test.ts, src/agents/sessions/agent-session-compaction.admission.test.ts, src/agents/sessions/agent-session-compaction.degraded-reload.test.ts, src/agents/sessions/agent-session-compaction.provider-boundary.test.ts, src/agents/sessions/agent-session-compaction.test.ts, src/agents/sessions/agent-session-extension-dispatch.test.ts, src/agents/sessions/agent-session-handoff-adoption.integration.test.ts, src/agents/sessions/agent-session-loop-correctness.test-support.ts, src/agents/sessions/agent-session-loop-correctness.test.ts, src/agents/sessions/agent-session-loop-next-turn.test.ts, src/agents/sessions/agent-session-models.admission.test.ts, src/agents/sessions/agent-session-models.notifications.test.ts, src/agents/sessions/agent-session-refusal-compaction.test.ts, src/agents/sessions/agent-session-responses-eof.test.ts, src/agents/sessions/agent-session-runtime-projection.test.ts, src/agents/sessions/agent-session-small-context-compaction.test.ts, src/agents/sessions/agent-session-steering-authority.test.ts, src/agents/sessions/agent-session-steering-context.test.ts, src/agents/sessions/agent-session-tool-source-fidelity.test.ts, src/agents/sessions/agent-session-transcript-worker.test.ts, test/vitest/vitest.database-worker-core-paths.mjs

y0297

config/test-mock-exports-baseline.txt, src/commands/agents.add.test.ts, src/commands/agents.commands.list.test.ts, src/commands/agents.identity.test.ts, src/commands/agents.providers.test.ts, src/commands/auth-choice.model-check.test.ts, src/commands/configure.gateway-auth.prompt-auth-config.test.ts, src/commands/sessions-cleanup.harness.test.ts, src/commands/sessions-cleanup.runtime.test.ts, src/commands/sessions-cleanup.test.ts, src/commands/sessions-compact.test.ts, src/commands/sessions-lifecycle.test.ts, src/commands/sessions-tail.test.ts, src/commands/sessions.default-agent-store.test.ts

y0298

src/commands/agent-exec.auth.test.ts, src/commands/agent.session.test.ts

Kept and dropped replay hunks

Pinned base: 38f36ca.

  • 0f86fd2: kept main's doctor-platform-notes.launchctl-env-overrides.test.ts; dropped that file's mockProcessPlatform migration because the source parent assumes prior fixture consolidation absent on main. Other 13 paths applied.
  • 3675f96: kept main's doctor-plugin-manifests.test.ts and doctor-schema-migrations.test.ts. Both hunks assume prior family consolidation absent on main; main also has newer UTF-8 regression protection. Other two paths applied.
  • 04e2880: skipped entire Codex commit. Conflicts span eight content files and two modify/delete files, with shared bridge/projector fixture prerequisites absent and newer retained runtime/source-reply coverage. Avoided partial cross-file fixture migration.
  • 4624b64: kept current hooks.agent-trust.test.ts, hooks.early-failure.test.ts, skill-library-read.test.ts, ws-connection.startup.test.ts. Conflicting fixture rewrites assume earlier source-only consolidations, while current main has distinct owner/runtime proof. Other eight files applied.

CI-only authority: no Vitest, tsgo, check-changed, Testbox, or coverage runs. Source reports contain static counts, not measured coverage.

  • 97cc902: skipped Google consolidation as one cross-file unit: seven content conflicts and finality modify/delete conflict, absent shared fixture prerequisites, plus current credential-destination and query/document distinction tests.
  • 209b196: empty on main (duplicate MCP imports already absent); skipped.
  • 4603267 and 20509e7: kept main's mcp-http.test.ts in both; prerequisite request/capture fixture changes absent, and preserved existing SSE assertions. Other paths applied, including keepalive/channel-action family moves and shrink-only baseline removals.
  • 51b4eb4: skipped shared MCP fixture migration; the cancellation/reconstruction suites retain direct HTTP setup absent from the source parent's shared fixture, and mcp-http prerequisites were dropped.
  • af1e49f: kept main's clack-prompter, setup.finalize, setup.finalize.trusted-proxy, setup.memory-import, setup.migration-import test files; all conflicts depend on source-only prior fixture/table consolidation. Other five files applied.
  • 43ab0dc: kept clack-prompter and setup.finalize; applied the other six files.
  • cee8a9e: kept clack-prompter, setup.finalize, setup.gateway-config, setup.memory-import; prerequisite fixture consolidation absent, preserving current auth/password and memory-consent assertions. Other paths applied.
  • e0d8757: kept stage-bundled-plugin-runtime.test.ts, including newer metadata-copy and Chrome-extension protections. Other eight paths applied.
  • 0e8f7f6: kept hook-runner-global.test.ts and its compose sibling together (no deletion without successful move); kept prune-docker-plugin-dist.test.ts with current keep-list proof. Other paths applied.
  • 067a512: kept stage-bundled-plugin-runtime.test.ts again; other 15 paths applied.
  • e0b2e38: kept worker-native-lifecycle.test-support.ts because source-only helper refactors are absent on main; retained its explicit native diagnostics/teardown assertions. Other 14 paths applied.
  • d9aee88: kept worker-cpu.test.ts and both source siblings (worker-message-metrics.test.ts, worker-native-task-port.test.ts) because the CPU fixture family differs and current metrics tests changed. Restart/stale-PID/suspension and pool preparation moves applied; relevant shrink-only baseline/inventory removals retained.
  • 540500f: kept worker-cpu.test.ts and worker-native-lifecycle.test-support.ts again; follow-up depends on the dropped fixture changes. Other paths applied.
  • ea17623: kept small-context-compaction and its headroom source sibling together, preserving newer pending-user budget and 32K compaction regressions. Other family moves and matching inventory removals applied.
  • dc07e2c: kept small-context-compaction again; other shared session fixtures/assertions applied.
  • f7a73be: kept auth-choice.test.ts with current mocks; the source parent's table/fixture consolidation is absent. Other paths applied.
  • f891e2a: kept auth-choice.apply.plugin-provider.test.ts plus both source suites (api-providers and preferred-provider), restoring their exact existing baseline/inventory entries. Other family consolidations applied.
  • f2a1c40: kept auth-choice.apply.plugin-provider.test.ts again; other owner-proof changes applied.
  • edbebda: kept channels.config-only-status-output.test.ts and channels.status.command-flow.test.ts together, preserving main's modified status cases rather than partially moving coverage. The three agent command files applied.
  • e57eef3: skipped the channel-account/triage shared-family commit. It deletes helpers still required by the conflicting current channels.remove test, and current triage.test has newer changes; preserving each full family avoids a partial fixture cutover.
  • 5b800d8: skipped follow-up baseline pruning tied to the retained channel/triage files; no new allowances introduced.
  • dea2fc6: skipped comment-only follow-up because its new channel-account helper was not introduced (e57eef3 skipped).

Review and CI repairs

Nine review findings accepted: restored direct-local isolation and SQLite audit flush; agent_settled ordering; post-catalog app authorization; bad-token wake admission; plugin read-only route scopes; clean worker-exit recovery; forwarded plugin URLs; sensitive wizard input metadata.

Six findings rejected after source verification: thinkingLevel is already installed in SettingsManager by createTestSession; CLI bind tests retain conflicting-owner and duplicate checks; code-mode integrated tests own alias validation while session tests retain byte fidelity; concurrent real handoff consumers retain exactly-once/missing behavior; timeout native fixture mode had no test caller before this batch; upgraded plugin test retains successful rewritten-payload reapproval plus unapproved behavior.

First corrective review was scoped-clean. Initial CI exposed missing parent-fixture prerequisites even in cleanly applied hunks. Restored hook trust/terminal family, health-state suite, auth prompt/options family, provider fixture export, configure wizard family, restart sentinel/managed-handoff family, and native lifecycle test/runtime helper. Fixed narrow canonical types for model catalog registration, session catalog read callback, official repair hints, and wake body expectations; restored checked compaction event indexing. Added two mock-isolation rationales without new baseline allowances. No retries/timeouts/skips or weakened assertions used to get green.

The second corrective review was scoped-clean. Dropped the Doctor retired-model consolidation after CI exposed changed mock isolation; restored the main suite, both source siblings, and their original proof inventory entries. Dropped the Doctor session-entry metadata factoring because it incorrectly extended in-memory metadata assertions onto the canonical persisted read. Both families now match pinned main exactly.

Final corrective-delta review was also scoped-clean (P0-P2). Initial CI run 39706342237 supplied the fixture/type failures above; no local test reruns were performed. Direct oxfmt and plain oxlint passed on 105 changed TS/JS files, and git diff --check passed before the repair commit. Final runtime/type validation remains the exact-head hosted CI gate.

Second CI run 39708937876 exposed one incomplete restoration: the clean-exit capacity test was restored, but its fixture's exitCode input and process.exit path were still deleted. Restored those five original fixture lines, retaining the other dead fixture-path removals. CI reported both TS2353 for the missing input and the worker replying instead of exiting. Auto-merge was disabled during this repair.

Third CI run 39709900990 identified an output-only generic in connectPreparedCliTurn (typescript/no-unnecessary-type-parameters). Reused readMcpPayload and the shared McpToolResultPayload, adding its initialize instructions field and removing the duplicate local response type/generic invocation. Both runtime call paths are unchanged. Direct formatting, plain lint and diff checks passed.

The same run identified four awaits of the synchronous shared writeJsonFile helper and one redundant String conversion in plugin tests; removed these without changing assertions. Pruned exactly five CI-listed stale mock baseline entries: three restart entries, one activation-planner entry, and one migration-provider-runtime entry. The remaining restart/activation mocks have explicit isolation rationale; the other listed mocks no longer exist. No allowance was added.

All selected runtime test jobs passed on 06cee84; that head's remaining failures were the two lint stripes and mock-baseline ratchet repaired above. Both small repair reviews were scoped-clean. Final lint/baseline repair still requires its own hosted exact-head gate.

Fourth CI run 39711157424 passed all tests, typechecks and baseline ratchets. Its sole failed leaf was no-base-to-string: the shared MCP response needed the old local type's optional string text field. Added that field while keeping all other block fields unknown; no cast, filter or assertion weakening. Focused review is scoped-clean, and direct format/lint/diff checks passed. This final type-only repair requires its exact-head hosted gate.

@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 01:33
@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-22T02:58:00.258707Z c670de1 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 gateway Gateway runtime scripts Repository scripts commands Command implementations agents Agent runtime and tooling labels Oct 22, 2026

@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: cf66caacf8

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

const gatedRun = (fail = false) => {
const gate = createDeferred();
const started = createDeferred();
runAgent.mockImplementationOnce(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.

P1 Badge Rewire the moved terminal-target tests to existing helpers

These replacement tests cannot execute: this file declares runCronIsolatedAgentTurnMock, loadConfigMock, captureSessionEventTargetMock, and enqueueSessionEventMock, but the new block instead references undeclared runAgent, loadConfig, captureTarget, enqueueEvent, and waitForIdle; it also passes two arguments to the local one-argument dispatchAgentHook(payload) helper. Because this commit deletes hooks.terminal-target.test.ts, the intended replacement suite now fails before exercising any terminal-target behavior. Use the existing mocks, construct the expected hook payload, and await an actual completion signal.

Useful? React with 👍 / 👎.

@steipete
steipete disabled auto-merge October 22, 2026 01:41
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. 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 sibling suites across core subsystems without changing production behavior.

Example: A developer runs the hook terminal-target regression suite.

  • Before: The standalone suite uses its defined mocks and waits for terminal events.
  • After: The replacement suite fails with ReferenceError before exercising terminal-target behavior.

Review scores

Measure Result What it means
Overall readiness 🦪 silver shellfish (2/6) The maintenance direction is sound, but source-verified fixture defects and exact-head CI failures prevent a correctness pass.
Proof confidence 🌊 off-meta tidepool Not applicable: This maintainer-authored test-only consolidation changes no shipped product behavior; live product proof is not required.
Patch quality 🦪 silver shellfish (2/6) 9 actionable review findings remain.

Product

Kind: Test only · Worth it: Yes · Fix scope: Complete
Reason: The maintainer-approved direction reduces duplicated test maintenance without adding production machinery.

Merge readiness

⛔ Needs changes before merge - 9 items remain

Keep open: this maintainer-authored consolidation is useful, but incomplete fixture moves and changed expectations introduce concrete CI failures.

Priority: P2
Reviewed head: cf66caacf8b0454877cc27683fa549dcf500b8ae

Before merge

  • Wire the moved hook cases to the destination suite's helpers (P2) - The added block references undefined runAgent, loadConfig, captureTarget, enqueueEvent, waitForIdle, and completedRun, while this suite defines differently named mocks. It also calls the one-argument dispatchAgentHook helper with a string and a second argument. CI already fails all eight cases at loadConfig. Use the existing mocks, buildAgentPayload with the required overrides, and an actual completion signal so deleting the standalone suite preserves executable coverage.
  • Migrate every caller before removing the sentinel wrapper (P2) - Renaming withRestartSentinelStateDir leaves three retained calls in this file undefined. The analogous removal in restart-sentinel.update-result.test.ts also leaves its four recovery round-trip cases calling the deleted helper. CI records ReferenceError for both suites. Since beforeEach now supplies their shared state directory, unwrap the remaining calls consistently or retain the required wrapper.
  • Match the native lifecycle assertions to the actual fixture output (P2) - The replacement exact equality expects only ending, but the unchanged subprocess fixture still emits diagnostic fields for callback-context, explicit-unbound, terminate, natural-exit, and generation. All five otherwise successful scenarios consequently fail CI. Complete the output-contract change for those producers or retain expectations compatible with their output and the distinct lifecycle assertions.
  • Update the retained caller of the removed provider fixture (P2) - buildProviderWithDefaultModelPatch is removed, but the retained auth-choice.apply.plugin-provider.test.ts still imports it and calls it at line 380. CI reports that it is not a function. Migrate that caller to buildProvider with the equivalent configPatch result, or retain the helper until the caller moves; otherwise the default-model preservation regression cannot execute.
  • Keep stale event-loop data out of the replacement collector fixture (P2) - Assigning initial to pending.summary.eventLoop changes the collector fixture's result. When reset is true, getEventLoopHealth returns undefined and the unchanged production owner leaves collector fields intact, so the assertion expecting undefined now fails in both public and sensitive cases. The original collector returned no eventLoop field here. Preserve that fixture contract instead of injecting the stale sample.
  • Keep raw legacy metadata expectations separate from canonical reads (P2) - Spreading retainedMetadata into the canonical accessor expectation adds sessionFile, transcriptPath, and archivedBy requirements that the original test asserted only against raw persisted metadata. The canonical read does not return those fields, and CI fails at this assertion. Keep the raw preservation assertion and restrict the reopened accessor expectation to its existing canonical fields.
  • Preserve retirement-mock initialization for the moved successor cases (P2) - The new direct manifest-loader import occurs before the support module that registers its retirement metadata mock. The deleted successor suite initialized that fixture first and loaded the manifest loader afterward. The moved available, cooldown, and authoritative-cooldown cases now receive unchanged instead of the expected replacement in CI. Restore the original fixture initialization boundary so these cases exercise seeded retirement rules.
  • Preserve the provider picker's normalized detection input (P2) - Changing the detected ID from ollama to OLLAMA makes this case assert a new contract. The group builder normalizes IDs, but the picker compares normalized candidates against the supplied provider string, so Ollama is placed under More and lacks the detected label. CI confirms the root picker assertion fails. Keep the existing lowercase picker case and test builder normalization separately if that distinct coverage is needed.
  • Migrate the native-resource caller before requiring an edge (P2) - Making edge required leaves worker-native-lifecycle.test-support.ts calling runNativeResourceLifecycle(directory, serviceNativeUntil) with two arguments in its retained native-resource branch. That import closure no longer satisfies the function signature. Either preserve the optional argument or remove the retired branch together with the corresponding supported mode.

Findings

  • [P2] Wire the moved hook cases to the destination suite's helpers — src/gateway/server/hooks.agent-trust.test.ts:737-744
  • [P2] Migrate every caller before removing the sentinel wrapper — src/infra/restart-sentinel.test.ts:172-176
  • [P2] Match the native lifecycle assertions to the actual fixture output — src/infra/worker-native-lifecycle.test.ts:35-38

Provenance

  • Remaining consolidated test families: original intent not found (unknown: The supplied provenance is partial, and local blame encountered unavailable historical blobs; full introduction-level provenance remains unverified.)
Agent review details

How this fits together

Vitest suites use shared fixtures to exercise agent, Gateway, Doctor, plugin, and wizard owners; CI checks their assertions, types, and routing.

flowchart LR
  A[Test cases] --> B[Shared fixtures]
  B --> C[Production owners]
  C --> D[Observed results]
  D --> E[Assertions]
  E --> F[CI gates]
Loading

Technical review

Best possible solution:

Complete the fixture cutovers and preserve existing runtime contracts while retaining the useful suite consolidation.

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

This is test maintenance; source inspection and exact-head CI annotations establish the reported test failures without executing target code locally.

Is this the best way to solve the issue?

Consolidating existing owner suites is appropriate, but callers, fixture initialization, subprocess output, and assertions must migrate together.

Full review comments:

  • [P2] Wire the moved hook cases to the destination suite's helpers — src/gateway/server/hooks.agent-trust.test.ts:737-744
    The added block references undefined runAgent, loadConfig, captureTarget, enqueueEvent, waitForIdle, and completedRun, while this suite defines differently named mocks. It also calls the one-argument dispatchAgentHook helper with a string and a second argument. CI already fails all eight cases at loadConfig. Use the existing mocks, buildAgentPayload with the required overrides, and an actual completion signal so deleting the standalone suite preserves executable coverage.
    Confidence: 1
  • [P2] Migrate every caller before removing the sentinel wrapper — src/infra/restart-sentinel.test.ts:172-176
    Renaming withRestartSentinelStateDir leaves three retained calls in this file undefined. The analogous removal in restart-sentinel.update-result.test.ts also leaves its four recovery round-trip cases calling the deleted helper. CI records ReferenceError for both suites. Since beforeEach now supplies their shared state directory, unwrap the remaining calls consistently or retain the required wrapper.
    Confidence: 1
  • [P2] Match the native lifecycle assertions to the actual fixture output — src/infra/worker-native-lifecycle.test.ts:35-38
    The replacement exact equality expects only ending, but the unchanged subprocess fixture still emits diagnostic fields for callback-context, explicit-unbound, terminate, natural-exit, and generation. All five otherwise successful scenarios consequently fail CI. Complete the output-contract change for those producers or retain expectations compatible with their output and the distinct lifecycle assertions.
    Confidence: 1
  • [P2] Update the retained caller of the removed provider fixture — src/commands/auth-choice.apply.plugin-provider.test-support.ts:45-49
    buildProviderWithDefaultModelPatch is removed, but the retained auth-choice.apply.plugin-provider.test.ts still imports it and calls it at line 380. CI reports that it is not a function. Migrate that caller to buildProvider with the equivalent configPatch result, or retain the helper until the caller moves; otherwise the default-model preservation regression cannot execute.
    Confidence: 1
  • [P2] Keep stale event-loop data out of the replacement collector fixture — src/gateway/server/health-state.test.ts:446
    Assigning initial to pending.summary.eventLoop changes the collector fixture's result. When reset is true, getEventLoopHealth returns undefined and the unchanged production owner leaves collector fields intact, so the assertion expecting undefined now fails in both public and sensitive cases. The original collector returned no eventLoop field here. Preserve that fixture contract instead of injecting the stale sample.
    Confidence: 1
  • [P2] Keep raw legacy metadata expectations separate from canonical reads — src/commands/doctor-session-entry-state.test.ts:313-315
    Spreading retainedMetadata into the canonical accessor expectation adds sessionFile, transcriptPath, and archivedBy requirements that the original test asserted only against raw persisted metadata. The canonical read does not return those fields, and CI fails at this assertion. Keep the raw preservation assertion and restrict the reopened accessor expectation to its existing canonical fields.
    Confidence: 1
  • [P2] Preserve retirement-mock initialization for the moved successor cases — src/commands/doctor-retired-models.test.ts:20
    The new direct manifest-loader import occurs before the support module that registers its retirement metadata mock. The deleted successor suite initialized that fixture first and loaded the manifest loader afterward. The moved available, cooldown, and authoritative-cooldown cases now receive unchanged instead of the expected replacement in CI. Restore the original fixture initialization boundary so these cases exercise seeded retirement rules.
    Confidence: 0.93
  • [P2] Preserve the provider picker's normalized detection input — src/commands/auth-choice-prompt.test.ts:232
    Changing the detected ID from ollama to OLLAMA makes this case assert a new contract. The group builder normalizes IDs, but the picker compares normalized candidates against the supplied provider string, so Ollama is placed under More and lacks the detected label. CI confirms the root picker assertion fails. Keep the existing lowercase picker case and test builder normalization separately if that distinct coverage is needed.
    Confidence: 0.99
  • [P2] Migrate the native-resource caller before requiring an edge — src/infra/worker-native-lifecycle.runtime.test-support.ts:62
    Making edge required leaves worker-native-lifecycle.test-support.ts calling runNativeResourceLifecycle(directory, serviceNativeUntil) with two arguments in its retained native-resource branch. That import closure no longer satisfies the function signature. Either preserve the optional argument or remove the retired branch together with the corresponding supported mode.
    Confidence: 1

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 4d86333f6a82.

Provenance checked

Testing

Proof path: in-process harness.

Security

None.

Evidence

Acceptance criteria:

  • pnpm test src/gateway/server/hooks.agent-trust.test.ts src/gateway/server/health-state.test.ts --maxWorkers=1
  • pnpm test src/infra/restart-sentinel.test.ts src/infra/restart-sentinel.update-result.test.ts src/infra/worker-native-lifecycle.test.ts --maxWorkers=1
  • pnpm test src/commands/auth-choice.apply.plugin-provider.test.ts src/commands/auth-choice-prompt.test.ts src/commands/doctor-retired-models.test.ts src/commands/doctor-session-entry-state.test.ts --maxWorkers=1
  • pnpm tsgo:test:src
  • git diff --check

What I checked:

PR surface

PR surface statistics unavailable: the file list is incomplete.

Review metrics

Metric Value Why it matters
Production versus test/support LOC Production +0/-0; test/support +8669/-12499 The consolidation reduces test/support code by 3830 lines, but that reduction currently includes broken fixture transitions.

Labels

Label changes:

  • add P2: The introduced defects break validation and regression coverage without changing shipped runtime behavior.
  • 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:

  • P2: The introduced defects break validation and regression coverage without changing shipped runtime behavior.
  • 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 21, 2026, 9:53 PM ET / October 22, 2026, 01:53 UTC.

@steipete
steipete enabled auto-merge (squash) October 22, 2026 02:00
@steipete
steipete disabled auto-merge October 22, 2026 02:06
@steipete
steipete enabled auto-merge (squash) October 22, 2026 02:10
@steipete
steipete disabled auto-merge October 22, 2026 02:16
@steipete
steipete enabled auto-merge (squash) October 22, 2026 02:24
@steipete
steipete disabled auto-merge October 22, 2026 02:35
@steipete
steipete enabled auto-merge (squash) October 22, 2026 02:38
@steipete
steipete merged commit c5a6a30 into main Oct 22, 2026
139 checks passed
@steipete
steipete deleted the tcr/land-d420-1792631473 branch October 22, 2026 02:48
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 22, 2026
* test(doctor): consolidate y0290 sibling suites

* test(doctor): consolidate y0290 fixture assertions

* test(gateway): deslop y0291 tests

* test(gateway): consolidate y0291 owner proofs and fixtures

* test(gateway): consolidate y0291 health snapshot assertions

* test(gateway): deslop y0293 tests

* test(gateway): consolidate y0293 test families

* test(wizard): deslop y0292 tests

* test(wizard): consolidate y0292 boundary coverage

* test(wizard): consolidate y0292 fixtures and redundant coverage

* test(plugins): deslop y0294 tests

* test(plugins): consolidate y0294 test families

* test(plugins): consolidate y0294 shared harnesses

* test(infra): deslop y0295 tests

* test(infra): consolidate y0295 test families

* test(infra): deduplicate y0295 boundary coverage

* test(agents): deslop y0296 tests

* test(agents): consolidate y0296 session test families

* test(agents): share y0296 session fixtures and assertions

* test(commands): deslop y0297 tests

* test(commands): consolidate y0297 test families

* test(commands): deduplicate y0297 owner proof

* test(commands): deslop y0298 tests

* test: repair d420 fixtures and preserve boundary coverage

* test(infra): restore clean-exit worker fixture

* test: align d420 helpers with lint and baseline contracts

* test(gateway): preserve MCP response text typing
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling commands Command implementations gateway Gateway runtime P2 Normal backlog priority with limited blast radius. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. scripts Repository scripts 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