Repository navigation
test(core): remove low-value tests (batch d420) - #180132
Conversation
|
🦞👀 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 SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 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 () => { |
There was a problem hiding this comment.
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 👍 / 👎.
|
Codex review: needs changes before merge. What this changesThis PR consolidates test fixtures and sibling suites across core subsystems without changing production behavior. Example: A developer runs the hook terminal-target regression suite.
Review scores
ProductKind: Test only · Worth it: Yes · Fix scope: Complete 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 Before merge
Findings
Provenance
Agent review detailsHow this fits togetherVitest 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]
Technical reviewBest 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:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 4d86333f6a82. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceAcceptance criteria:
What I checked:
PR surfacePR surface statistics unavailable: the file list is incomplete. Review metrics
LabelsLabel changes:
Label justifications:
Rating scale6/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. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed October 21, 2026, 9:53 PM ET / October 22, 2026, 01:53 UTC. |
* 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
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
git diff --checkagainst the pinned base passed.openclaw/ci-gate.Per-shard diff
Counts below describe the replayed diff, not the older full campaign report. Declaration delta counts added minus removed
it/testdeclarations (including tables); table expansion is not estimated.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.mjsy0291
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.tsy0293
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.tsy0292
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.tsy0294
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.tsy0295
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.mjsy0296
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.mjsy0297
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.tsy0298
src/commands/agent-exec.auth.test.ts,src/commands/agent.session.test.tsKept and dropped replay hunks
Pinned base: 38f36ca.
CI-only authority: no Vitest, tsgo, check-changed, Testbox, or coverage runs. Source reports contain static counts, not measured coverage.
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.