Repository navigation
feat(agent): default to per-user local IPC, keep TCP as explicit opt-in - #491
Merged
Merged
Conversation
The agent now binds a Unix-domain socket (mode 0600 under a 0700 directory, with peer-UID verification on Linux/macOS) or a Windows named pipe carrying a current-user-only DACL instead of listening on 127.0.0.1:50051. TCP remains available only when --grpc-addr is passed explicitly, as a remote/development compatibility mode. Shared discovery lives in the future-rpc crate (transport.rs): clients resolve FUTURE_AGENT_GRPC_ADDR / config to an ordered connection plan — an explicit TCP address is tried first with local IPC as fallback; the default 'auto' plan uses local IPC only. TUI, CLI, channels, and the desktop backend all go through connect_channel(). The TUI mirrors the desktop supervisor: when no agent is reachable it launches a sidecar (unified 'future agent' or standalone future-agent) and owns it for the process lifetime; an already-running agent is attached to instead.
ace331
marked this pull request as ready for review
September 4, 2026 03:00
- transport.rs: import SDDL_REVISION_1 from Win32::Security::Authorization (its actual module in windows-sys 0.59) instead of Win32::Security. - cli_smoke: force the ~/.future/run socket path by removing XDG_RUNTIME_DIR from the child env — ubuntu-latest exports /run/user/<uid>, outside the isolated HOME the test asserts on. - terminal.rs: drain the one-shot FORCE_NEW_FAILURE test seam before constructing a Terminal in columns_rows_read_cached_size; a leaked injection from another test made Terminal::new unwrap fail (CI flake).
ace331
enabled auto-merge (squash)
September 4, 2026 03:13
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
The agent's gRPC endpoint moves from a shared loopback TCP port to per-user native IPC; TCP survives only as an explicitly enabled remote/development compatibility mode.
$XDG_RUNTIME_DIR/future/agent.sockor~/.future/run/agent.sock— parent dir0700, socket0600, directory-ownership check, andSO_PEERCREDpeer-UID verification on Linux.\\.\pipe\future-agent-<SID>with a current-user-only DACL (D:P(A;;GA;;;SY)(A;;GA;;;<SID>)) andreject_remote_clients.--grpc-addr/FUTURE_AGENT_GRPC_ADDRis set explicitly; clients try the configured TCP address first and fall back to local IPC. The defaultautoplan never touches the shared port.future_rpc::transport(newtransport.rs):connection_plan()+connect_channel()used by the TUI, CLI, channels, and desktop backend.future agent(or the standalonefuture-agentfallback) as a sidecar and owns it for the process lifetime.Behavior changes
future agentwith no flags now binds local IPC instead of127.0.0.1:50051.auto(envFUTURE_AGENT_GRPC_ADDRand channelgrpc_addrconfig still honored;"auto"/empty means local IPC).Verification
cargo fmt --all --check,cargo clippy --workspace --all-targets(workspace + desktop) clean.0700); rpc transport tests cover plan ordering and socket permissions.~/.future/run/agent.sock;future models listconnected over the socket successfully.