Skip to content

test(tooling): prepare Crabbox wrapper before child deadlines - #158086

Merged
steipete merged 1 commit into
mainfrom
steipete/perf-micro-crabbox-wrapper-windows-job-flake-20260919
Sep 25, 2026
Merged

steipete merged 1 commit into
mainfrom
steipete/perf-micro-crabbox-wrapper-windows-job-flake-20260919

Conversation

@steipete

@steipete steipete commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

Related: #158073

What Problem This Solves

Fixes the checked-out Crabbox wrapper smoke test timing out on Windows while loading its TypeScript dependency graph inside a 10-second managed-child deadline.

User Impact

No product behavior changes. The tooling check retains its deadline, exact output and invocation assertions, native Windows Job lifecycle, process-exit checks, and download-blocking fixture. The same fixture now also runs on POSIX.

Why This Change Was Made

The failed Windows job recorded all four fake Crabbox invocations, successful native process identity queries, and the expected stdout. Its first version probe began roughly 8.7 seconds into the 10.514-second test; the four probes then took 1.168 seconds. The deadline came from the generic shim fixture, rather than a measured Crabbox startup budget. There was no failed Job admission, stdin wait, or download in the recorded path.

Register the wrapper with the existing invocation-owned module compiler and use the existing prepared-wrapper preload. This moves dependency compilation before the deadline while still executing the real checked-out .mjs wrapper and preserving its source URL and native child ownership. The existing content-hashed compiler generation owns invalidation and cleanup. Production code delta: zero; no new cache, timeout, or configuration.

Evidence

  • Original failure: Windows job 108036043468, fetched once and inspected with its recorded startup stages.
  • Same-lease Linux comparison, three source and three prepared launches of the real wrapper with a local fake Crabbox: median total 848 → 480 ms (43% lower); median time to first probe 786 → 410 ms (48% lower). Every launch exited 0 with identical output and command order. Shared compiler preparation took 17.6 seconds outside the child deadline.
  • Provider blacksmith-testbox, lease tbx_01m3c2x82g7m7f9p2xz93dz420, Testbox run: comparison command (node --input-type=module -e, launching node scripts/crabbox-wrapper.mjs --version with source versus preparedScriptWrapperEnv environments) passed in 24.398 seconds. The first two benchmark setup attempts found missing transport-checkout dependencies before wrapper loading; pnpm install --frozen-lockfile repaired that prerequisite (31.373 seconds). Those setup failures are excluded from the measurements.
  • Same Testbox lease: pnpm test test/scripts/direct-run-entrypoints.test.ts --maxWorkers=1 passed 48 tests, including the real wrapper case in 588 ms. Vitest duration 25.46 seconds; test-runner wall 27.54 seconds; remote command wall 29.028 seconds. Existing signal/timeout cleanup tests account for most of the file cost; this change adds no sleeps or retries.
  • Same Testbox lease: node scripts/check-changed.mjs passed in 369.046 seconds (script/test-root types, formatting, lint, boundary and dead-export checks).
  • Testbox HEAD and all three changed-file hashes matched this worktree; the lease was stopped after proof.
  • Native Windows proof on this PR: shard 2, job 108045674051 passed on its first run at head 18ee3263b3ec. The wrapper case completed in 3.289 seconds inside the unchanged 10-second budget; the original job timed out at 10.514 seconds. Full file: 47 passed, 1 platform skip, 22.790 seconds. No CI rerun or timeout increase.
  • Independent Codex review: no actionable P0–P2 findings. Local validation was limited to formatting and git diff --check; all tests and compilation ran on Testbox.

@clawsweeper

clawsweeper Bot commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review in progress

ClawSweeper is reviewing this revision. This supersedes any previous blocked status.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added scripts Repository scripts size: M labels Sep 25, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 25, 2026
@clawsweeper

clawsweeper Bot commented Sep 25, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 25, 2026, 7:04 AM ET / 11:04 UTC.

ClawSweeper review

What this changes

The branch registers the Crabbox wrapper with Vitest’s shared compiler and runs its prepared-wrapper smoke test on Windows and POSIX.

Merge readiness

✅ Ready for maintainer review

Current main still has the cold-start-prone Windows fixture. This PR offers a focused repair with reported real-wrapper Testbox results; the affected Windows CI check is still running.

Priority: P2
Reviewed head: 18ee3263b3ec1dca9b39d03b8be62c2cb2e4d509

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused reuse of existing test infrastructure has measured real-wrapper evidence, with the targeted Windows result still pending.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (terminal): The changed test launches the checked-out Crabbox wrapper with a prepared module and a fake local Crabbox command. The captured PR body reports same-lease Testbox before/after launches with faster first probes, identical command order and output, and a passing wrapper case on Linux. The affected exact-head Windows check was still running; no stored-data contract changes.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (terminal): The changed test launches the checked-out Crabbox wrapper with a prepared module and a fake local Crabbox command. The captured PR body reports same-lease Testbox before/after launches with faster first probes, identical command order and output, and a passing wrapper case on Linux. The affected exact-head Windows check was still running; no stored-data contract changes.
Evidence reviewed 7 items Introduced compiler registration: The PR adds the Crabbox wrapper to the existing preserved-module build inputs.
Changed wrapper entry point: The test still launches the checked-out wrapper through its managed child, now supplying the existing prepared-module preload before the 10-second child deadline.
Existing preload owner: The preload redirects the source module URL to prepared code while retaining the source URL seen by the wrapper.
Findings None None.
Security None None.

How this fits together

Vitest prepares script modules before running tooling tests. This test launches OpenClaw’s Crabbox wrapper against a fake local command, then checks its output, command order, and child-process cleanup.

flowchart LR
A[Vitest startup] --> B[Shared module compiler]
B --> C[Prepared Crabbox module]
C --> D[Wrapper smoke test]
D --> E[Managed child]
E --> F[Fake Crabbox command]
F --> G[Output and process checks]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Tests +8, Other +1. Total +9 across 3 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 2 108 100 +8
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 1 1 0 +1
Total 3 109 100 +9

Review metrics

Metric Value Why it matters
Tooling test cost 27.54 s reported file wall; 588 ms wrapper case The PR records the cost of the changed test against the repository’s per-file CI budget.

Technical review

Best possible solution:

Keep one compiler-owned prepared module and a cross-platform wrapper test that preserves the deadline while checking output, command order, and process cleanup.

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

No deterministic current-main reproduction was established in this read-only review. A prior Windows CI job failed in the unchanged test path, and current main still runs that path without preparation.

Is this the best way to solve the issue?

Yes. Reusing the existing compiler moves cold module preparation ahead of the child deadline without weakening the wrapper’s output and lifecycle assertions.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 0878f643df2f.

Labels

Label changes:

  • add P2: This is a focused CI tooling reliability repair with limited product impact.
  • add proof: sufficient: Contributor real behavior proof is sufficient. The changed test launches the checked-out Crabbox wrapper with a prepared module and a fake local Crabbox command. The captured PR body reports same-lease Testbox before/after launches with faster first probes, identical command order and output, and a passing wrapper case on Linux. The affected exact-head Windows check was still running; no stored-data contract changes.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (terminal): The changed test launches the checked-out Crabbox wrapper with a prepared module and a fake local Crabbox command. The captured PR body reports same-lease Testbox before/after launches with faster first probes, identical command order and output, and a passing wrapper case on Linux. The affected exact-head Windows check was still running; no stored-data contract changes.

Label justifications:

  • P2: This is a focused CI tooling reliability repair with limited product impact.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (terminal): The changed test launches the checked-out Crabbox wrapper with a prepared module and a fake local Crabbox command. The captured PR body reports same-lease Testbox before/after launches with faster first probes, identical command order and output, and a passing wrapper case on Linux. The affected exact-head Windows check was still running; no stored-data contract changes.
  • proof: sufficient: Contributor real behavior proof is sufficient. The changed test launches the checked-out Crabbox wrapper with a prepared module and a fake local Crabbox command. The captured PR body reports same-lease Testbox before/after launches with faster first probes, identical command order and output, and a passing wrapper case on Linux. The affected exact-head Windows check was still running; no stored-data contract changes.

Evidence

What I checked:

  • Introduced compiler registration: The PR adds the Crabbox wrapper to the existing preserved-module build inputs. (scripts/lib/vitest-worker-build-entries.mts:139, 18ee3263b3ec)
  • Changed wrapper entry point: The test still launches the checked-out wrapper through its managed child, now supplying the existing prepared-module preload before the 10-second child deadline. (test/scripts/direct-run-entrypoints.test.ts:515, 18ee3263b3ec)
  • Existing preload owner: The preload redirects the source module URL to prepared code while retaining the source URL seen by the wrapper. (test/scripts/prepared-script-wrapper.test-support.ts:48, 18ee3263b3ec)
  • Current-main check: Fetched main retains the Windows-only unprepared test and does not register the Crabbox wrapper as a preserved build source. (test/scripts/direct-run-entrypoints.test.ts:453, 0878f643df2f)
  • Prior Windows failure: The linked earlier Windows test job failed in its Node test step. The PR body supplies the more specific timing trace; the job metadata alone does not identify the failing assertion.
  • Reported after-fix behavior: The captured PR body reports three same-lease launches of the real wrapper with a local fake Crabbox: median total time fell from 848 to 480 ms, with identical output and command order. It also reports 48 passing tests and a 588 ms wrapper case. The linked Testbox job’s redirected logs were unavailable for independent inspection in this review.

Likely related people:

  • unknown: The claimed source-line change could not be verified from bounded local history. (role: source history unknown; confidence: low)
  • Vincent Koc: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Shakker: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@steipete steipete changed the title perf(tooling): prepare Crabbox wrapper before child deadlines test(tooling): prepare Crabbox wrapper before child deadlines Sep 25, 2026
@steipete
steipete merged commit 329722c into main Sep 25, 2026
124 checks passed
@steipete
steipete deleted the steipete/perf-micro-crabbox-wrapper-windows-job-flake-20260919 branch September 25, 2026 11:15
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. scripts Repository scripts size: M 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