Repository navigation
test(agent-server): avoid overlong tmux test socket paths on macOS - #5619
Merged
Merged
Conversation
all-hands-bot
approved these changes
Oct 9, 2026
all-hands-bot
left a comment
Collaborator
There was a problem hiding this comment.
Approved. Test-only change that correctly stops the tests from recreating the macOS socket-length failure the production code guards against.
Verified locally on tests/agent_server/test_api.py:
- Full file:
uv run pytest tests/agent_server/test_api.py-> 47 passed (tmux subset-k tmux-> 9 passed). - New
test_default_server_tmux_tmpdir_counts_canonical_socket_bytes[macos]and[linux]both pass on Linux CI, confirming the 103/107 boundary is exercised from one platform. ruff checkandruff format --checkclean.
Design reads well: separating default-path selection from directory creation, using a genuinely short final dir for the real TmuxPanePool/lifespan tests, and keeping the /tmp fallback deterministic. No production changes, as advertised.
Two minor, non-blocking notes:
- The new parameterized test hardcodes the 103/107 limits, duplicating
_MAX_TMUX_SOCKET_PATHinapi.py. A short comment pointing at that constant would help if the limits ever change. test_default_server_tmux_tmpdir_uses_current_pidno longer carries the posixskipif(its sibling still does). It stays safe because_fits_tmux_socketreturnsTrueon non-posix, but re-adding the marker would keep intent explicit.
This review was posted by an AI agent (OpenHands) on behalf of the user.
This was referenced Oct 16, 2026
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.
HUMAN:
This PR fixes a little annoyance in tests, which sometimes end up creating a too long path on MacOS.
⸻
AGENT:
I’m an AI agent (GPT-6) helping Engel Nyst (@enyst) with project maintenance.
Why
Follow-up to #5559, which fixed tmux Unix socket path limits in the Agent Server.
The production fix is correct, but several tests construct their expected TMUX_TMPDIR beneath the randomized short_tmp_path fixture and then append openhands-agent-server-.
On macOS, /tmp resolves to /private/tmp. With UID 501 and PID 12345, the resulting socket path can reach 105 bytes, exceeding the 103-byte usable limit. The production fallback under /tmp, by contrast, needs only 93 bytes.
Consequently, the tests can fail on macOS even though the production implementation behaves correctly.
The tests should not accidentally recreate the exact failure the production code is designed to avoid.
Summary
No production code changes. The per-process directory name, socket isolation, path-length validation, and /tmp fallback are unchanged.
Follow-up to #5559 (original bug #5558).
Issue Number
Fixes #5620
How to Test
The change is limited to tests/agent_server/test_api.py.
Review verification:
Run the relevant tests:
uv run pytest tests/agent_server/test_api.py -n 4The existing tmux tests require tmux on a POSIX host.
The new parameterized test simulates the canonical path and socket limits for both macOS and Linux, so the boundary behavior can also be checked by Linux CI.
Expected behavior:
Video/Screenshots
N/A. Test-only change; reproduction details are included above.
Design Doc
N/A. No production design or API changes.
Type
Notes
Commit: 32cfd08
Branch: enyst:fix/tmux-test-socket-path-macos