Repository navigation
Switch nodespaced IPC from TCP to Unix Domain Socket - #1178
Conversation
- nodespaced now binds on ~/.nodespace/daemon.sock (0600 perms) instead of TCP [::1]:50051 - Stale socket removed on startup; cleaned up on graceful shutdown - NODESPACED_SOCKET env var overrides path in daemon, CLI, watcher, and agent-tools - CLI uses UDS channel (hyper_util::TokioIo + tower::service_fn connector pattern) - @nodespace/agent-tools TypeScript client uses unix: URI scheme via @grpc/grpc-js - watcher.rs and grpc_client.rs updated to UDS connector - Windows path gated behind compile_error! for explicit failure - Remove cfg feature gate on system_prompt_override to fix clippy under --all-targets Co-Authored-By: Claude <[email protected]>
Code Review SummaryThis PR correctly implements the core security goal: replacing the world-accessible TCP socket with a FindingsSuggested Improvements
The
This isn't a correctness issue for the daemon itself (the field is cosmetic in the response), but it is a correctness trap for future callers and violates the greenfield "delete old patterns immediately" mandate. Recommendation: Rename the field to Nitpicks
let listener = UnixListener::bind(&sock)?;
std::fs::set_permissions(&sock, std::fs::Permissions::from_mode(0o600))?;There is a brief window where the socket file exists with world-readable permissions (inherited from umask) before
?? `${process.env.HOME}/.nodespace/daemon.sock`;
connect(std::path::Path::new("/tmp/nodespace-no-such-daemon.sock"))This path is not guaranteed to be absent on a developer machine (though extremely unlikely to be occupied). Using Acceptance Criteria Verification
The only acceptance criterion that has a residual concern is the |
malibio
left a comment
There was a problem hiding this comment.
Review status: APPROVED (self-review). LGTM. One improvement recommended (stale grpc_address field in settings_service.rs), a handful of nits — none are blockers. The UDS transport implementation is correct, platform gating is explicit, and integration test coverage is solid.
Replace tilde literal constant with runtime expansion matching socket_path() — the tilde is a shell convention, not a valid filesystem path, so any caller using the response value directly would silently get the wrong path. Co-Authored-By: Claude <[email protected]>
* Switch nodespaced IPC from TCP to Unix Domain Socket (closes #1176) - nodespaced now binds on ~/.nodespace/daemon.sock (0600 perms) instead of TCP [::1]:50051 - Stale socket removed on startup; cleaned up on graceful shutdown - NODESPACED_SOCKET env var overrides path in daemon, CLI, watcher, and agent-tools - CLI uses UDS channel (hyper_util::TokioIo + tower::service_fn connector pattern) - @nodespace/agent-tools TypeScript client uses unix: URI scheme via @grpc/grpc-js - watcher.rs and grpc_client.rs updated to UDS connector - Windows path gated behind compile_error! for explicit failure - Remove cfg feature gate on system_prompt_override to fix clippy under --all-targets Co-Authored-By: Claude <[email protected]> * Fix default socket path in SettingsService to expand \$HOME Replace tilde literal constant with runtime expansion matching socket_path() — the tilde is a shell convention, not a valid filesystem path, so any caller using the response value directly would silently get the wrong path. Co-Authored-By: Claude <[email protected]> --------- Co-authored-by: Michael Libio <[email protected]> Co-authored-by: Claude <[email protected]>
Summary
nodespacedbinds on~/.nodespace/daemon.sock(0600 perms) instead of TCP[::1]:50051NODESPACED_SOCKETenv var overrides path in daemon, CLI, watcher, and agent-toolshyper_util::TokioIo+tower::service_fnconnector pattern for UDS channel@nodespace/agent-toolsTypeScript client usesunix:URI scheme via@grpc/grpc-js#[cfg(windows)] compile_error!()for explicit failurecfgfeature gate onsystem_prompt_overridefield to fix clippy under--all-targetsCloses #1176
Test plan
cargo build --workspacesucceedsbun run quality:fixpasses (0 errors, 0 warnings)bun run test:allpasses (1189 Rust tests, all frontend tests)🤖 Generated with Claude Code