Skip to content

test: shorten Doctor migration-order process checks - #159609

Merged
steipete merged 1 commit into
mainfrom
codex/test-doctor-migration-concurrency-fb720
Sep 27, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/test-doctor-migration-concurrency-fb720

Conversation

@steipete

@steipete steipete commented Sep 27, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Doctor's migration-order process tests run three independent state fixtures sequentially, extending the test command even though each case owns its databases, configuration, and port.

User Impact

There is no user-visible behavior change. The measured test command completes about 11 seconds sooner than the warm baseline. Mean total CPU increased by 3.8%; this is a wall-time improvement, not a CPU or memory saving.

Why This Change Was Made

Run the three isolated cases concurrently through Vitest and bind child diagnostic cleanup to each case's test context. The shared helper keeps its existing default for serial callers. All five real Doctor invocations, migration ordering, repeated-run idempotency, lost-journal byte preservation, output limits, deadlines, and cleanup remain intact.

Vitest owns the concurrency limit. Its existing --maxConcurrency=1 option provides serial execution; --maxWorkers independently limits file workers. Aggregate concurrent memory and constrained-host performance have not been measured.

Evidence

Blacksmith Testbox comparison at fb720291b0a30ddf67336fe2c87dbebfac01db45, using the ordinary command pnpm test src/commands/doctor-agent-database-order.process.test.ts with normal runtime build and worker preparation included:

Arm Command wall
Baseline A1 82.107 s
Candidate B1 67.503 s
Candidate B2 67.439 s
Baseline A2 78.235 s

Both candidate arms beat warm A2 by 13.7–13.8%. All 12 case executions passed, preserving the same identities and assertions. The longest candidate case took 17.221 s under the unchanged 60 s child deadline. Native preparation and build timings overlap with command wall and must not be added to it.

Comparison run. Source restoration, process settlement, and completed lease cleanup were verified. No test retries.

Qualification run passed all 21 case executions and the 21 selected changed-file checks, including all 15 test typecheck graphs. Single-file author costs (pnpm test <file> --maxWorkers=1, normal preparation included):

Test file Passed cases Command wall
Doctor migration order 3 63.635 s
Doctor runtime diagnostics 3 16.526 s
Doctor output 8 57.657 s
Skills SAG 4 30.692 s

Doctor also passed all three cases with --maxWorkers=1 --maxConcurrency=1 in 74.321 s, in exact source order. This validates the existing serial option; it is not a constrained-hardware benchmark. The changed-file gate took 747.009 s. These tests retain real built CLI and process flows because mocks would omit bootstrap, migration, and diagnostic behavior. No new test cases were added.

Independent P0–P2 review found no actionable issues. Hosted CI passed on published head f9bc5317b81b518e7e61c85255a3f9484c67a8f4 (attempt 1: 68 successful jobs, 22 intentional skips). All 18 cases across the four edited test files passed. The shared helper selected 35 changed-test jobs.

Changed file Passed cases Sum of reported case durations Containing group: files / cases / Vitest wall
Doctor migration order 3 68.063 s 3 / 30 passed / 144.85 s
Doctor runtime diagnostics 3 1.423 s 23 / 202 passed / 124.35 s
Doctor output 8 45.783 s 3 / 31 passed / 111.15 s
Skills SAG 4 15.276 s 5 / 33 passed + 1 skipped / 127.84 s

Case-duration sums are not standalone file wall times; the three migration cases overlap. The three containing commands took 148.60 s, 270.74 s, and 274.65 s; their jobs took 243 s, 327 s, 334 s including setup. Recorded normal worker preparation was 13.929 / 14.622 / 20.972 s, already included rather than additive. Doctor output and Skills SAG share the third job.

Original checkout logs bind this proof to merge fdb1a8a1ce12fda9762c6ebe30f567a65ecb067d, containing the published head and main 7f43b351149930f7db5b4545ad4df4693fe168fc. These hosted costs do not replace the controlled comparison or establish aggregate-memory savings. Completed ClawSweeper review found no actionable correctness or security issues; the reviewer could not access the linked raw Testbox logs, which the maintainer verified independently.

Post-merge verification at 1ab9e1baec39aa3d1ce8a538d1e788603d229b1d: all six smoke cases passed with Node 24.19.0 and the landed revision's pnpm 12.5.0 dependencies. The ordinary Doctor migration-order and runtime-diagnostics commands took 66.817 s and 15.800 s, including normal preparation. Source, dependency, index, process settlement, and completed lease cleanup were verified.

@clawsweeper

clawsweeper Bot commented Sep 27, 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 cli CLI command changes commands Command implementations size: XS labels Sep 27, 2026
@steipete
steipete marked this pull request as ready for review September 27, 2026 11:17
@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. 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 27, 2026
@clawsweeper

clawsweeper Bot commented Sep 27, 2026

Copy link
Copy Markdown
Contributor

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

ClawSweeper review

What this changes

The branch runs three isolated Doctor migration-order checks concurrently and binds child diagnostic cleanup to each test, while adapting other callers to the helper’s options argument.

Merge readiness

✅ Ready for maintainer review

Current main still runs the three cases serially. This is a focused test optimization with no actionable correctness defect found, so the PR remains useful.

Priority: P3
Reviewed head: f9bc5317b81b518e7e61c85255a3f9484c67a8f4

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A narrow test change has detailed real-process comparison results and no identified correctness defect.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (live_output): The changed Vitest suite invokes the built Doctor CLI for three isolated state scenarios; the captured PR body reports after-change Testbox timings, passing cases, and a passing serial-control run. Linked logs were inaccessible to this reviewer, and 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 (live_output): The changed Vitest suite invokes the built Doctor CLI for three isolated state scenarios; the captured PR body reports after-change Testbox timings, passing cases, and a passing serial-control run. Linked logs were inaccessible to this reviewer, and no stored-data contract changes.
Evidence reviewed 6 items Introduced change: The pinned PR delta changes the three migration scenarios to Vitest concurrent cases and passes each case’s cleanup callback to the real CLI child helper.
Case isolation and preserved checks: Each case has its own home, config and state paths, claims a port, and retains migration, byte-preservation and repeated-run assertions.
Cleanup ownership: The child helper accepts a test-specific completion callback while retaining its prior default for serial callers.
Findings None None.
Security None None.

How this fits together

Doctor is OpenClaw’s CLI repair command for configuration and stored state. This process suite seeds separate state fixtures, runs the built CLI, and checks migration order and persisted results.

flowchart LR
A[Built CLI] --> C[Concurrent test cases]
B[Three state fixtures] --> C
C --> D[Isolated Doctor processes]
D --> E[Migration assertions]
E --> F[Per-test cleanup]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Tests +11. Total +11 across 6 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 6 27 16 +11
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 6 27 16 +11

Review metrics

Metric Value Why it matters
Reported warm command wall time 78.235 s → 67.439 s (10.796 s faster) The PR body compares the same built-CLI test command before and after the scheduling change.

Technical review

Best possible solution:

Keep the existing Doctor process assertions and per-case cleanup under Vitest’s concurrency controls.

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

Not applicable as a product bug. Current main shows the serial baseline, and the PR body reports a four-arm process-command comparison.

Is this the best way to solve the issue?

Yes. The cases already have separate state and ports, and the patch uses Vitest’s concurrency mechanism while keeping diagnostic cleanup tied to each case.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 2d65bdd956d9.

Labels

Label changes:

  • add P3: This is an internal test-time improvement with no user-visible behavior change.
  • add proof: sufficient: Contributor real behavior proof is sufficient. The changed Vitest suite invokes the built Doctor CLI for three isolated state scenarios; the captured PR body reports after-change Testbox timings, passing cases, and a passing serial-control run. Linked logs were inaccessible to this reviewer, and 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 (live_output): The changed Vitest suite invokes the built Doctor CLI for three isolated state scenarios; the captured PR body reports after-change Testbox timings, passing cases, and a passing serial-control run. Linked logs were inaccessible to this reviewer, and no stored-data contract changes.

Label justifications:

  • P3: This is an internal test-time improvement with no user-visible behavior change.
  • 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 (live_output): The changed Vitest suite invokes the built Doctor CLI for three isolated state scenarios; the captured PR body reports after-change Testbox timings, passing cases, and a passing serial-control run. Linked logs were inaccessible to this reviewer, and no stored-data contract changes.
  • proof: sufficient: Contributor real behavior proof is sufficient. The changed Vitest suite invokes the built Doctor CLI for three isolated state scenarios; the captured PR body reports after-change Testbox timings, passing cases, and a passing serial-control run. Linked logs were inaccessible to this reviewer, and no stored-data contract changes.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit 10453a8 adds src/commands/doctor-agent-database-order.process.test.ts:22 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 10453a8d8b28; files: src/commands/doctor-agent-database-order.process.test.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 merged commit 1ab9e1b into main Sep 27, 2026
226 of 227 checks passed
@steipete
steipete deleted the codex/test-doctor-migration-concurrency-fb720 branch September 27, 2026 12:10
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

vincentkoc added a commit that referenced this pull request Sep 27, 2026
* commit '69809d7a94277d01be964bd1cbbb7aa0ebc58c9b': (219 commits)
  perf(agents): serialize large model requests once (#159574)
  refactor(cli): share capability agent-selection test cases (#159616)
  fix(workers): restore installation type checks (#159629)
  test(channels,qa,providers): remove low-value tests (batch d065) (#159627)
  test(doctor): run isolated migration cases concurrently (#159609)
  feat(apple): show agent identities in native chat (#159528)
  chore(i18n): refresh native locales (#159635)
  fix(gateway): keep node provisioning's installation contract after overlapped preparation
  fix(models): keep shared catalog requests alive for remaining callers (#157191)
  feat: let agents query online people and device activity (#159117)
  perf(gateway): first cloud dispatch prepares worker artifacts one after another (#159520)
  refactor(android): deslop Android app third pass (#159589)
  test(qa-lab,openshell,slack,reef,team-reports): remove low-value tests (batch d064) (#159607)
  fix: align process liveness checks (#151107) thanks @ekinnee
  fix: sessions model default does not clear the override (#159587)
  fix(ios): preserve typing during reentrant SwiftUI updates
  fix(ci): frozen 2026.8.33 validation fails on inherited test clock (#159594)
  perf(gateway): avoid duplicate recipient row lookup (#159595)
  refactor(gateway): deslop gateway fourth pass (#158786)
  test(agents): split subagent task-settlement test support under the line cap (#159584)
  ...
vincentkoc added a commit that referenced this pull request Sep 27, 2026
* commit '69809d7a94277d01be964bd1cbbb7aa0ebc58c9b': (219 commits)
  perf(agents): serialize large model requests once (#159574)
  refactor(cli): share capability agent-selection test cases (#159616)
  fix(workers): restore installation type checks (#159629)
  test(channels,qa,providers): remove low-value tests (batch d065) (#159627)
  test(doctor): run isolated migration cases concurrently (#159609)
  feat(apple): show agent identities in native chat (#159528)
  chore(i18n): refresh native locales (#159635)
  fix(gateway): keep node provisioning's installation contract after overlapped preparation
  fix(models): keep shared catalog requests alive for remaining callers (#157191)
  feat: let agents query online people and device activity (#159117)
  perf(gateway): first cloud dispatch prepares worker artifacts one after another (#159520)
  refactor(android): deslop Android app third pass (#159589)
  test(qa-lab,openshell,slack,reef,team-reports): remove low-value tests (batch d064) (#159607)
  fix: align process liveness checks (#151107) thanks @ekinnee
  fix: sessions model default does not clear the override (#159587)
  fix(ios): preserve typing during reentrant SwiftUI updates
  fix(ci): frozen 2026.8.33 validation fails on inherited test clock (#159594)
  perf(gateway): avoid duplicate recipient row lookup (#159595)
  refactor(gateway): deslop gateway fourth pass (#158786)
  test(agents): split subagent task-settlement test support under the line cap (#159584)
  ...
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 28, 2026
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 P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XS 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