fix: keep replay unix sockets visible in sandboxes#201
Merged
Conversation
Contributor
There was a problem hiding this comment.
1 issue found across 2 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="internal/runner/server.go">
<violation number="1" location="internal/runner/server.go:208">
P2: Both new socket candidates are cwd-absolute paths, which can exceed Unix domain socket path limits in deep workspaces and cause startup failure.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
sohankshirsagar
approved these changes
Mar 20, 2026
sohil-kshirsagar
approved these changes
Mar 20, 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.
Summary
Keep replay Unix sockets visible to sandboxed services by moving them off
/tmp, which may be remounted inside strict Linux sandboxes. Prefer a short hidden path under.tuskfor the normal case, and fall back to a short hidden workspace path when the.tuskmount cannot host Unix sockets.This also bumps
fencetov0.1.36so replay picks up the Linux minimal/devfix that these gRPC replay failures depended on.Context
Previously, #194 changed to use a broad
/forallowWrite, and under the old Fence mount ordering that late root bind overrode the special mounts.. At this point,/tmpis still accessible (this points to the host/tmp). Use-Tusk/fence#83 now restores their intended special-mount behavior:/tmpbecomes private again,/procis sandbox-local, and/devkeeps the minimal/special handling.A quick fix would be to reintroduce
/tmpintogetAllowedWriteDirs(), but the more correct fix is to keep the socket in a location that is meant to be shared with the sandboxed service. This preserves the intended sandbox invariant that/tmpis private, avoids re-sharing the outer temp namespace just to expose one socket, and is less likely to collide with unrelated temp files.The one drawback I would mention is that now the socket file is slightly more visible to the user, thus it's a bit more prone to accidental deletions, untracked file noise, etc. Adding a
.tusk/.gitignore(which also ignores logs, traces, etc and can be deterministically generated by the setup agent or attusk drift runtime) could help mitigate this, plus it is already relatively obscured in.tusk/.s.One additional portability issue is Unix domain socket path length: even a short filename can fail if the workspace path is very deep. To avoid that, this change now falls back to a short hashed socket name in an ancestor directory when the cwd-local candidates would be too long.
Changes
/tmp/tusk-connect.sock.tusk/.sso the socket stays hidden under the existing replay artifact directory.t.sockwhen the preferred.tusklocation cannot create a Unix socket in some Docker-backed environmentsfencetov0.1.36sotusk-drift-clipicks up the strict Linux sandbox/devfixFuture todo
.tusk/.gitignorethat can be invoked by the setup agent or upontusk drift run.