Skip to content

Commit 9d80d67

Browse files
fix: handle agent parameter in URIs (#538)
This fixes a bug where the `agent` query parameter on the extension URI was ignored. We were previously doing: ```ts vscode.commands.executeCommand( "coder.openDevContainer", workspaceOwner, workspaceName, workspaceAgent, devContainerName, devContainerFolder, ); ``` where `args[2]` was the agent name, but we were discarding it: ```ts const workspaceOwner = args[0] as string; const workspaceName = args[1] as string; const workspaceAgent = undefined; // args[2] is reserved, but we do not support multiple agents yet. const devContainerName = args[3] as string; const devContainerFolder = args[4] as string; ``` The same was true for the `coder.open` command. Presumably due to the comment saying multiple agents aren't supported, which hasn't been true for years.
1 parent d1289c6 commit 9d80d67

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

.git-blame-ignore-revs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# If you would like `git blame` to ignore commits from this file, run:
2+
# git config blame.ignoreRevsFile .git-blame-ignore-revs
3+
4+
# chore: simplify prettier config (#528)
5+
f785902f3ad20d54344cc1107285c2a66299c7f6

src/commands.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -600,7 +600,7 @@ export class Commands {
600600
} else {
601601
workspaceOwner = args[0] as string;
602602
workspaceName = args[1] as string;
603-
// workspaceAgent is reserved for args[2], but multiple agents aren't supported yet.
603+
workspaceAgent = args[2] as string | undefined;
604604
folderPath = args[3] as string | undefined;
605605
openRecent = args[4] as boolean | undefined;
606606
}
@@ -628,7 +628,7 @@ export class Commands {
628628

629629
const workspaceOwner = args[0] as string;
630630
const workspaceName = args[1] as string;
631-
const workspaceAgent = undefined; // args[2] is reserved, but we do not support multiple agents yet.
631+
const workspaceAgent = args[2] as string;
632632
const devContainerName = args[3] as string;
633633
const devContainerFolder = args[4] as string;
634634

@@ -748,7 +748,7 @@ async function openDevContainer(
748748
baseUrl: string,
749749
workspaceOwner: string,
750750
workspaceName: string,
751-
workspaceAgent: string | undefined,
751+
workspaceAgent: string,
752752
devContainerName: string,
753753
devContainerFolder: string,
754754
) {

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy