Skip to content

fix(launchd): raise gateway file descriptor limit#38086

Open
sweetcornna wants to merge 1 commit into
NousResearch:mainfrom
sweetcornna:codex/fix-30230-macos-fd-limit
Open

fix(launchd): raise gateway file descriptor limit#38086
sweetcornna wants to merge 1 commit into
NousResearch:mainfrom
sweetcornna:codex/fix-30230-macos-fd-limit

Conversation

@sweetcornna

@sweetcornna sweetcornna commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

Fixes #30230.

Summary:

  • Add launchd SoftResourceLimits and HardResourceLimits for NumberOfFiles=4096 to the generated gateway plist.
  • Keep the current main-branch KeepAlive shape while adding the fd limits.
  • Add a regression test so macOS user-agent installs keep the higher fd limit.

Verification:

  • python -m pytest tests/hermes_cli/test_gateway_service.py::TestProfileArg::test_launchd_plist_raises_file_descriptor_limit -q was the original red test on macOS before the plist change.
  • .venv\\Scripts\\python.exe -m pytest tests/hermes_cli/test_gateway_service.py::TestProfileArg::test_launchd_plist_raises_file_descriptor_limit -q --timeout-method=thread -> skipped on Windows because the module imports POSIX pwd/grp.
  • .venv\\Scripts\\python.exe -m pytest tests/hermes_cli/test_gateway_service.py -q -k "launchd or ProfileArg" --timeout-method=thread -> skipped on Windows for the same module-level POSIX import.
  • Direct Windows smoke of generate_launchd_plist() -> confirmed SoftResourceLimits, HardResourceLimits, two NumberOfFiles keys, and <integer>4096</integer>.
  • .venv\\Scripts\\python.exe -m ruff check hermes_cli/gateway.py tests/hermes_cli/test_gateway_service.py -> passed.
  • git diff --check -> passed.

Note: full tests/hermes_cli/test_gateway_service.py still needs a POSIX/macOS host to execute rather than skip.

@alt-glitch alt-glitch added type/bug Something isn't working P2 Medium — degraded but workaround exists comp/gateway Gateway runner, session dispatch, delivery labels Jun 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/gateway Gateway runner, session dispatch, delivery P2 Medium — degraded but workaround exists type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Gateway hits macOS fd limit (256): OSError Too many open files

2 participants