11import axios from "axios"
2- import { getWorkspace , getWorkspaceBuildLogs , getWorkspaceByOwnerAndName , startWorkspace } from "coder/site/src/api/api"
2+ import {
3+ getBuildInfo ,
4+ getWorkspace ,
5+ getWorkspaceBuildLogs ,
6+ getWorkspaceByOwnerAndName ,
7+ startWorkspace ,
8+ } from "coder/site/src/api/api"
39import { ProvisionerJobLog , Workspace , WorkspaceAgent } from "coder/site/src/api/typesGenerated"
410import EventSource from "eventsource"
511import find from "find-process"
@@ -8,6 +14,7 @@ import * as jsonc from "jsonc-parser"
814import * as os from "os"
915import * as path from "path"
1016import prettyBytes from "pretty-bytes"
17+ import * as semver from "semver"
1118import SSHConfig from "ssh-config"
1219import * as vscode from "vscode"
1320import * as ws from "ws"
@@ -42,6 +49,28 @@ export class Remote {
4249 throw new Error ( `Invalid Coder SSH authority. Must be: <username>--<workspace>--<agent?>` )
4350 }
4451
52+ const buildInfo = await getBuildInfo ( )
53+ const parsedVersion = semver . parse ( buildInfo . version )
54+ // Server versions before v0.14.1 don't support the vscodessh command!
55+ if (
56+ parsedVersion ?. major === 0 &&
57+ parsedVersion ?. minor <= 14 &&
58+ parsedVersion ?. patch < 1 &&
59+ parsedVersion ?. prerelease . length === 0
60+ ) {
61+ await this . vscodeProposed . window . showErrorMessage (
62+ "Incompatible Server" ,
63+ {
64+ detail : "Your Coder server is too old to support the Coder extension! Please upgrade to v0.14.1 or newer." ,
65+ modal : true ,
66+ useCustom : true ,
67+ } ,
68+ "Close Remote" ,
69+ )
70+ await this . closeRemote ( )
71+ return
72+ }
73+
4574 // Find the workspace from the URI scheme provided!
4675 let workspace : Workspace
4776 try {
0 commit comments