Repository navigation
fix: explain update refusals when an agent database is in use - #152976
Conversation
|
🦞👀 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: needs maintainer review before merge. Reviewed September 21, 2026, 4:11 AM ET / 08:11 UTC (Revision 11). ClawSweeper reviewWhat this changesThe PR gives busy agent-database refusals a specific, privacy-safe update explanation, adds early diagnostic detection, and strengthens refusal and test-synchronization coverage. Merge readiness✅ Ready for maintainer review This remains a useful reporting fix absent from current main. No introduced correctness or security defect was found; the previous generic migration-proof blocker is unsupported by the actual diff. Priority: P2 Review scores
Verification
How this fits togetherDoctor establishes exclusive maintenance access before repairing OpenClaw state. Its failure results pass through the updater into sanitized operator and public reports. flowchart TD
A[Update or Doctor request] --> B[External-service lease preflight]
B -->|Active lease| E[Safe refusal fact]
B -->|Otherwise| C[Acquire maintenance coordinators]
C --> D[Check leases under ownership]
D -->|Active lease| E
D -->|Admitted| F[Existing Doctor repairs]
E --> G[Updater result and sanitized report]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +70, Tests +402. Total +472 across 11 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Technical reviewBest possible solution: Keep lease refusal classification at Doctor admission and carry its fixed public explanation through the existing updater result and redaction owners. Do we have a high-confidence way to reproduce the issue? Yes, source establishes the path: a live agent lease causes maintenance refusal, and current main's generic wrapping and public redaction discard the useful reason. No runtime reproduction was executed during this read-only review. Is this the best way to solve the issue? Yes. The patch reuses existing failure facts and preserves maintenance checks; a schema migration or a second admission mechanism is unnecessary. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against b95d29c3b9ed. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (10 earlier review cycles; latest 8 shown)
|
b88654e to
b1ef050
Compare
|
Merged via squash.
|
…aw#152976) * fix: explain update refusals when an agent database is in use * test: require safe typed lease refusals in Doctor flows * fix: classify external agent leases before maintenance locks * refactor: isolate Doctor agent-lease admission * test(doctor): isolate installation consent runtime fixture Apply the consent-only correction published in openclaw#147120 at 3f967cf, adapted to the exact current-main fixture. Preserve real runtime-path auditing and cover denied, approved, and noninteractive version-managed runtime consent. Production and package inputs are unchanged. * test: wait for elicitation prompt delivery before inspecting it
Related: #152914
What Problem This Solves
An update refused because an agent database is in use loses its useful refusal reason in the public failure report.
User Impact
Operators receive a fixed explanation and retry guidance instead of a generic Doctor failure. Unsafe maintenance still refuses, private lease details remain redacted, and existing resource release and service restoration behavior is preserved.
This PR fixes refusal reporting. It does not claim to diagnose or resolve the original macOS incident in #152914.
Why This Change Was Made
Classify the real typed lease refusal at Doctor admission, carry the safe fact through the existing Doctor result and update finalization path, and allow only the exact public code and guidance through redaction. External-service preflight can only refuse; an empty or failed observation cannot authorize repairs and still requires both coordinators and the held-owner check.
Current-main integration preserves awaited coordinator acquisition and the existing service owner. A macOS test expectation now matches the canonical service policy: a loaded launchd job is not offline merely because it is disabled.
Evidence
b234aa53d5c15b78c97197414569243592ad1212: 209 focused tests passed across Doctor flow, maintenance settlement/installation, public identifiers, and redaction.6a4dd2f84901a987d97a3c1867789a0e38cadb30adds one wait on actual prompt delivery; all pending/answer assertions remain. Its 26 targeted tests and independent P0–P2 review passed. No production/package inputs changed, so the prior build and built-CLI proof remain applicable. The resulting exact-head CI run 35573749019 completed successfully. Dependency and security-sensitive reviews also passed.Compatibility and bounded acceptance
No schema, migration, backfill, retention, protocol field, or database write-admission change is introduced. The existing Doctor failure-fact contract is reused. The lease reader opens the existing database read-only, never repairs its schema or deletes stale rows, and the held-owner assertion still checks it before repairs.
Historical published 2026.9.4-driver evidence established actual candidate-child refusal, unchanged synthetic state and config, and continued service availability. That older parent does not support typed failureFacts; its nonzero/stderr result is not typed-parent evidence. Historical rollback-verification timeout (52,991 ms) and backup-retention exit 1 (84,668 ms) remain unresolved in the broader updater investigation, not established regressions introduced by this reporting delta. This PR does not claim end-to-end update recovery, no-loss, global descriptor history, or native-service acceptance from source tests.
The landing assessment scopes those broader investigations separately. Resulting-source review, affected real-state flow tests, built-CLI refusal/IPC proof, unchanged main-owned restoration code, and exact-head CI establish the bounded reporting change; no live operator Gateway or retained investigation fixture is used.