Repository navigation
fix: preserve nested write uncertainty across lease failures - #150055
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 16, 2026, 8:51 AM ET / 12:51 UTC. ClawSweeper reviewWhat this changesPreserves unknown write outcomes found inside nested errors when a state lease fails, with regression coverage for error identity, cancellation, lease loss, and release behavior. Merge readiness✅ Ready for maintainer review The fix remains useful: current main preserves locally recorded uncertainty but can still replace nested uncertainty with cancellation or lease loss. No actionable patch defect was found. Priority: P2 Review scores
Verification
How this fits togetherState leases coordinate trusted operations against OpenClaw’s shared SQLite state. Their error boundary reports operation failures to caller recovery while the lease owner separately controls admission, settlement, and release. flowchart TD
A[Lease-scoped operation] --> B[Operation result or failure]
B --> C[Lease error boundary]
D[Locally recorded uncertainty] --> C
E[Nested errors and authority failure] --> C
C --> F[Classified failure for caller recovery]
B --> G[Owner-controlled drainage and release]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +5, Tests +192. Total +197 across 2 files. View PR surface stats
Review metricsNone. Technical reviewBest possible solution: Keep uncertainty classification in the existing lease owner while preserving original causes and the separate settlement-based release decision. Do we have a high-confidence way to reproduce the issue? Yes, from source: a lease callback rejecting with nested outcome-unknown after cancellation or lease loss reaches the current-main authority-error override. The added controls target that path; no native failure was reproduced in this review. Is this the best way to solve the issue? Yes. Extending the existing classifier with the shared error traversal addresses the missing case without introducing another owner or changing release authority. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 0aba68fd734d. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Merged via squash.
|
What Problem This Solves
An outer state lease could replace a nested unknown write outcome with a lease-loss or cancellation error, allowing caller recovery to treat uncertainty as an ordinary failure.
User Impact
Nested uncertainty now reaches caller recovery with its existing
outcome-unknownclassification. Direct Error objects retain their identity; structured markers keep their original cause. Combined failures retain the original failure and selected authority cause. Admission, settlement, and release behavior remain unchanged.Why This Change Was Made
The existing lease-owner classifier recognizes canonical uncertainty in the shared error graph when the outer owner has not recorded its own uncertain write. Locally recorded uncertainty keeps precedence. Non-Error markers use the existing uncertainty wrapper; this does not mark the outer owner's own settlement as unknown.
Evidence
Eight pure controls call the actual lease wrapper with fake storage and timers. The original source fails three uncertainty-precedence cases and the structured-marker normalization control; the fix passes all eight. All five existing owner regressions also pass. These controls cover direct and wrapped errors, loss and cancellation, error identity, and unchanged release behavior. They do not execute SQLite or heartbeat workers or reproduce a native failure.
All 31 selected static, type, lint, export, and guard checks passed. Both cycle checks found zero cycles; fresh independent review found no actionable issues.