Skip to content

Commit 6577b12

Browse files
committed
Remove no-op dispose() method
Since ControlPersist=60 handles all socket cleanup automatically and dispose() is not part of the Runtime interface or called anywhere, there's no reason to keep an empty method.
1 parent 5f09f73 commit 6577b12

File tree

2 files changed

+6
-12
lines changed

2 files changed

+6
-12
lines changed

src/runtime/SSHRuntime.ts

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -895,18 +895,6 @@ export class SSHRuntime implements Runtime {
895895
return { success: false, error: `Failed to delete directory: ${getErrorMessage(error)}` };
896896
}
897897
}
898-
899-
/**
900-
* Cleanup SSH control socket on disposal.
901-
*
902-
* Note: This is a no-op because:
903-
* - ControlPersist=60 automatically removes socket 60s after last use
904-
* - Multiple SSHRuntime instances may share the same connection
905-
* - Explicit cleanup could interfere with other active operations
906-
*/
907-
dispose(): void {
908-
// No-op: Let ControlPersist handle cleanup automatically
909-
}
910898
}
911899

912900
/**

src/runtime/sshConnectionPool.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ import type { SSHRuntimeConfig } from "./SSHRuntime";
2323
* Socket files are created by SSH and cleaned up automatically:
2424
* - ControlPersist=60: Removes socket 60s after last use
2525
* - OS: Cleans /tmp on reboot
26+
*
27+
* Includes local username in hash to prevent cross-user collisions on
28+
* multi-user systems (different users connecting to same remote would
29+
* otherwise generate same socket path, causing permission errors).
2630
*/
2731
export function getControlPath(config: SSHRuntimeConfig): string {
2832
const key = makeConnectionKey(config);
@@ -33,9 +37,11 @@ export function getControlPath(config: SSHRuntimeConfig): string {
3337
/**
3438
* Generate stable key from config.
3539
* Identical configs produce identical keys.
40+
* Includes local username to prevent cross-user socket collisions.
3641
*/
3742
function makeConnectionKey(config: SSHRuntimeConfig): string {
3843
const parts = [
44+
os.userInfo().username, // Include local user to prevent cross-user collisions
3945
config.host,
4046
config.port?.toString() ?? "22",
4147
config.srcBaseDir,

0 commit comments

Comments
 (0)