Repository navigation
fix: use short tmux sockets for overlong paths - #6038
Merged
Merged
Conversation
Co-authored-by: openhands <openhands@all-hands.dev>
Contributor
REST API breakage checks (OpenAPI) — ✅ PASSEDResult: ✅ PASSED |
1 of 5 tasks
jpshackelford
marked this pull request as ready for review
October 16, 2026 21:14
Contributor
Coverage Report •
|
||||||||||||||||||||
all-hands-bot
approved these changes
Oct 16, 2026
all-hands-bot
left a comment
Collaborator
There was a problem hiding this comment.
This review was posted by an AI agent (OpenHands).
Scope. This belongs in this repository. It changes tmux socket-path selection in openhands-tools (the terminal tool this repo owns) and is the direct-terminal counterpart to the Agent Server logic already on main (_ensure_server_tmux_tmpdir in openhands-agent-server/openhands/agent_server/api.py). No cross-repository or product decision is involved.
Verification on head 0870a753 (Linux, tmux 3.5a, real tmux, no mocks).
- Before/after on the real entry point: with
TMUX_TMPDIRset to a 100-byte directory,origin/mainraiseslibtmux.exc.LibTmuxException: ['error connecting to .../openhands-<32 hex> (File name too long)']for bothTmuxTerminal.initialize()andTmuxPanePool.initialize(). On this head the same script succeeds: both terminals create a real session, run a command, and read its output, withserver.socket_path=/tmp/tmux-999/openhands-<32 hex>. This reproduces the #5558 symptom exactly, including when the deep directory does not yet exist. - The limit math matches the Agent Server: the same 42-byte
openhands-<32 hex>name and the same107(Linux) /103(macOS, BSD)sun_pathbound, measured fromos.fsencode(os.path.realpath(...)), so the canonical macOS/tmpto/private/tmpexpansion is accounted for on both sides. - Isolation and locking are preserved in the fallback path: each socket keeps its unique per-pool/per-terminal name,
mark_socket_owner()is still recorded while holding the creation lock, and_socket_creation_lock(socket_dir)now locks the directory actually in use. The process-wideTMUX_TMPDIRis left unchanged, which the new test asserts and which keeps sibling sessions unaffected. - Tests:
tests/tools/terminalplustests/agent_server/test_api.pygive 449 passed, 15 skipped on this head. The newtest_overlong_tmux_tmpdir_uses_short_socket_pathfails against the base module and passes on the head, so it is a real regression test.pre-commit run --fileson the three changed files passes (ruff, ruff-format, pycodestyle, pyright, import rules, tool registration). - Current-head CI: every one of the 54 check runs on
0870a753issuccessorskipped, with none failing. Linked issue #5558 is closed/completed, and its acceptance criteria are satisfied by this head together with the Agent Server logic already onmain.
No material correctness, security, or compatibility findings.
✅ APPROVED
13 tasks
10 tasks
5 tasks
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:
Test fixes for execution of suite on MacOS.
AGENT:
Why
Direct
TmuxTerminalandTmuxPanePoolsessions could fail on macOS withFile name too longwhenTMUX_TMPDIRresolved into a deep temporary directory. Agent Server already measures tmux socket paths and falls back to/tmp, but direct terminal sessions did not.Summary
/tmptmux socket path when the original would exceed the platform's Unix-socket limit, without modifying the process-wideTMUX_TMPDIR.Issue Number
Related to #5558, which documents deep
TMUX_TMPDIRfailures.How to Test
On macOS, run
pytest -q tests/tools/terminal/test_tmux_pane_pool.py tests/tools/terminal/test_tmux_log_redaction.py tests/agent_server/test_api.py(84 passed). Ruff, pycodestyle, and pyright checks on changed files also passed. An attempt to run all 412 tests undertests/tools/terminalwas interrupted after 314 passed with no failures at about six minutes; the entire directory has not been verified.Type
Notes
The
HUMAN:note above is intentionally untouched; the author must provide their own note before the description validator can pass.This PR was created by an AI agent (OpenHands) on behalf of the user.
🐳 Agent Server images for this PR — GHCR package, pull/run commands, and all pushed tags (click to expand)
• GHCR package: https://github.com/OpenHands/agent-sdk/pkgs/container/agent-server
Variants & Base Images
eclipse-temurin:17-jdkpython-node-runtimepython-node-runtimepython-node-runtimegolang:1.21-bookwormPull (multi-arch manifest)
# Each variant is a multi-arch manifest supporting both amd64 and arm64 docker pull ghcr.io/openhands/agent-server:0870a75-pythonRun
All tags pushed for this build
About Multi-Architecture Support
0870a75-python) is a multi-arch manifest supporting both amd64 and arm640870a75-python-amd64) are also available if needed