Repository navigation
fix(doctor): keep database inspection captures out of operator state - #175173
Conversation
The physical database inspection added by #174912 loads plugin descriptors in a worker that does not inherit the caller's temporary capture scope. Apply the existing temporary capture context inside that worker so readonly Doctor does not leave plugin build captures under the operator's state. Keep the hosted Doctor regression bounded to its own fixture using lstat traversal, retaining every physical entry and symlink target. The old recursive snapshot followed capture links into the checkout and timed out. With only that snapshot correction, unchanged main adds 46 state entries; the production repair restores the existing unchanged-state assertion. Both process tests pass on Node with one worker (readonly case 20.44s). Production and owning test types, typed lint, format and independent P2 review pass. No timeout, retry or state exclusion changes.
|
🦞👀 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: needs maintainer review before merge. What this changesThis PR gives database inspection workers the existing temporary plugin-capture context and prevents the regression snapshot from following symlinks outside its fixture. Example: The setup assistant runs Doctor with plugins disabled and gateway.mode unset.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Regression provenanceRegression provenance — verified: source commit Merge readiness✅ Ready for maintainer review Keep this PR open: it repairs a current-main violation of Doctor’s read-only contract with a focused change and a meaningful regression test; no introduced correctness or security defect was found. Priority: P2 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherDoctor dispatches physical database inspection to a worker, which loads plugin descriptors and returns diagnostic facts; the plugin capture owner controls allocation and retention of any required source artifacts. flowchart TD
A[Doctor diagnostic request] --> B[Database inspection worker]
B --> C[Temporary capture context]
C --> D[Plugin descriptor loading]
D --> E[Existing capture lifecycle owner]
B --> F[Artifact preserving database reads]
F --> G[Health findings]
Technical reviewBest possible solution: Use the existing temporary capture owner inside the inspection worker while preserving database admission, artifact protection and diagnostic output. Do we have a high-confidence way to reproduce the issue? Current-main source shows descriptor loading inside a worker without the caller’s temporary capture context, and the PR reports a negative control producing 46 added state entries; this review ran no target code. Is this the best way to solve the issue? The repair belongs at the worker boundary and reuses the established capture lifecycle rather than suppressing state changes or introducing another owner. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against da3716812df5. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +4, Tests +10, Docs +1. Total +15 across 3 files. Added test files: 0. View PR surface stats
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 17, 2026, 1:55 AM ET / 05:55 UTC. |
…w#175173) The physical database inspection added by openclaw#174912 loads plugin descriptors in a worker that does not inherit the caller's temporary capture scope. Apply the existing temporary capture context inside that worker so readonly Doctor does not leave plugin build captures under the operator's state. Keep the hosted Doctor regression bounded to its own fixture using lstat traversal, retaining every physical entry and symlink target. The old recursive snapshot followed capture links into the checkout and timed out. With only that snapshot correction, unchanged main adds 46 state entries; the production repair restores the existing unchanged-state assertion. Both process tests pass on Node with one worker (readonly case 20.44s). Production and owning test types, typed lint, format and independent P2 review pass. No timeout, retry or state exclusion changes.
What Problem This Solves
Read-only Doctor writes plugin-build captures into operator state when its database inspection worker loads plugin APIs. The hosted-Doctor preservation test then follows a capture symlink into the checkout and stalls.
User Impact
Doctor can inspect databases without leaving plugin captures in the profile's state directory. Existing database admission, repair policy and physical inspection remain unchanged.
Why This Change Was Made
The caller's temporary capture context does not cross a Worker boundary. Apply the existing temporary plugin-capture scope inside that worker. Bound the regression snapshot to physical fixture entries with
lstat, retaining all entries, file hashes/times and symlink targets; no paths are excluded.The new descriptor loading in #174912 exposed this missing worker context. This complements #175169: applying that PR's inspection hunk alone still fails this regression with 46 added state entries, including a Reef capture. Avoiding absent-store descriptor loads does not replace the worker's capture-storage context.
Evidence
state/tmp/plugin-captures.pnpm test ... --maxWorkers=1.core-unit-src-security-3-hosted-2with an unexpected Vitest worker exit in this test file. The original local snapshot timed out. The precise CI worker-exit mechanism is unproven; the state mutation and unbounded symlink traversal are directly reproduced.The separate real-Gateway automation failure from the same hourly remains unattributed. Its local replay timed out earlier during bootstrap, before reaching the CI admin-result assertion. This PR does not claim to fix it.
Ready for maintainer review and landing; auto-merge is not enabled.