Skip to content

fix: handle agent parameter in URIs#538

Merged
ethanndickson merged 3 commits intomainfrom
ethan/handle-agent-in-URI
Jun 25, 2025
Merged

fix: handle agent parameter in URIs#538
ethanndickson merged 3 commits intomainfrom
ethan/handle-agent-in-URI

Conversation

@ethanndickson
Copy link
Copy Markdown
Member

@ethanndickson ethanndickson commented Jun 24, 2025

This fixes a bug where the agent query parameter on the extension URI was ignored.

We were previously doing:

vscode.commands.executeCommand(
	"coder.openDevContainer",
	workspaceOwner,
	workspaceName,
	workspaceAgent,
	devContainerName,
	devContainerFolder,
);

where args[2] was the agent name, but we were discarding it:

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.

Copy link
Copy Markdown
Member Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

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 workspaceAgent = args[2] as string;
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

openDevcontainer URIs must include the agent name to work properly, I believe, so this is string and not string | undefined.

@ethanndickson ethanndickson requested a review from mafredri June 24, 2025 09:43
@ethanndickson ethanndickson marked this pull request as ready for review June 24, 2025 09:44
Copy link
Copy Markdown
Member

@mafredri mafredri left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for fixing this!

# git config blame.ignoreRevsFile .git-blame-ignore-revs

# chore: simplify prettier config (#528)
f785902f3ad20d54344cc1107285c2a66299c7f6 No newline at end of file
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

What's the purpose of this?

Copy link
Copy Markdown
Member Author

@ethanndickson ethanndickson Jun 24, 2025

Choose a reason for hiding this comment

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

We have the same file on coder/coder - it's just a convenient way to remove a formatting commit from git blame results. I noticed every line was blamed on #528. No longer the case after running git config blame.ignoreRevsFile .git-blame-ignore-revs

Copy link
Copy Markdown
Member Author

ethanndickson commented Jun 25, 2025

Merge activity

  • Jun 25, 1:25 AM UTC: A user started a stack merge that includes this pull request via Graphite.
  • Jun 25, 1:25 AM UTC: @ethanndickson merged this pull request with Graphite.

@ethanndickson ethanndickson merged commit 9d80d67 into main Jun 25, 2025
3 checks passed
@ethanndickson ethanndickson deleted the ethan/handle-agent-in-URI branch June 25, 2025 01:25
@ethanndickson ethanndickson self-assigned this Jun 26, 2025
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.

2 participants