Repository navigation
fix(doctor): classify critical disk exhaustion as error - #125644
Conversation
Doctor's human output labels less than 100 MB free as CRITICAL because config, session, and log writes may fail silently and lose data. The structured lint finding still used warning, so --severity-min error filtered it out, returned ok=true, and exited successfully. Share the threshold decision between the structured severity and requirement: critical is error, low space remains warning. Update the regression contract accordingly.
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 18, 2026, 2:08 AM ET / 06:08 UTC. ClawSweeper reviewWhat this changesThis PR makes Doctor emit an error-level structured finding, rather than a warning, when the OpenClaw state partition has under 100 MB free. Merge readinessKeep open: current main still reports critical disk exhaustion as a warning, so this small producer-level fix remains necessary and appears correct. The remaining merge gate is exact-head validation; the intentional exit-status change for existing error-gated automation should be acknowledged. Priority: P2 Review scores
Verification
Live VerificationCommand: Result: FAIL (partial) Assertions:
How this fits togetherDoctor collects health findings from core checks and renders them for operators or lint automation. The disk-space contribution feeds the severity filter, JSON output, and lint exit code. flowchart LR
A[State directory] --> B[Disk-space probe]
B --> C[Doctor disk finding]
C --> D{Free space below 100 MB}
D -->|Yes| E[Error severity]
D -->|No, below 500 MB| F[Warning severity]
E --> G[Lint filter and exit status]
F --> G
Before merge
Agent review detailsSecurityNone. PR surfaceSource 0, Tests 0. Total 0 across 2 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep severity classification at the disk-space finding producer, as this PR does, and merge after exact-head checks confirm the intended critical error gate. Do we have a high-confidence way to reproduce the issue? Yes, source-reproducible: current main emits a warning for a 50 MB critical finding, while the lint severity contract excludes warnings at Is this the best way to solve the issue? Yes. Assigning severity at the disk-space finding producer is the narrow canonical repair; changing global lint filtering would incorrectly alter unrelated warning behavior. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 1c3e512096bc. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Merged via squash.
|
) Doctor's human output labels less than 100 MB free as CRITICAL because config, session, and log writes may fail silently and lose data. The structured lint finding still used warning, so --severity-min error filtered it out, returned ok=true, and exited successfully. Share the threshold decision between the structured severity and requirement: critical is error, low space remains warning. Update the regression contract accordingly.
What Problem This Solves
Doctor’s human output calls less than 100 MB free CRITICAL because config writes, session transcripts, and log rotation may fail silently and cause data loss. The structured health finding nevertheless used
severity: "warning". As a result,openclaw doctor --lint --all --severity-min error --jsonfiltered the critical disk condition out, returnedok: true, and exited successfully.Why This Change Was Made
Reuse the existing critical threshold for both the structured finding severity and requirement. Below 100 MB is now
error/critical-free-space; 100–500 MB remainswarning/low-free-space. Human output and thresholds are unchanged.User Impact
Automation and operators relying on Doctor’s error gate can no longer miss imminent write failures and data-loss risk due to critically low disk space.
Evidence
node scripts/run-vitest.mjs run src/commands/doctor-disk-space.test.ts→ 24/24 pass on rebased head.node scripts/run-tsgo.mjs -p tsconfig.core.json→ rc 0.oxlint+oxfmton touched files → rc 0 / clean.