Skip to content

test(doctor): keep autostart policy independent of process state - #185277

Merged
steipete merged 1 commit into
mainfrom
steipete/perf-micro-red-main-bun-shards-20260919
Oct 27, 2026
Merged

steipete merged 1 commit into
mainfrom
steipete/perf-micro-red-main-bun-shards-20260919

Conversation

@steipete

@steipete steipete commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes Doctor health tests that report an autostart-policy change when their fake service merely stops for maintenance. This repairs inherited red reported in CI run 40425367262.

User Impact

No production behavior changes. Doctor's live autostart-policy revalidation remains intact, including refusal to restore a service when its policy changes.

Why This Change Was Made

#180356 (8346eba79034) correctly captured and rechecked native autostart policy across maintenance. Two service fixtures incorrectly implemented isEnabled() using their mutable process-running flag, so stop() fabricated a policy change. Keep the simulated enabled policy true independently of process state. The shared fixture repair also fixes its managed-health consumers; all assertions are unchanged.

The separately reported Gateway failures were traced to #185106's eager agent-job listener import. The shared fixture erased that process-owned listener. #185224 landed the listener-preservation repair during this investigation, so this PR contains only the Doctor fixes. Ancestry checks confirm #185224 was absent from both the original evidence build 90e227861c32 and our reproduced base ea7081745b7f.

Evidence

  • Unchanged base ea7081745b7f: legacy-update reproduces 3 failures / 3 passes under both pinned Bun and Node. The managed-settlement sibling also reproduces the same policy refusal under Node (8 failures / 1 pass).
  • Candidate pinned Bun: all four Doctor fixture consumers pass (30 tests; 380.29 s Vitest, 422.29 s wrapper). After rebase, Node legacy-update + managed-settlement pass 15/15 (215.60 s Vitest); the unchanged autostart-policy guard passes all five selected cases on Bun (20.33 s). This retains refusal coverage for changed/unavailable policy.
  • Gateway confirmation with perf(gateway): avoid redundant active-run projection scans #185224 on current main: both original Gateway files pass 15/15 on pinned Bun (103.63 s) and Node (48.13 s), without modifying their tests or the void-returning command fixture.
  • Changed-file oxfmt, repository oxlint, and git diff --check pass.
  • Independent subagent review (autoreview route unavailable): no actionable P0/P1/P2 findings. The configured autoreview provider was refused because it did not match the operator configuration; no configuration was changed.
  • Broad proof: PR CI run 40430221422, exact head dcee79a0f2f72f3c48bf07716a8901ddb0101f8c. No CI reruns requested.
  • Production LOC delta: 0. Test-fixture delta: +4/-2. No assertions, timeouts, or skips changed. No benchmark or load test: this changes only fixtures.

@clawsweeper

clawsweeper Bot commented Oct 27, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@steipete
steipete marked this pull request as ready for review October 27, 2026 01:02
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-27T01:04:37.619384Z dcee79a Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@steipete
steipete merged commit 217817b into main Oct 27, 2026
196 of 197 checks passed
@steipete
steipete deleted the steipete/perf-micro-red-main-bun-shards-20260919 branch October 27, 2026 01:15
sectrgt pushed a commit to sectrgt/openclaw that referenced this pull request Nov 2, 2026
The openclaw#180356 backport (7065121) refuses Gateway restoration when native
autostart policy changes during Doctor repair. The managed doctor-health fixture
reported isEnabled as the current running state, so stopping the Gateway looked
like a policy change. Main fixed the fixture in openclaw#185277; the release's
legacy-update fixture already carried the equivalent adaptation.

Release adaptation: applied the managed test-support hunk by hand; the file's
structure diverged from main.

(cherry picked from commit 217817b, src/flows/doctor-health.managed.test-support.ts hunk only)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant