Skip to content

ci: reduce Doctor test startup and core lint jobs - #138796

Merged
steipete merged 1 commit into
mainfrom
codex/ci-doctor-runtime-two-lint-jobs
Sep 5, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/ci-doctor-runtime-two-lint-jobs

Conversation

@steipete

@steipete steipete commented Sep 5, 2026 •

Copy link
Copy Markdown
Contributor

Closes #138795

What Problem This Solves

Resolves repeated CLI startup work in Doctor process tests and an extra hosted runner allocation for ordinary hybrid core lint. The Doctor tests paid to prepare the shared compiled CLI, then launched TypeScript source for every repair and preview.

Why This Change Was Made

The plugin-disabled Doctor scenarios now use that existing compiled CLI inside one lazily created, isolated package fixture. Each scenario retains fresh home, configuration and database state, and each invocation remains a separate process. The source/watch path uses the same fixture; the plugin-enabled workspace test keeps its original launch. This removes the synthetic UI module loader while exercising the real UI owner against fixture assets.

Ordinary hybrid core lint runs its five existing compiler programs in two jobs, grouped 1+2 and 3+4+5. Programs remain sequential and isolated with their existing resource limits. Other runner profiles and frozen/manual/release routes retain their existing allocation.

User Impact

Faster Doctor test execution and one fewer hosted setup per ordinary hybrid run. All seven Doctor cases, their existing assertions, and all five lint programs remain. Product behavior is unchanged.

Evidence

  • One local Node 24 comparison: all seven Doctor cases passed in 88.00s, versus 156.48s before the change. Both timings include the same compiled preparation graph (8,297 inputs / 4,105 outputs). Host load and source-cache warmth varied; native CI timings are reported separately below.
  • All seven cases also passed through standalone live-source execution; the existing source-package UI ownership case passed separately. Fixture cleanup and compiled-generation verification completed.
  • The existing workflow guard failed against the old three-job allocation and passed with the two-job allocation. It verifies all five programs run once, preserves alternate routes and limits, and proves failure in program 4 prevents program 5 from starting.
  • All 23 selected repository checks and canonical workflow validation passed. Independent review found no actionable P0–P2 findings. The refreshed native CI and setup validation are green on the published head.

Native core lint completed in 4:22 and 4:30 of execution, with all five programs accounted for across the two jobs.

Refreshed native CI passed on b0e4b2f95c7081c220992b7dbd7df60b0b2985b4: 96 successful jobs and nine existing scope skips, including both Windows rows and all seven UI shards. Doctor retained all seven cases and took 36.994s in case clocks, following 37.797s in the first candidate run. Whole-row timing varies with the other CLI tests, so these case timings are not a matched whole-CI speedup claim. Broader non-Windows completion remains 8:51, led by real-Gateway build/tests; that remaining optimization is separate from this reduction.

The first run exposed a dashboard-gallery fixture regression already fixed on main by #138769. This PR was mechanically refreshed onto that fix, with an identical introduced patch. The gallery case then passed in 1.769s. No assertions or timeouts were relaxed. A separate setup-validation check hit a connection reset while downloading TruffleHog; its failed-job retry passed in 1:38.

Doctor proof used Node 24.19.0. Local commands are shown below with JSON reporter/output-path arguments omitted:

node scripts/run-vitest.mjs src/cli/doctor-output.process.test.ts --maxWorkers=1 --reporter=verbose
node node_modules/vitest/vitest.mjs run --config test/vitest/vitest.cli-process.config.ts src/cli/doctor-output.process.test.ts --maxWorkers=1 --reporter=verbose
node scripts/check-changed.mjs --timed --base 2387285d3e0beb6a89350fd0192bb618d725e512 --head HEAD -- src/cli/doctor-output.process.test.ts src/commands/doctor-config-preflight.process.test-support.ts docs/reference/test.md .github/workflows/ci.yml test/scripts/ci-workflow-guards.test.ts docs/ci.md
pnpm check:workflows

@clawsweeper

clawsweeper Bot commented Sep 5, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation cli CLI command changes commands Command implementations size: S maintainer Maintainer-authored PR labels Sep 5, 2026
@steipete
steipete marked this pull request as ready for review September 5, 2026 02:29
@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 Sep 5, 2026
@clawsweeper

clawsweeper Bot commented Sep 5, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 4, 2026, 11:04 PM ET / September 5, 2026, 03:04 UTC.

ClawSweeper review

What this changes

Reuses a compiled CLI fixture for Doctor process tests and groups ordinary hybrid CI’s five core lint programs into two hosted jobs.

Merge readiness

✅ Ready for maintainer review

Keep open as a useful, bounded optimization absent from current main. No blocking correctness or security findings.

Priority: P3
Reviewed head: b0e4b2f95c7081c220992b7dbd7df60b0b2985b4

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused optimization with preserved coverage, credible supplied execution evidence and no actionable findings.
Proof confidence 🐚 platinum hermit (4/6) Not applicable: The external-contributor proof gate does not apply to this maintainer-authored CI/test refactor. Supplied evidence exercises Doctor through the reused fixture and the two actual lint jobs; linked Actions logs could not be independently retrieved here.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The external-contributor proof gate does not apply to this maintainer-authored CI/test refactor. Supplied evidence exercises Doctor through the reused fixture and the two actual lint jobs; linked Actions logs could not be independently retrieved here.
Evidence reviewed 10 items Verified introduction and merge boundary: The original head records parent 6832f3b. The test merge records the pinned base followed by that exact head; its base-relative changes are confined to the six introduced paths.
Doctor fixture and lifecycle: The shared fixture is created lazily and removed after the suite; each invocation receives its scenario’s home, config and state directory. Existing assertions, subprocess timeout and output limit remain intact.
Existing package-fixture boundary: The reused helpers preserve fixture-owned package metadata and UI assets while linking runtime dependencies. Their existing callers retain the default dist directory and buffer behavior; the sibling UI ownership test checks that missing assets resolve inside the fixture.
Findings None None.
Security None None.

How this fits together

Doctor process tests exercise OpenClaw’s diagnostic command against isolated configurations and databases. CI separately assigns core lint programs to hosted runners and collects their results into the merge checks.

flowchart TD
  A[Doctor test scenarios] --> B[Shared isolated package fixture]
  B --> C[Compiled CLI or live source]
  C --> D[Separate scenario state and output checks]
  E[CI event and runner profile] --> F{Ordinary hybrid run?}
  F -->|Yes| G[Two jobs covering five lint programs]
  F -->|No| H[Existing alternate allocation]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Tests +13, Docs +4, Config +1. Total +18 across 6 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 3 94 81 +13
Docs 2 6 2 +4
Config 1 7 6 +1
Generated 0 0 0 0
Other 0 0 0 0
Total 6 107 89 +18

Review metrics

Metric Value Why it matters
Runtime versus test growth Product runtime 0; CI workflow +1; tests/support +13 net LOC The growth stays in scheduling and validation infrastructure while reusing existing runtime helpers.
Hosted lint allocation 3 → 2 jobs; 5 programs retained Each ordinary hybrid run avoids one hosted setup without widening compiler programs or their concurrency.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #138795
Summary: This PR implements the linked CI-efficiency request; the merged UI change only explains an unrelated earlier check failure.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Technical review

Best possible solution:

Keep one compiled subprocess generation, fixture-owned package assets, independent scenario state and complete lint coverage without adding another build or cache path.

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

Not applicable as a product bug: this is a CI optimization with supplied before/after timings; no benchmark was rerun during this read-only review.

Is this the best way to solve the issue?

Yes. Reusing the existing subprocess generation and package fixture removes repeated preparation without dropping assertions, increasing sharding or introducing a competing runtime path.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 790fbf0304a6.

Labels

Label justifications:

  • P3: This improves developer CI efficiency without changing shipped product behavior.
  • 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. Not applicable: The external-contributor proof gate does not apply to this maintainer-authored CI/test refactor. Supplied evidence exercises Doctor through the reused fixture and the two actual lint jobs; linked Actions logs could not be independently retrieved here.

Evidence

What I checked:

  • Verified introduction and merge boundary: The original head records parent 6832f3b. The test merge records the pinned base followed by that exact head; its base-relative changes are confined to the six introduced paths. (3ac303368b52)
  • Doctor fixture and lifecycle: The shared fixture is created lazily and removed after the suite; each invocation receives its scenario’s home, config and state directory. Existing assertions, subprocess timeout and output limit remain intact. (src/cli/doctor-output.process.test.ts:23, b0e4b2f95c70)
  • Existing package-fixture boundary: The reused helpers preserve fixture-owned package metadata and UI assets while linking runtime dependencies. Their existing callers retain the default dist directory and buffer behavior; the sibling UI ownership test checks that missing assets resolve inside the fixture. (src/commands/doctor-config-preflight.process.test-support.ts:95, b0e4b2f95c70)
  • Compiled-runtime implementation boundary: OpenClaw’s Vitest plugin redirects registered subprocess declarations into the invocation’s compiled generation and retains source execution for standalone/watch runs. The CLI declaration targets OpenClaw’s entry module; this change does not depend on the Codex runtime or protocol. (test/vitest/vitest.worker-artifacts.ts:24, b0e4b2f95c70)
  • Lint coverage and failure handling: The matrix and execution conditions agree: ordinary hybrid runs execute groups 1+2 and 3+4+5. The shell retains fail-on-error, one lint thread, the 15-minute job deadline and alternate-profile allocation. Executable shell guards cover every program and verify that failure in program 4 prevents program 5. (test/scripts/ci-workflow-guards.test.ts:10603, b0e4b2f95c70)
  • Current-main necessity: Fetched main still launches Doctor through TypeScript with the synthetic UI loader and allocates three ordinary hybrid core-lint jobs. The reviewed optimization is therefore still distinct. (src/cli/doctor-output.process.test.ts:53, 790fbf0304a6)

Likely related people:

  • Peter Steinberger: Raw commit 6f77913 adds src/cli/cli-entrypoint.test-support.ts:5 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 6f77913ec3f7; files: src/cli/cli-entrypoint.test-support.ts)
  • PollyBot13: 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.

History

Review history (1 earlier review cycle)
  • reviewed 2026-09-05T02:40:13.864Z sha a65c9b46a10000cbaf38b67e4f488e2b0a788057 :: needs maintainer review before merge. :: none

@steipete
steipete force-pushed the codex/ci-doctor-runtime-two-lint-jobs branch from a65c9b4 to b0e4b2f Compare September 5, 2026 02:51
@steipete
steipete merged commit 2116c9a into main Sep 5, 2026
170 of 171 checks passed
@steipete
steipete deleted the codex/ci-doctor-runtime-two-lint-jobs branch September 5, 2026 03:20
@steipete

steipete commented Sep 5, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 5, 2026
vincentkoc added a commit to LiuwqGit/openclaw that referenced this pull request Sep 5, 2026
* refs/remotes/origin/main: (602 commits)
  fix(plugins): trace trust refusals and repair legacy provenance (openclaw#138746)
  perf(sqlite): reuse compiled plugin state point reads (openclaw#138758)
  refactor: type chat prefetch dependencies and clean loading tests (openclaw#138793)
  ci: reduce Doctor test startup and core lint jobs (openclaw#138796)
  feat(update): retain run history and share outcome reports (openclaw#138690)
  chore(deps): update @openclaw/fs-safe to 0.8.1 (openclaw#138500)
  fix: preserve global board ownership from pinning to notifications (openclaw#138675)
  fix(gateway): deliver session catalog updates from slow hosts (openclaw#138674)
  perf(sessions): index pending conversation replies (openclaw#127182)
  perf(auth): reuse ordered provider alias entries (openclaw#138805)
  docs(diagnostics): clarify whole-process CPU metrics (openclaw#138804)
  perf(memory): narrow source reads and stream embedding cache rows (openclaw#138766)
  fix: allow older source on newer Testbox checkouts (openclaw#138782)
  fix(agents): preserve recovered task progress and lifecycle ownership (openclaw#138785)
  perf(codex): reduce rollout tail scan CPU (openclaw#138784)
  perf(gateway): stop projecting history deltas at the byte budget (openclaw#138655)
  fix(build): bound native declaration inputs to checkout (openclaw#138742)
  fix(cli): preserve foreground Gateway argument handling (openclaw#138765)
  fix(ui): align task toolbar with side-panel tabs (openclaw#138769)
  fix(logbook): drain accepted work before closing SQLite (openclaw#138754)
  ...

# Conflicts:
#	src/agents/embedded-agent-runner/compact.queued.ts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cli CLI command changes commands Command implementations docs Improvements or additions to documentation 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.

CI: reduce Doctor startup and hosted core lint jobs

1 participant