Skip to content

chore(test): guard Vitest progress and stall reporting - #131868

Merged
steipete merged 1 commit into
mainfrom
steipete/nifty-cerf-b02644
Aug 28, 2026
Merged

steipete merged 1 commit into
mainfrom
steipete/nifty-cerf-b02644

Conversation

@steipete

@steipete steipete commented Aug 28, 2026 •

Copy link
Copy Markdown
Contributor

Related: #131448 (shared verbose reporter repair)

What Problem This Solves

Adds maintainer-requested executable regression coverage for healthy macOS validation being mistaken for a stalled child. The reported check-changed invocation selected pnpm test:macos:ci; the tooling shard executed new elevation-host fixture subprocesses but produced no successful-case output for 900,000 ms, so the no-output watchdog terminated and retried it. The identical selected suite passed when run with --reporter=verbose.

The production repair is already on main in the linked PR. Existing coverage resolved reporter configuration and tested watchdogs against synthetic stream activity or silent Node children, but did not connect real Vitest completions to watchdog survival.

Why This Change Was Made

The regression runs real Vitest through spawnWatchedVitestProcess, the shared child boundary used by test-projects and the direct wrapper. It inherits the actual tooling reporter policy rather than forcing a reporter on the command line. Real successful cases keep the child alive across multiple watchdog windows; a later silent case must time out, exit 143, and leave no live child or worker.

Only the watchdog's captured clock is controlled. File-based synchronization never enters the watched output streams, and native timers are restored immediately after registration. Each fixture module contains one case because Vitest guarantees a task-result flush at module completion; the initial within-file report/release handshake exposed a separate dependency batching edge case and was replaced rather than hidden with retries or longer deadlines. The existing reporter-resolution table now includes the tooling config, retaining GitHub Actions and explicit reporter-override coverage.

No production behavior, reporter policy, watchdog/test timeout, retry policy, assertion, dependency, or live app/Gateway is changed. No heartbeat is used as liveness proof. Production LOC: +0/-0. Tests: +175/-0.

User Impact

No new product-runtime behavior. This protects the existing reporting repair against regression and verifies that preserving real progress does not let genuinely silent children escape termination. This tests-only follow-up was explicitly requested by a maintainer.

Evidence

Local proof on macOS with Node 24.20.0:

  • node scripts/run-vitest.mjs test/scripts/run-vitest-progress.test.ts test/vitest-reporters-config.test.ts test/scripts/vitest-process-diagnostics.test.ts — 8 tests passed; three sequential worker reruns and an independent final rerun passed. The final run took 26.43 seconds through the wrapper. Active completions survived 2.4 watchdog windows; the later silent child timed out at the controlled 1,000 ms boundary and exited 143.
  • Historical-reporter mutation: a temporary copy set only its generated fixture's reporter list to empty under agent detection, reproducing the pre-repair dependency default. Both progress scenarios failed for missing real case-completion output. The production config was never altered; the temporary copy was removed.
  • node scripts/run-vitest.mjs test/scripts/run-vitest.test.ts — all 103 wrapper regressions passed.
  • pnpm test:macos:ci — unchanged command, no reporter override: 508 tests in 14 files across 7 shards passed in 1,963.51 seconds. The log contained all 508 case-completion lines, zero no-output terminations, and zero retries. This is the current checkout's macOS selection, not a claim that the original signing branch's additional tests are present here.
  • node scripts/check-changed.mjs -- test/scripts/run-vitest-progress.test.ts test/vitest-reporters-config.test.ts — passed all selected guards, formatting, test-root typechecking, and script lint.
  • Focused test lint, formatting, and git diff --check passed. Fresh isolated Codex autoreview completed before commit with no actionable findings at its default P0 threshold.

Publication update: the native PR wrapper required a mechanical rebase onto its current trusted main baseline. Both reviewed test-file SHA256 hashes remained identical. At head ec2869ad759a3cddb18e6c3f007090045a003d81, the same focused command passed 8/8 again in 46.24 seconds and the changed-file gate passed again. Exact-head CI attached successfully. The longer macOS and wrapper-suite results above remain pre-rebase evidence; they were not rerun after this mechanical refresh.

The executable regression is POSIX-only; Windows keeps its existing process handling coverage. No UI or product-runtime surface changed, so screenshots are not applicable. The separately reproduced Vitest batching issue is tracked as a follow-up, not patched in this PR.

AI-assisted. The ownership boundary, dependency contracts, regression design, and observed proof were inspected during this maintainer-requested work. No agent transcripts or private host data are included.

@clawsweeper

clawsweeper Bot commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@openclaw-barnacle openclaw-barnacle Bot added size: S maintainer Maintainer-authored PR labels Aug 28, 2026
@steipete
steipete marked this pull request as ready for review August 28, 2026 15:40
@steipete steipete self-assigned this Aug 28, 2026
@steipete
steipete force-pushed the steipete/nifty-cerf-b02644 branch from 43d83ed to ec2869a Compare August 28, 2026 15:46
@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. 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 Aug 28, 2026
@clawsweeper

clawsweeper Bot commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 28, 2026, 12:00 PM ET / 16:00 UTC.

ClawSweeper review

What this changes

The PR adds a real-Vitest watchdog regression and includes the shared tooling configuration in reporter-resolution coverage.

Merge readiness

⚠️ Ready for maintainer review - 2 items remain

Keep open for routine maintainer review: this active, maintainer-labeled test follow-up has no blocking defect in its introduced change.

Priority: P3
Reviewed head: ec2869ad759a3cddb18e6c3f007090045a003d81

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) The branch is a focused, behavior-level regression with no supported blocking finding.
Proof confidence 🌊 off-meta tidepool Not applicable: This member-authored test-only PR is exempt from the external contributor proof gate; its body nevertheless supplies focused terminal evidence from the real wrapper.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This member-authored test-only PR is exempt from the external contributor proof gate; its body nevertheless supplies focused terminal evidence from the real wrapper.
Evidence reviewed 6 items Introduced test boundary: The new test drives real Vitest through the production watched-child helper, restores real timers before I/O, and asserts both repeated progress and the silent timeout path.
Watchdog owner: The wrapper attaches the watchdog to child stdout and stderr, resets on data, and joins the detached process group before completion resolves.
Current main behavior: Current main’s shared configuration explicitly selects the verbose reporter so completed cases feed the watchdog; the tooling config inherits that scoped configuration.
Findings None None.
Security None None.

How this fits together

OpenClaw’s test wrapper observes Vitest child-process output to distinguish live work from a stalled process. Shared reporter configuration determines whether completed cases emit that observable progress.

flowchart LR
A[Test command] --> B[Test wrapper]
B --> C[Vitest child]
C --> D[Reporter output]
D --> E[No-output watchdog]
E --> F[Continue or terminate]
F --> G[CI and developer result]
Loading

Before merge

  • Resolve merge risk (P1) - The read-only checkout lacks Vitest sources and its promisor fetch could not resolve GitHub DNS, so independent upstream-contract inspection was unavailable; the supplied exact-head terminal run is the available dependency evidence.
  • Complete next step (P2) - No repair lane is needed; this active maintainer-owned PR should remain open for normal exact-head CI and maintainer acceptance.
Agent review details

Security

None.

PR surface

Tests +175. Total +175 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 2 175 0 +175
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 175 0 +175

Review metrics

Metric Value Why it matters
Production versus test LOC production +0/-0; tests +175/-0 All introduced code is focused regression coverage; production watchdog and reporter behavior remain unchanged.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Retain this focused boundary regression and accept it after the exact-head required checks complete green.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

Retain this focused boundary regression and accept it after the exact-head required checks complete green.

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

Not applicable to a current product bug: this is a regression-test follow-up, and the PR body provides an exact-head focused wrapper run.

Is this the best way to solve the issue?

Yes. Exercising actual Vitest output through the watched-child boundary complements the existing synthetic-watchdog and silent-child coverage without adding a production seam.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 4601b0a61805.

Labels

Label changes:

  • add P3: This is test-only protection for CI and developer tooling, with no product-runtime behavior change.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This member-authored test-only PR is exempt from the external contributor proof gate; its body nevertheless supplies focused terminal evidence from the real wrapper.

Label justifications:

  • P3: This is test-only protection for CI and developer tooling, with no product-runtime behavior change.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This member-authored test-only PR is exempt from the external contributor proof gate; its body nevertheless supplies focused terminal evidence from the real wrapper.

Evidence

What I checked:

  • Introduced test boundary: The new test drives real Vitest through the production watched-child helper, restores real timers before I/O, and asserts both repeated progress and the silent timeout path. (test/scripts/run-vitest-progress.test.ts:101, ec2869ad759a)
  • Watchdog owner: The wrapper attaches the watchdog to child stdout and stderr, resets on data, and joins the detached process group before completion resolves. (scripts/run-vitest.mts:1254, 4601b0a61805)
  • Current main behavior: Current main’s shared configuration explicitly selects the verbose reporter so completed cases feed the watchdog; the tooling config inherits that scoped configuration. (test/vitest/vitest.shared.config.ts:473, 4601b0a61805)
  • Existing sibling coverage: Existing tests cover synthetic watchdog activity and silent children; this PR adds the missing real-Vitest output boundary. (test/scripts/run-vitest.test.ts:873, ec2869ad759a)
  • Merged production repair provenance: The linked reporter repair is an ancestor of current main and identifies the production behavior this follow-up protects. (e6380976314a)
  • Diff scope: The introduced delta is clean and consists solely of 175 test lines across two test files. (ec2869ad759a)

Likely related people:

  • steipete: Peter Steinberger authored the linked main-branch reporter repair and recent Vitest wrapper work. (role: production repair author and recent area contributor; confidence: high; commits: e6380976314a, f40e5f27a0d8, ec2869ad759a; files: scripts/run-vitest.mts, test/vitest/vitest.shared.config.ts, test/vitest/vitest.tooling.config.ts)

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 commented Aug 28, 2026 •

Copy link
Copy Markdown
Contributor Author

Publication and review-preparation evidence for head ec2869a:

  • Exact-head CI run 33186795821, attempt 1, completed successfully. The bounded watcher exited 0 with GREEN and no pending checks.
  • After the mechanical rebase required by the native PR wrapper's trust gate, both reviewed test-file SHA256 hashes remained identical. node scripts/run-vitest.mjs test/scripts/run-vitest-progress.test.ts test/vitest-reporters-config.test.ts test/scripts/vitest-process-diagnostics.test.ts passed 8/8 again in 46.24s; the changed-file gate passed again. The longer macOS and wrapper-suite runs remain the pre-rebase evidence described in the PR body.
  • To supplement the dependency-inspection gap in the latest ClawSweeper review, the publishing maintainer agent directly inspected installed Vitest 4.1.11 source: coverage.DM_a_rWm.js:440-457 for CLI override precedence and the agent default; index.UpGiHP7g.js:3867-3886,3991-4015,4241 for agent/minimal suppression and verbose case output; @vitest/runner/dist/chunk-artifact.js:2836-2857,3285 for throttling and the final task-update flush; and test.DNmyFkvJ.js:1910-2005 for restoring globals while retaining the captured clock. These contracts agree with the actual child-output, timeout, and cleanup results. No dependency was modified.

The current review lists no actionable code findings and has no separate Rank-up moves: section. Its before-merge items were unavailable upstream inspection in that worker and normal exact-head CI/maintainer acceptance. The reviewing lead has now accepted this exact tests-only patch after personally checking the source/dependency contracts and proof. Both the reviewing lead and publishing agent directly inspected installed Vitest source; the lead accepts both remaining review items as resolved. No behavior changed after that review, so no re-review is requested.

Landing acceptance and verification for the same head:

  • The native review guard and artifact validator passed for .local/review.md and .local/review.json: READY FOR /prepare-pr, valid issue validation, zero findings. The reviewing lead accepted the best-fix tests-only shape and authorized native prepare and merge. Production LOC: +0/-0; tests: +175/-0 in exactly two files.
  • Fresh precommit Codex autoreview found no actionable P0 findings at its requested threshold. This is not an all-severity review claim.
  • Exact local proof commands: node scripts/run-vitest.mjs test/scripts/run-vitest-progress.test.ts test/vitest-reporters-config.test.ts test/scripts/vitest-process-diagnostics.test.ts (8/8 after rebase, 46.24s); node scripts/check-changed.mjs -- test/scripts/run-vitest-progress.test.ts test/vitest-reporters-config.test.ts (pass); node scripts/run-vitest.mjs test/scripts/run-vitest.test.ts (103/103, reused unchanged-patch evidence); pnpm test:macos:ci (508 tests, 14 files, 7 shards, 1963.51s, zero stalls/retries, reused unchanged-patch evidence). The historical default-reporter mutation failed on missing successful-case output, as intended.
  • Immediately before prepare, the live head still matched ec2869ad759a3cddb18e6c3f007090045a003d81, the PR was ready and mergeable, and required openclaw/ci-gate was SUCCESS on run 33186795821, attempt 1, with no failed or pending checks. No review requests or submitted reviews were outstanding; the effective branch rules require CI and linear history, not independent approval.
  • Native landing commands: OPENCLAW_TESTBOX=1 scripts/pr prepare-run 131868, followed by scripts/pr merge-run 131868. No bypass, extra production commit, dependency change, or changelog edit is authorized or needed.
  • Known proof limits: the new executable regression is POSIX-only. The long macOS and wrapper runs predate the mechanical rebase; focused owner/sibling proof and the changed-file gate were rerun afterward. No UI/Gateway behavior changes, so no screenshots or live application flow apply. The separately identified upstream Vitest within-file throttle delivery edge remains a named follow-up outside this PR; the fixture uses module completion's guaranteed final flush.

Native prepare completed successfully at the unchanged accepted head: review validation and hosted CI/Testbox gates passed, both accepted test-file SHA256 hashes were preserved, and prepare skipped pushing because the remote branch already matched. The native gate artifacts identify the exact target head. No remote lease was acquired. A final required-check read still reports openclaw/ci-gate SUCCESS; native merge is next.

@steipete
steipete merged commit 6ee9b5e into main Aug 28, 2026
156 checks passed
@steipete
steipete deleted the steipete/nifty-cerf-b02644 branch August 28, 2026 16:35
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintainer Maintainer-authored PR P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: S 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