Repository navigation
Conversation
A .git/config under a TCC-protected folder blocks open() on a headless macOS server until a privacy prompt nobody sees is answered. Each scan retry parked another libuv pool thread until the pool was exhausted and every fs and DNS operation hung. Read .git metadata with O_NONBLOCK, a regular-file check, a 2 s timeout, and at most one native read in flight. Fixes pingdotgg#15971 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ApprovabilityVerdict: Not approved Macroscope's review found this PR not approvable — This production server bug fix introduces a new bounded native filesystem reader and changes existing session-scan I/O behavior. It also adds file-level Notes:
You can add or adjust custom eligibility rules. Learn more. |
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. 🧰 Additional context used📚 Code guidelines (1)No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (4)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review. 📝 WalkthroughWalkthroughGit metadata reads in ChangesBounded Git Metadata Reads
Priority: ⬆️ High Estimated code review effort: 3 (Moderate) | ~20 minutes Change: Bug fix · Severity of issue fixed: High Suggested reviewers: Merge Risk: ⚪ Minimal · up to The bounded Git metadata reads preserve scan completion and filesystem responsiveness in the tested blocked-read scenario. No identified issue needs resolution before merge. Security Architecture ReviewSecurity architecture risk: ⚪ Minimal · up to The change contains blocked Git metadata reads without adding a public endpoint, increasing privileges, or changing authorization. Unreadable metadata keeps its existing fallback behavior. No material security risk was found to be introduced or worsened. Retained concerns Security review detailsSecurity Blast Radius
Trust Boundaries and Controls
Resilience and Maintainability Implications
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
Taking over this one for maintainer batch worktree-git-10. I am checking the native filesystem-boundary approach and the macOS verification requirement before rebuilding or publishing changes. |
|
Blocked on native macOS verification; no implementation changes or push. The current scanner still reads Required human verification before rebuilding/publishing:
I am leaving the original PR open and credited to @azgul. This Linux batch cannot provide the required macOS proof, so publishing a rebuilt native-reader implementation would be unverified. |
|
Closing in favour of #23690, which makes the same change. Thanks for the work here! |
Problem
On a headless macOS server (
t3 service), the agent-session scan reads.git/configfor each transcriptcwd. Under a TCC-protected folder (~/Documents,~/Desktop) thatopen()waits on a privacy prompt nobody can answer and never returns. Fiber interruption doesn't release the libuv pool thread, so client retries fill the pool and every fs and DNS operation in the process hangs. Details and live-process evidence: #15971.Change
readGitIdentityreads.gitand.git/configthroughmakeBoundedFileReader(project/boundedFileRead.ts):O_NONBLOCKopen plus an fstat check that it's a regular file of at most 64 KB (covers FIFOs)open()holds one pool thread at mostgit: { remoteKey: null, repository: null })Scope and approval
Fixes #15971 (not yet triaged). One problem: the scanner's two
.gitreads. No contract or client changes.Verification
scan with a git config whose open() never returns):.git/configis a FIFO, the scan runs pool-size + 1 times, then an unrelated read must succeed within 3 s. On main it hangs past the 60 s test timeout and teardown then stalls too. With the fix it passes in 21 ms.boundedFileRead.test.ts: a read that never settles (the TCC case, whereO_NONBLOCKdoesn't help) is issued once and later calls returnnone; reading resumes once the stuck read returns; concurrent reads are serialized, not dropped; a rejected read returnsnone.vp test run src/project/: 198 passed.tsc --noEmitin apps/server: 0 errors.vp lintandvp fmt --checkare clean onsrc/project.Model and harness: Claude Opus 5.5 in Claude Code.
🤖 Generated with Claude Code