test(cron): speed up isolated fallback tests#87520
Conversation
|
Codex review: needs maintainer review before merge. Reviewed May 28, 2026, 1:41 AM ET / 05:41 UTC. Summary PR surface: Source +16, Tests +4. Total +20 across 4 files. Reproducibility: not applicable. this is a test-harness performance cleanup rather than a reported runtime bug. The review checked current main, the PR diff, and the PR body's before/after timing proof instead of a user-facing repro. Review metrics: none identified. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Risk before merge
Maintainer options:
Next step before merge
Security Review detailsBest possible solution: Land the narrow test-harness speedup after maintainer approval and green required CI, keeping production cron runtime behavior unchanged. Do we have a high-confidence way to reproduce the issue? Not applicable; this is a test-harness performance cleanup rather than a reported runtime bug. The review checked current main, the PR diff, and the PR body's before/after timing proof instead of a user-facing repro. Is this the best way to solve the issue? Yes; the patch targets the expensive test-only seams with a harness mock and per-suite fast-mode opt-in, which is narrower than changing production cron fallback or runtime behavior. AGENTS.md: found and applied where relevant. Codex review notes: model gpt-5.5, reasoning high; reviewed against e805ffd2eb75. Label changesLabel justifications:
Evidence reviewedPR surface: Source +16, Tests +4. Total +20 across 4 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
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. How this review workflow works
|
|
ClawSweeper PR egg: ✨ hatched 🥚 common Clockwork Crabkin. Rarity: 🥚 common. Trait: sleeps inside passing CI. DetailsShare on X: post this hatch
About:
|
1dbd3bc to
bb22882
Compare
Summary
This PR speeds up the isolated cron test hotspot shard without changing production runtime behavior.
resolveCliRuntimeExecutionProviderso the payload fallback tests can assert cron fallback planning without invoking real CLI runtime/backend discovery.runCronIsolatedAgentTurnsuites opt intoOPENCLAW_TEST_FAST=1throughsetupRunCronIsolatedAgentTurnSuite({ fast: true }).Test Cost / Size Impact
166.17stotal,143.35sin tests.3.55stotal,1.18sin tests.src/cron/isolated-agent/run.payload-fallbacks.test.tsafter focused fix:2.00stotal,24msin tests. The former slow Claude CLI compatibility assertion now reports0-1msin the grouped runs.Related Work Search
I searched GitHub and local repo tooling before implementing. I did not find an exact existing issue or PR covering this isolated cron test performance work.
Adjacent but not duplicate:
Verification
node scripts/run-vitest.mjs src/cron/isolated-agent/run.payload-fallbacks.test.ts src/cron/isolated-agent/run.fast-mode.test.ts src/cron/isolated-agent.hook-content-wrapping.test.ts src/cron/isolated-agent.delivery-awareness.test.ts --reporter=verbosenode scripts/run-vitest.mjs src/cron/isolated-agent/run.*.test.ts --reporter=verbosepnpm exec oxfmt --check --threads=1 src/cron/isolated-agent/run.test-harness.ts src/cron/isolated-agent/run.suite-helpers.ts src/cron/isolated-agent/run.payload-fallbacks.test.ts src/cron/isolated-agent/run.fast-mode.test.tsnode scripts/run-oxlint.mjs --tsconfig config/tsconfig/oxlint.json src/cron/isolated-agent/run.test-harness.ts src/cron/isolated-agent/run.suite-helpers.ts src/cron/isolated-agent/run.payload-fallbacks.test.ts src/cron/isolated-agent/run.fast-mode.test.tsnode scripts/run-tsgo.mjs -p test/tsconfig/tsconfig.test.src.json --incremental --tsBuildInfoFile .artifacts/tsgo-cache/test-src.tsbuildinfo.agents/skills/autoreview/scripts/autoreview --mode localReal behavior proof
Behavior addressed: Isolated cron test performance for payload fallback and fast-mode planning coverage; no production runtime behavior change intended.
Real environment tested: Local Codex worktree on macOS using repo Node/Vitest wrappers.
Exact steps or command run after this patch: The Verification commands listed above.
Evidence after fix: The planned four-file hotspot group passed 18 tests in
3.55safter a baseline of166.17s; the broadersrc/cron/isolated-agent/run.*.test.tswrapper run passed 16 files and 117 tests in5.02s; oxfmt, focused oxlint, test-source tsgo, and autoreview all exited cleanly.Observed result after fix: The slow CLI compatibility fallback assertion is covered through the cron test harness mock instead of real runtime discovery, and the targeted mocked suites complete in seconds while preserving fallback ordering, compatible CLI execution attempts, fast-mode propagation, hook content wrapping, and delivery-awareness coverage.
What was not tested: Full
pnpm check, full Vitest suite, and live provider behavior; this is a scoped test-only harness change in a Codex worktree.