Skip to content

Conversation

@coffinsfcompute
Copy link
Contributor

No description provided.

@semanticdiff-com
Copy link

semanticdiff-com bot commented Oct 23, 2025

Review changes with  SemanticDiff

Changed Files
File Status
  src/lib/nodes/ssh.ts  0% smaller
  src/lib/vm/ssh.ts  0% smaller

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Greptile Overview

Greptile Summary

Fixed SSH host key handling by correcting API response field names from camelCase to snake_case and ensuring the known hosts entry uses the same hostname as the HostKeyAlias for proper SSH key verification.

  • Changed ssh_host_keys field names from keyType/base64EncodedKey to key_type/base64_encoded_key to match the API schema defined in src/schema.ts:1808-1811
  • Replaced sshHostname with ${vmId}.vms.sfcompute.dev in the known hosts command to align with the HostKeyAlias configuration, ensuring SSH properly validates host keys
  • Applied identical fixes to both src/lib/nodes/ssh.ts and src/lib/vm/ssh.ts

Confidence Score: 5/5

  • This PR is safe to merge with no risk
  • The changes fix a bug where API field names were incorrectly using camelCase instead of snake_case, which would have caused runtime errors when accessing undefined properties. The hostname change ensures SSH host key verification works correctly by aligning the known hosts entry with the HostKeyAlias. Both changes are well-defined, match the API schema, and improve system reliability.
  • No files require special attention

Important Files Changed

File Analysis

Filename Score Overview
src/lib/nodes/ssh.ts 5/5 Fixed API field names from camelCase to snake_case and aligned known hosts hostname with HostKeyAlias
src/lib/vm/ssh.ts 5/5 Fixed API field names from camelCase to snake_case and aligned known hosts hostname with HostKeyAlias

Sequence Diagram

sequenceDiagram
    participant User
    participant CLI
    participant VMs_API
    participant SSH_Client

    User->>CLI: Execute nodes ssh command
    
    alt VM ID provided
        CLI->>CLI: Use VM ID directly
    else Node name provided
        CLI->>VMs_API: Request node information
        VMs_API-->>CLI: Return node with current VM
        CLI->>CLI: Extract VM ID
    end
    
    CLI->>VMs_API: Request SSH connection details
    VMs_API-->>CLI: Return hostname, port, and host keys
    Note over CLI: Host keys use snake_case:<br/>key_type, base64_encoded_key
    
    CLI->>CLI: Configure known hosts with VM domain
    CLI->>CLI: Set host key alias to VM domain
    
    CLI->>SSH_Client: Establish SSH connection
    SSH_Client->>User: Interactive SSH session
Loading

2 files reviewed, no comments

Edit Code Review Agent Settings | Greptile

@coffinsfcompute coffinsfcompute merged commit 86a5a04 into main Oct 23, 2025
1 check passed
@coffinsfcompute coffinsfcompute deleted the coffin/vm_ssh_fix branch October 23, 2025 23:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants