Repository navigation
refactor(scripts): deslop e2e harness - #159247
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: blocked before merge. Reviewed September 27, 2026, 2:00 AM ET / 06:00 UTC (Revision 8). ClawSweeper reviewWhat this changesThe branch consolidates end-to-end test fixtures and scenario helpers, including Parallels guest orchestration, and repairs mobile-pairing cleanup, Codex discovery fixtures, and upgrade-recovery assertions. Merge readiness⛔ Blocked before merge - 3 items remain Keep open: current main lacks this branch’s useful work, and the reported Docker evidence is substantial. The remaining merge gap is validation of the changed Parallels controller on a real guest. Priority: P3 Review scores
Verification
How this fits togetherOpenClaw’s end-to-end harness drives packaged installs, Gateway requests, and update scenarios through Docker and Parallels guests. It turns their responses and generated fixtures into assertions, logs, and status summaries. flowchart LR
A[Packages and fixtures] --> B[Scenario selection]
B --> C[Docker and Parallels runners]
C --> D[OpenClaw CLI and Gateway]
D --> E[Responses and artifacts]
E --> F[Assertions]
F --> G[Status and logs]
Before merge
Agent review detailsSecurityNone. PR surfaceTests +291, Other -900. Total -609 across 46 files. View PR surface stats
Review metricsNone. Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Retain the shared harness owners and establish a passing representative Parallels fresh install and same-guest update, including status, process completion, and cleanup evidence. Do we have a high-confidence way to reproduce the issue? Not applicable to the primary refactor. The PR documents before-and-after checks for its incidental fixture defects, but no real Parallels guest run. Is this the best way to solve the issue? Yes for consolidating repeated harness ownership while retaining scenario boundaries; the Parallels path still needs its documented guest-level validation. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 5e1a2cf4ea76. LabelsLabel changes: No label changes. Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (7 earlier review cycles)
|
28d6ca5 to
76c38db
Compare
Consolidate fixture generation, bounded readers, command handling, and gateway/controller lifecycle owners while preserving every existing scenario and assertion. Fix leaked mobile pairing frame waiters on failed WebSocket opening or sending.
3cb4a32 to
48a9a25
Compare
* refactor(scripts): deslop e2e harness Consolidate fixture generation, bounded readers, command handling, and gateway/controller lifecycle owners while preserving every existing scenario and assertion. Fix leaked mobile pairing frame waiters on failed WebSocket opening or sending. * fix(scripts): repair e2e discovery and recovery fixtures * test(scripts): follow shared Bun timeout validation
What Problem This Solves
E2E harnesses repeat fixture generation, bounded readers, command handling, and lifecycle orchestration across equivalent scenarios.
User Impact
This is internal harness maintenance. Existing scenarios, assertions, CLI arguments, environment variables, defaults, diagnostics, and release behavior are retained. The sweep also repairs mobile-pairing waiter cleanup, Codex fake-server discovery, and recovery evidence for index-only agent owners.
Why This Change Was Made
The sweep removes 900 net production/tooling lines across
scripts/e2e(740 added, 1,640 removed), with no scenario deletion. Tests add 291 net lines. This is below the requested 1,000-line target; the complete coverage log is included below. It covers all 112 production files over 200 baseline lines and the existing fixture owner that grows past 200 lines.Fixes found along the way
A failed WebSocket open left the mobile-pairing client's challenge waiter armed. The Linux regression failed before the fix with one remaining message listener.
receiveFramenow owns listener-before-trigger ordering and cleanup for opening, sending, and response timeouts; socket closure also clears its losing fallback timer. The three failure cases pass with zero retained message listeners or timers.The Codex media-path fake server returned empty objects for
model/listandthread/list, preventing the installed runtime from discovering its image-capable model. It now returns valid discovery responses for the existing fixture model. The stdio regression failed before the fix and passes afterward; protocol/version and turn behavior remain unchanged.Recovery evidence treated every migration receipt as proof that its agent database existed. Doctor intentionally leaves shared-index-only owners without a database. The harness now measures completed transcript destinations, retaining strict
statfailures for missing actual destinations. The command-level regression failed on the original absent index-only database, then passed with the repair; its missing-transcript negative control still fails as required.Evidence
The inherited WhatsApp inventory failure from earlier CI is fixed upstream by #159340. This PR adds no inventory entry. Refreshed CI exposed a stale Bun source assertion, now corrected to name the shared positive-integer validator while preserving the exact timeout environment variable and 180000 ms default. The malformed-timeout execution test and all other assertions remain intact.
Bun assertion follow-up
Rebased onto fresh main
ede3447b1029814e21aff09a9d51bb9ff448ea08. Kept: both existing cleanup/fix commits, patch-identical bygit range-diff. Dropped: no simplification hunks. Main's behavior and the upstream WhatsApp fix are retained. The only follow-up source change is the one-line test expectation; no production behavior changed.On Blacksmith Testbox
tbx_01m3gftjfcbgzwzyrs19zx7283(run), the old assertion failed on its stale helper spelling, then the corrected file passed 121 tests (pnpm test test/scripts/test-install-sh-docker.test.ts --maxWorkers=1, 14.72s wall). An independent 12-input comparison of the removed and shared validators matched exit code, stdout, and stderr exactly. The first broad batch passed 5,457 tests across 68 files, with three existing skips (463.99s). The final indirect-caller batch passed 475 tests across 35 files (50.14s). Combined: 6,053 passed tests across all 104 selected script suites, with three existing skips. Selection covers direct path/static-import references, their fixture and shared-reader callers, and all Parallels/survivor owner suites.node scripts/check-changed.mjspassed (296.49s),pnpm check:workflowspassed (20.44s),pnpm buildpassed (408.36s), and fresh Codex review of the complete rebased candidate is scoped-clean through P2. The lease is stopped.Published follow-up head:
48a9a258411b0a011d038f99a4a59acbc43900c3; committed tree6b97dc4a09c6bf78fafc6fc8c9eca0c99b373eb2exactly matches the remotely tested/reviewed source. CI is attached to that exact head and is in progress. Hosted time for the corrected test is pending that run.Completed on the original candidate, with proportional revalidation after the main rebase:
pnpm build,node scripts/check-changed.mjs,pnpm check:workflows, and the Docker package-boundary guard passed. The rebased candidate also passed the complete changed-file gate and 361 survivor tests across six owner suites.src/infra/fs-safe-import-boundary.test.tsplus plugin/helper import-boundary siblings passed.The repair batch passed all 10 Codex, 20 recovery, and 344 Docker-helper tests, full
pnpm deadcode:full, and the complete changed-file gate.pnpm test <file> --maxWorkers=1wall times were 1.46s, 1.92s, and 46.60s respectively. Moving Brave generation into the existing fixture dispatcher fixed the hosted unused-file failure without scanner exceptions; six generated files remain byte-identical. The repair review is independently scoped-clean through P2.Representative Docker proofs passed for plugins, five onboarding cases, Doctor switch, release user journey, live OpenAI chat/tools, cron CLI, bundled OpenAI install/runtime/disable/uninstall, and published
2026.9.4configured-plugin-installs, projects-doctor, mobile-pairing-reconnect, and workshop-doctor-recovery. Bun global install/local agent/Gateway also passed.The final head passed
node scripts/check-changed.mjs(302.57s),pnpm check:workflows(20.41s), all 50 mock-server tests including the incorporated main changes (30.37s), and all four explicit import-boundary suites (39 cases, 6.28s). Candidate preparation includingpnpm buildpassed in 487.05s, and both Docker images built. The repaired installed-package scenarios passed: Codex media-path 34s, published2026.9.4configured-plugin-installs 182s, and published2026.9.4recovery-cleanup 291s. The full final proof command exited zero.Known inherited limitation: the additional current-package
auto-authcell refuses withservice-membership-unverified. The systemd emulator deliberately has no real cgroup; the production guard correctly requires one. This predates the refactor. No guard, scenario, or assertion was weakened, and manual published-upgrade successes are not automatic-restart proof. A separate repair requires a native-user-systemd validation route or an explicitly approved Docker cgroup isolation design.Codex autoreview is scoped-clean through P2 on the rebased candidate. Its first pass lacked the unchanged systemd parser and raised a guard concern; the complete source and eight direct before/after
GetUnitcases confirmed that invalid grammar still throws before the response. The refreshed review accepted that contract.Earlier package/Docker proof at
76c38db5af71254071e513cc1864f2d694e7c3daused providerblacksmith-testbox, leasetbx_01m3fyck7ek7xevfmvgy1r63z3(run). The repair batch usedtbx_01m3g5fyrp45wzn9aqdajd74xy(run). Final Docker proof for that head usedtbx_01m3g7e52jy0hhv9w0rqgxg3kz(run), with verified source treee8b6ce657a7f1c4de564c5a5a2aac3be76c96233. Those leases are stopped. Every test, check, and build ran remotely.Complete large-file sweep coverage
E2E deslop coverage
Baseline:
f72bb2cca2d9eee77dd09fe0365e876866a08a7b. The wholescripts/e2esubtree was read largest-first across bounded owners. No dead scenario was proved; no scenario or assertion was removed. This table covers all 112 production files over 200 baseline lines plus the existing plugin-fixture owner that grew from 182 to 243 lines, sorted by baseline size. Smaller files were also read.scripts/e2e/kitchen-sink-rpc-walk.mtsscripts/e2e/lib/upgrade-survivor/run.shscripts/e2e/lib/upgrade-survivor/diagnostics.mjsscripts/e2e/lib/upgrade-survivor/assertions.mjsscripts/e2e/parallels/npm-update-smoke.tsscripts/e2e/lib/bundled-plugin-install-uninstall/runtime-smoke.mjsscripts/e2e/parallels/macos-smoke.tsscripts/e2e/lib/upgrade-survivor/mobile-pairing-client.mtsscripts/e2e/mock-openai-server.mjsscripts/e2e/lib/codex-npm-plugin-live/assertions.mjsscripts/e2e/lib/plugins/assertions.mjsscripts/e2e/upgrade-survivor-docker.shscripts/e2e/parallels/guest-transports.tsscripts/e2e/lib/node-auto-update/scenario.mjsscripts/e2e/lib/clawhub-fixture-server.cjsscripts/e2e/parallels/windows-smoke.tsscripts/e2e/lib/upgrade-survivor/workshop-doctor-recovery.mjsscripts/e2e/lib/upgrade-survivor/legacy-operator-state.mjsscripts/e2e/lib/upgrade-survivor/dreaming-cron.mjsscripts/e2e/parallels/linux-smoke.tsscripts/e2e/lib/live-plugin-tool/assertions.mjsscripts/e2e/parallels-windows-prepare.shscripts/e2e/lib/upgrade-survivor/project-worktree-startup.mjsscripts/e2e/lib/kitchen-sink-plugin/assertions.mjsscripts/e2e/lib/upgrade-survivor/backup-rollback.mjsscripts/e2e/lib/gateway-network/client.mtsscripts/e2e/npm-telegram-live-docker.shscripts/e2e/lib/upgrade-survivor/recovery-cleanup.mjsscripts/e2e/parallels/smoke-common.tsscripts/e2e/lib/upgrade-survivor/update-restart-auth.shscripts/e2e/lib/upgrade-survivor/systemd-fixture.mjsscripts/e2e/parallels/host-command.tsscripts/e2e/codex-npm-plugin-live-docker.shscripts/e2e/lib/upgrade-survivor/sqlite-volume.mjsscripts/e2e/cron-cli-docker.shscripts/e2e/parallels/npm-update-scripts.tsscripts/e2e/lib/upgrade-survivor/config-recipe.mtsscripts/e2e/lib/onboard/scenario.shscripts/e2e/lib/upgrade-survivor/update-report-recovery.mjsscripts/e2e/lib/upgrade-survivor/abandoned-update.mjsscripts/e2e/bun-global-install-smoke.shscripts/e2e/lib/update-first-hop-package-fixtures.mjsscripts/e2e/lib/release-user-journey/write-clickclack-plugin.mjsscripts/e2e/lib/release-user-journey/assertions.mjsscripts/e2e/multi-node-update-docker.shscripts/e2e/lib/plugin-update/consent-scenario.mjsscripts/e2e/lib/sandbox-browser-sidecar/scenario.mjsscripts/e2e/lib/upgrade-survivor/projects-doctor.mjsscripts/e2e/lib/plugin-lifecycle-matrix/measure.mjsscripts/e2e/lib/plugins/npm-registry-server.mjsscripts/e2e/lib/upgrade-survivor/recovery-cleanup-fixture.mjsscripts/e2e/lib/doctor-install-switch/scenario.shscripts/e2e/lib/upgrade-survivor/update-first-hop-compat.shscripts/e2e/lib/upgrade-survivor/custom-plugin-siblings.mjsscripts/e2e/lib/upgrade-survivor/taskflow-restoration.mjsscripts/e2e/cli-backend-oauth-mcp-live.mjsscripts/e2e/lib/upgrade-survivor/schema-expectation.mjsscripts/e2e/lib/upgrade-survivor/legacy-operator-cron-history.mjsscripts/e2e/lib/release-user-journey/clickclack-fixture.mjsscripts/e2e/npm-telegram-live-runner.tsscripts/e2e/lib/upgrade-survivor/sqlite-volume-shared-state.mjsscripts/e2e/session-runtime-context-docker-client.tsscripts/e2e/lib/upgrade-survivor/legacy-operator-restored-index.mjsscripts/e2e/openwebui-probe.mjsscripts/e2e/parallels/package-artifact.tsscripts/e2e/lib/bun-global-install/assertions.mjsscripts/e2e/lib/upgrade-survivor/watchos-direct-node.mjsscripts/e2e/cron-mcp-cleanup-docker-client.tsscripts/e2e/compose-setup.shscripts/e2e/system-agent-rescue-docker-client.tsscripts/e2e/lib/plugin-index-sqlite.mjsscripts/e2e/lib/plugin-update/probe.mjsscripts/e2e/lib/plugins/sweep.shscripts/e2e/lib/upgrade-survivor/missing-configured-plugin-migration.mjsscripts/e2e/npm-onboard-channel-agent-docker.shscripts/e2e/lib/bundled-plugin-install-uninstall/probe.mjsscripts/e2e/lib/update-channel-switch/assertions.mjsscripts/e2e/lib/container-image-upgrade/fixture.mjsscripts/e2e/lib/upgrade-survivor/formerly-bundled-plugin-doctor.mjsscripts/e2e/lib/upgrade-survivor/workshop-legacy-proposals.mjsscripts/e2e/lib/plugins/fixtures.shscripts/e2e/parallels/host-server.tsscripts/e2e/fleet-cache-docker.shscripts/e2e/lib/mcp-code-mode-diagnostics.tsscripts/e2e/lib/upgrade-survivor/legacy-operator-plugin-policy.mjsscripts/e2e/anthropic-cache-live.mtsscripts/e2e/parallels/parallels-exec.pyscripts/e2e/lib/doctor-install-switch/shims/busctlscripts/e2e/lib/session-log-mentions.tsscripts/e2e/lib/release-upgrade-user-journey/scenario.shscripts/e2e/update-channel-switch-docker.shscripts/e2e/lib/release-user-journey/scenario.shscripts/e2e/lib/skills/clawhub-install-proof.shscripts/e2e/openwebui-docker.shscripts/e2e/lib/kitchen-sink-plugin/sweep.shscripts/e2e/lib/npm-onboard-channel-agent/assertions.mjsscripts/e2e/lib/session-cold-storage/client.mjsscripts/e2e/lib/upgrade-survivor/taskflow-restoration-fixture.mjsscripts/e2e/lib/fleet-cache/runtime-preflight.mjsscripts/e2e/lib/release-scenarios/assertions.mjsscripts/e2e/browser-plugin-profiles-docker.shscripts/e2e/lib/kitchen-sink-calibration.mtsscripts/e2e/lib/run-with-pty.mjsscripts/e2e/lib/release-plugin-marketplace/lifecycle-assertions.mjsscripts/e2e/lib/agent-turn-output.mjsscripts/e2e/parallels/macos-discord.tsscripts/e2e/lib/upgrade-survivor/worker-cell-package.mjsscripts/e2e/lib/auth-profile-store-assertions.mjsscripts/e2e/lib/upgrade-survivor/update-admission-entry-probe.mjsscripts/e2e/mcp-code-mode-gateway-client.tsscripts/e2e/parallels/plugin-isolation.tsscripts/e2e/lib/kitchen-sink-resources.mtsscripts/e2e/lib/fixtures/plugins.mjs