8000 fix: handle agent parameter in URIs by ethanndickson · Pull Request #538 · coder/vscode-coder · GitHub
[go: up one dir, main page]

Skip to content

fix: handle agent parameter in URIs #538

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jun 25, 2025
Merged

Conversation

ethanndickson
Copy link
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
Member Author

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

@@ -628,7 +628,7 @@ export class Commands {

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
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
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
Copy link
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
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
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
0