feat: [PR-1697] sf nodes ssh supports v2/nodes#249
Merged
sigmachirality merged 4 commits intomainfrom Feb 12, 2026
Merged
Conversation
Try the v2 nodes SSH endpoint first, falling back to the v0/vms/ssh path. Extract SshInfo type, use apiClient for the v0 fallback, and use distinct host key aliases per endpoint version. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
sigmachirality
commented
Feb 12, 2026
src/lib/nodes/ssh.ts
Outdated
| process.exit(1); | ||
| if (v2Response.ok) { | ||
| data = await v2Response.json(); | ||
| hostKeyAlias = `${nodeOrVmId}.v2.nodes.sfcompute.dev`; |
Member
Author
There was a problem hiding this comment.
@coffinsfcompute to double check this is fine
andreaanez
approved these changes
Feb 12, 2026
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
vm_ IDs are always legacy VMs, so go straight to the v0 endpoint to avoid an unnecessary round-trip to v2. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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
v2/nodes/{id}/sshendpoint first for SSH info, falling back to thev0/vms/sshendpoint if it fails (including 401)apiClientfor the v0 fallback instead of rawfetch+getApiUrlSshInfotype*.v2.nodes.sfcompute.devvs*.vms.sfcompute.dev)Context
This is a stepping stone toward supporting
sf nodes sshfor the new capacities API. The v2 endpoint will serve capacities nodes going forward, while the v0/vms fallback keeps existing Nodes API users working during the deprecation window. Once the Nodes API is fully deprecated, the v0 fallback can be removed. For capacities nodes, we can use the nano ID prefix to route to the correct endpoint, avoiding ambiguity with legacy node names/IDs.Test plan
sf nodes ssh root@<node-name>connects successfully via v2 endpointsf nodes ssh root@<vm-id>falls back to v0 endpoint and connectssf nodes ssh root@<node-name> --jsonreturns SSH info JSON🤖 Generated with Claude Code