Repository navigation
fix(write): report descriptor exhaustion accurately - #742
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: blocked before merge. Reviewed September 27, 2026, 11:24 PM ET / September 28, 2026, 03:24 UTC. ClawSweeper reviewWhat this changesThe PR preserves POSIX descriptor-limit error codes and changes guarded writes to report them as operational failures while retaining the original causes and staged-file receipts. Merge readiness⛔ Blocked before merge - 4 items remain Keep open: current main still misclassifies descriptor exhaustion, and this focused PR has credible native-path validation. It remains a useful merge candidate. Priority: P2 Review scores
Verification
How this fits togetherThe Root write API checks paths and identities before staging and publishing files. Native POSIX operations feed errors back through the write-error normalizer, which determines the public error and recovery receipt. flowchart LR
A[Root write request] --> B[Path and identity checks]
B --> C[Native staged write]
C --> D{Native outcome}
D -->|Descriptor limit| E[Operational error and stage receipt]
D -->|Success| F[Published file]
D -->|Other failure| G[Existing error classification]
Decision needed
Why: Error codes are a documented compatibility surface, and the desired diagnostic necessarily changes what existing catch-by-code consumers observe. Before merge
Findings
Agent review detailsSecurityNone. Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Ship the accurate descriptor-limit classification with preserved publication receipts and a concise Unreleased migration note for code-based error handling. Do we have a high-confidence way to reproduce the issue? Yes. Current-main source shows the misleading fallback, and the PR describes a concrete native-required descriptor-limit run with before and after observations; this read-only review did not rerun it. Is this the best way to solve the issue? Yes. Passing through the native errno and correcting the shared write diagnostic is a focused repair that leaves publication and cleanup decisions in their existing owners. Full review comments:
Overall correctness: patch is correct AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against a883ae66a2af. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
Native writes under descriptor pressure could preserve a stage correctly while throwing
invalid-path: path is not a regular file under root. The native error had also collapsedEMFILEintoEIO.Retain
EMFILE/ENFILEin the POSIX binding and report descriptor exhaustion ashelper-failed/operational, including across aggregate and suppressed failures. The outer message explicitly names indeterminate publication and the preserved stage, and retains the original cause chain and cleanup receipt. Boundary failures remain primary. Publication classification, cleanup decisions, descriptor ownership, and stage contents are unchanged.The regression fills a subprocess's descriptor table under
ulimit -n 64on Linux and macOS. On macOS, three and four spare descriptors reproduce preserved complete stages; five through eight allow publication. Before:invalid-path: path is not a regular file under root, with an innerEIO. After:helper-failed: filesystem write failed: too many open files (EMFILE); publication outcome is indeterminate; staged file preserved, with the innerEMFILEand a preserved/closed cleanup receipt.Validation: 73 focused tests passed on macOS, including the real descriptor-limit harness, existing staging failures, and guarded write diagnostics. TypeScript/native builds and diff checks passed. Full local checks encountered unrelated watch/copy/queue timeouts under host load and were stopped; hosted full checks provide the complete-suite proof. Independent Codex review is clean through P2. Exact-head hosted CI and coverage are green for
7f7ff48ea5ac71c5d06465716bb71450e7b30779: CI, coverage. The full rollup is 41 successful checks and six conditional skips, with no pending/failing checks; the Linux and macOS native coverage lanes execute the real descriptor-limit regression. No changelog edit; leave unmerged.