* Generate stable key from config. * Identical configs produce identical keys. * Includes local username to prevent cross-user socket collisions.
(config: SSHConnectionConfig)
| 643 | * Includes local username to prevent cross-user socket collisions. |
| 644 | */ |
| 645 | function makeConnectionKey(config: SSHConnectionConfig): string { |
| 646 | // Note: srcBaseDir is intentionally excluded - connection identity is determined |
| 647 | // by user + host + port + key. This allows health tracking and multiplexing |
| 648 | // to be shared across workspaces on the same host. |
| 649 | const parts = [ |
| 650 | os.userInfo().username, // Include local user to prevent cross-user collisions |
| 651 | config.host, |
| 652 | config.port?.toString() ?? "22", |
| 653 | config.identityFile ?? "default", |
| 654 | ]; |
| 655 | return parts.join(":"); |
| 656 | } |
| 657 | |
| 658 | /** |
| 659 | * Generate deterministic hash for controlPath naming. |
no outgoing calls
no test coverage detected