Repository navigation
fix(doctor): preserve sandboxed and live profile diagnostics - #174147
Conversation
Report the Doctor process SQLite selection independently of host-service repair. Read Darwin Bun process groups through libproc so sandboxed broker cleanup retains its census without executing setuid ps. Consume completed same-source runtime-pin migration receipts before offline custody. Keep pending migrations exclusive and name the same-profile stop, repair, and restart sequence.
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex review: blocked before merge. What this changesThis PR restores SQLite diagnostics, adds native Darwin Bun process census support, and avoids reacquiring offline ownership for completed runtime-pin migrations. Example: Run openclaw doctor --non-interactive against an already migrated profile whose Gateway is running.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Blocked before merge - 1 item remains Keep open: this maintainer-authored PR fixes source-confirmed Doctor defects that remain on current main; no discrete introduced correctness defect was found. Priority: P2 Before merge
FindingsNone. Tests
Agent review detailsHow this fits togetherDoctor consumes configuration, migration receipts, and process observations to produce diagnostics and perform admitted repairs; the process supervisor supplies cleanup evidence to its existing consumers. flowchart TD
CLI[Doctor CLI] --> DB[Database diagnostics]
CLI --> Migration[Runtime pin migration]
Migration --> Receipt[Local migration receipt]
Migration --> Custody[Exclusive state ownership]
CLI --> Cleanup[Process cleanup]
Cleanup --> Census[Darwin native census]
Technical reviewBest possible solution: Keep diagnostics with their database owner and preserve exclusive custody only for migrations that still have work. Do we have a high-confidence way to reproduce the issue? Current-main source shows the service-dependent SQLite diagnostic, completed-receipt check behind exclusive custody, and Darwin ps dependency; this read-only review executed no target code. Is this the best way to solve the issue? The patch fixes the owning boundaries directly, removes the old diagnostic location, and preserves pending-migration exclusion and cleanup uncertainty. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 8858de49e356. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +135, Tests +220, Docs +18, Other +7. Total +380 across 15 files. Added test files: 1. View PR surface stats
Review metrics
LabelsLabel changes:
Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed October 16, 2026, 7:40 AM ET / 11:40 UTC. |
|
Merged via squash.
|
…w#174147) * fix(doctor): preserve sandboxed and live profile diagnostics Report the Doctor process SQLite selection independently of host-service repair. Read Darwin Bun process groups through libproc so sandboxed broker cleanup retains its census without executing setuid ps. Consume completed same-source runtime-pin migration receipts before offline custody. Keep pending migrations exclusive and name the same-profile stop, repair, and restart sequence. * test(process): preserve exports in Darwin census mock * fix(tooling): include Darwin census in PR wrapper sources * test(standalone): accept wrapped SQLite diagnostics
* fix(process): backport native Darwin group inspection Backport the process census and supervisor tests from #174147. The independent Doctor diagnostics and runtime-pin migration changes are excluded. (cherry picked from commit 6d50f72) * refactor(process): backport the shared Darwin inspection owner Backport the process owner, SDK exports, Codex consumer and their tests from #174284. The independent credential detection and onboarding changes are excluded. Preserve the release branch's unrelated diagnostic documentation. (cherry picked from commit 4959773) * refactor(process): share native macOS census across runtimes Backport #175368. Retain fs-safe 0.26.5 and adapt native census fixtures to the release branch. Carries the approved DarwinProcess uid-to-owner SDK migration; the following package pin completes the exit-window repair. (cherry picked from commit f236b19) * fix(codex): retry post-kill observations through the native exit window Backport #176576. Keep custody while retrying observations after our own SIGKILL within the existing containment deadline. (cherry picked from commit 5f94dfb) * fix(process): preserve macOS cleanup while unrelated processes exit Backport #176612. Pin proc-safe 0.4.2 and its exact native package exclusions, retain the real exiting-process regression, and align the SDK summary with native inspection on both runtimes. Retain the release branch's other dependency pins and exemptions. (cherry picked from commit 727c607) * test(process): reuse the process group inspection helper
What Problem This Solves
Sandboxed standalone Doctor could exit successfully without reporting its selected SQLite library, then log a spawn-broker cleanup failure. Doctor also requested offline state ownership for an already completed runtime-pin migration while Gateway was running.
Related: #173154, #172703.
User Impact
Doctor reports its selected SQLite library independently of host-service repair. Darwin Bun can verify process retirement inside the documented macOS sandbox without executing
/bin/psor adding a sandbox allowance. Doctor diagnoses an already migrated profile while its Gateway runs. Pending migration still requires exclusive ownership and now names the same-profile stop,doctor --fix, and restart sequence.Why This Change Was Made
The database contribution owns the SQLite diagnostic. Darwin Bun obtains numeric process facts from public
libprocthrough built-in FFI; proc-safe still owns exact argv inspection. Missing or incomplete observations remain errors. The native source is included in the PR wrapper inventory because those tools also use the process supervisor.A completed migration receipt for the same source returns before offline custody; actual work rechecks under custody. Pending migration is deliberately not deferred: config normalization must not discard legacy fields before their state import. The manual standalone verifier tolerates terminal-panel wrapping while still asserting the selected library path and rejecting cleanup failures.
Evidence
pnpm test <file> --maxWorkers=1wall times: 3.36s, 90.85s, 6.71s, 8.19s, and 121.32s respectively; cold worker compilation dominates the two longer runs.29950821e918286affb53ee1fe4d62ac947c96f8. The final follow-up only normalizes the manual verifier's whitespace assertion; product/runtime/build inputs are unchanged.Final-head CI is green: run 38897059351, head
9ca6385c7489d26878574ef3697197d8b08adb32. Native workflow merged this head as6d50f72d970c86c02a97b20583e30b9487a48e4d; no inherited-failure exception was needed.Earlier CI caught a missing PR-wrapper inventory entry, which was fixed and rechecked. An earlier run also hit an inherited assertion-baseline shrink in
src/media/media-facts.ts; it was independently reproduced on that run's main baseline. The final run passed. The PR-context check was corrected by restoring the required Evidence heading after the proof update.