Skip to content

Use cli version instead of Coder version #323

Closed
@code-asher

Description

@code-asher

When connecting to the remote we use the Coder version to determine which flags are supported, but we should get the local cli version instead because it does not necessarily match (if the user has downloads disabled and is using an old cli).

Instead of all this:

vscode-coder/src/remote.ts

Lines 197 to 218 in b35779a

const buildInfo = await workspaceRestClient.getBuildInfo()
const parsedVersion = semver.parse(buildInfo.version)
// Server versions before v0.14.1 don't support the vscodessh command!
if (
parsedVersion?.major === 0 &&
parsedVersion?.minor <= 14 &&
parsedVersion?.patch < 1 &&
parsedVersion?.prerelease.length === 0
) {
await this.vscodeProposed.window.showErrorMessage(
"Incompatible Server",
{
detail: "Your Coder server is too old to support the Coder extension! Please upgrade to v0.14.1 or newer.",
modal: true,
useCustom: true,
},
"Close Remote",
)
await this.closeRemote()
return
}
const hasCoderLogs = supportsCoderAgentLogDirFlag(parsedVersion)

We could do something like supportsCoderAgentLogDirFlag(version(binPath)) where version comes from cliManager.ts, and make version return a SemVer.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions