Repository navigation
fix(tools): raise the open-file limit at startup + actionable fd-quota errors (#122) - #172
Merged
Merged
Conversation
…a errors (#122) std.process.raiseFileDescriptorLimit() in main() before subcommand dispatch lifts the soft NOFILE cap to the OS hard cap (Darwin: OPEN_MAX 10240 vs the 256 default), so parallel tool/subagent/MCP fan-out in one turn no longer dies with ProcessFdQuotaExceeded. tools.failure() and the background-job spawn path now explain an fd-quota hit and what to do about it instead of a bare error name (the old job-spawn advice — run it in the foreground — was actively wrong for this error). Verified end-to-end vs a scripted lmstudio mock: under ulimit -n 256 a bash tool child sees 10240 with this fix, 256 on v0.0.200. Co-Authored-By: blackfloofie <265516171+blackfloofie@users.noreply.github.com>
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.
What
std.process.raiseFileDescriptorLimit()inmain()before subcommand dispatch: lifts the soft NOFILE cap to the OS hard cap (Darwin:OPEN_MAX10240 vs the 256 default). Zig 0.16.0 std ships this with correct Darwin clamping, so the fix is the one-liner discussed on the issue.tools.failure()special-casesProcessFdQuotaExceededwith an actionable message (what it means, retry sequentially,ulimit -n 4096) instead of the bare error name.Why
The audit on #122 disproved the FD-leak theory (graff's own FD count is flat at 11 across turns; 150 sequential bash spawns under
ulimit -n 256all succeed) — the failure mode is parallel tool/subagent/MCP fan-out pressure against the 256 default. Raising the limit at startup defuses it.Verification (end-to-end A/B)
Scripted lmstudio-slot mock orders a
bash: ulimit -ntool call through a real--jsonturn, parent shell capped atulimit -n 256:zig build+zig build testclean.Closes #122 (remaining items on that issue — fan-out caps — are follow-up material; the limit raise + error message were the actionable core).