Repository navigation
refactor(infra): share error cause reader - #130280
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 31, 2026, 1:25 AM ET / 05:25 UTC. ClawSweeper reviewWhat this changesThe branch centralizes direct reads of an error’s Merge readinessNo introduced functional or security defect was found. This MEMBER-authored PR remains open for explicit maintainer handling after exact-head required checks complete. Priority: P3 Review scores
Verification
How this fits togetherOpenClaw’s shared error utilities feed process-level fault classification and provider retry decisions. These consumers use error metadata to choose either terminal handling or a bounded retry. flowchart LR
A[Runtime error] --> B[Shared error utilities]
B --> C[Direct cause reader]
C --> D[Unhandled rejection classification]
C --> E[Provider retry decision]
D --> F[Process outcome]
E --> G[Retry or surfaced failure]
Decision needed
Why: The protected Before merge
Agent review detailsSecurityNone. PR surfaceSource -6, Tests +29, Other 0. Total +23 across 5 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Retain one narrowly scoped direct cause-reader in the shared error utility and merge only after a maintainer confirms the exact head meets repository gates. Do we have a high-confidence way to reproduce the issue? Not applicable: this PR consolidates an internal helper rather than reporting a user-facing defect. Is this the best way to solve the issue? Yes. The shared error utility is the existing owner of adjacent error readers, and keeping self-cycle and graph-traversal policy in the consumers preserves their distinct responsibilities. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 0ee6e0575a90. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (3 earlier review cycles) |
b6c7b1e to
32a0412
Compare
32a0412 to
5378e0b
Compare
|
Land-ready verification for exact head
No known proof gaps. |
|
Merged via squash.
|
* refactor(infra): share error cause reader * chore: refresh PR checks
What Problem This Solves
Unhandled-rejection classification and provider retry logic independently implemented the same direct error-cause reader. Keeping those helpers duplicated makes their deliberately narrow object-only contract easier to drift.
Why This Change Was Made
Add one private
readErrorCausehelper beside the existing error readers and reuse it from both consumers. The helper preserves direct property access, arbitrary cause values, self-references, and throwing getter behavior; recursive and guarded error readers remain separate.User Impact
No user-visible behavior change. Error-cause inspection now has one canonical implementation for these two runtime paths.
Evidence
pnpm check:import-cycles: 0 runtime value cycles.check-changed: passed.run_ceabb7e07af8on leasecbx_7378729265c2: fresh public/no-role/no-Tailscale checkout at exact head, frozen install, 120 focused tests passed; lease released.umask 022to be prepended because the current AWS image otherwise creates its root-owned Node install unreadable to thecrabboxuser; no PR code was changed for the workaround.