Repository navigation
Conversation
Sockets now live in a dedicated opencode-pty-<uid> child of OPENCODE_PTY_SOCKET_DIR, so the permissions of the chosen directory are left untouched. Paths containing `..` components are rejected. The stale-runtime sweep removes the socket recorded in the abandoned registration (when owned by the current uid) instead of recomputing it from the current socket root.
jlongster
marked this pull request as ready for review
October 27, 2026 14:49
3 of 6 tasks
Collaborator
Collaborator
|
Thanks @CBEPX! This landed in the monorepo as anomalyco/opencode#59697 with you kept as the author ( |
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.
Add the optional Unix environment variable
OPENCODE_PTY_SOCKET_DIRso an isolated instance can keep its socket in its own directory. The value must be absolute. An unset variable retains/tmp/opencode-pty-<uid>/. The existing ownership, symlink and0700checks remain in use, and abandoned-socket cleanup uses the same selected root.This changes
src/daemon/unix.rsand documents the variable in README. It adds no dependency or protocol change. Windows implementation files remain untouched.Validation on macOS arm64:
cargo fmt --checkand Clippy with warnings denied passed.mktemp -dadapter with an explicit temporary path.OPENCODE_PTY_BINoverride: private socket, terminal creation/output, persistence across CLI calls and explicit restart closure passed./api/ptyterminals through reload, with the same IDs, PIDs and process birth identities. Input/output and explicit close passed. This separate backend does not prove experimental candidate GUI binding.The original lifecycle check used a local debug candidate built with Rust 1.99.1 and the upstream-pinned Zig 0.16.0. The optimized candidate used Rust 1.90.0. No global installation was performed. Linux and Windows were not tested.
Related to #26.