Repository navigation
fix(worker): hold one fd per level of depth in list_files - #41
Merged
Merged
Conversation
- sandbox: bound the wait on a stuck exec stream after a timeout kill - workspace: cap the nested .git scan and fail closed over the cap - models: truncation marker names the cap actually applied - tools, phi: SandboxError is one failed step / an inconclusive phi
_find_name kept every directory it found open until the scan ended, so a checkout with about a thousand directories ran out of descriptors under the usual 1024 soft limit. With the fail-closed handling in this PR, every git step on such a checkout (diff, changed paths, the Phi path check) was then refused. The scan now keeps only the directories on the current path open.
OfficialAbhinavSingh
approved these changes
Nov 2, 2026
OfficialAbhinavSingh
left a comment
Member
There was a problem hiding this comment.
merged with main locally, full suite green (365 passed), ruff and pyright clean.
_walk now closes finished frames exactly like _find_name does, so descriptors grow with depth not directory count. the early return on _MAX_LIST_ENTRIES still gets everything closed, since the finally walks whatever is left in frames. the two new tests (low RLIMIT_NOFILE, and the open-fd count before/after) would both fail without the fix.
the receipt-v0.md wording is also correctly carried over from the 39 base.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #39 review nits.
What changed
What I verified
Not verified