Skip to content

vscode mcp: support custom workspace path; enable restart tool#286297

Merged
rebornix merged 6 commits intomainfrom
rebornix/poor-loon
Jan 14, 2026
Merged

vscode mcp: support custom workspace path; enable restart tool#286297
rebornix merged 6 commits intomainfrom
rebornix/poor-loon

Conversation

@rebornix
Copy link
Copy Markdown
Member

@rebornix rebornix commented Jan 7, 2026

  • optional workspace paths through MCP setup/start so the server can open a specific folder or workspace when requested
  • enable reload tool to support window reload

Copilot AI review requested due to automatic review settings January 7, 2026 05:53
@rebornix rebornix self-assigned this Jan 7, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR enables MCP (Model Context Protocol) automation tools to support custom workspace paths and enables the restart tool for VS Code automation testing. The changes make workspace paths optional throughout the automation framework, allowing VS Code to open with the last used workspace or an empty window when no path is specified.

Key Changes:

  • Enable the previously commented-out restart tool with support for optional workspace paths and extra CLI arguments
  • Add optional workspacePath parameter to the MCP start tool
  • Make workspacePath optional throughout the automation framework (Application, Code, electron, playwrightBrowser)

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
test/mcp/src/automationTools/core.ts Uncommented and enabled the restart tool with optional workspace and extra arguments support
test/mcp/src/automation.ts Added optional workspacePath parameter to the start tool with updated description
test/mcp/src/application.ts Propagated workspacePath parameter through getApplication and ApplicationService methods
test/automation/src/playwrightBrowser.ts Modified URL construction to conditionally include workspace path only when provided
test/automation/src/electron.ts Made workspace path optional in electron args, added validation for remote scenarios
test/automation/src/code.ts Changed workspacePath from required to optional in LaunchOptions interface
test/automation/src/application.ts Changed _workspacePathOrFolder and its getter to return optional string

Comment thread test/automation/src/playwrightBrowser.ts Outdated
Comment thread test/mcp/src/automationTools/core.ts
Comment thread test/mcp/src/automationTools/core.ts
Comment thread test/automation/src/application.ts
@rebornix rebornix marked this pull request as ready for review January 12, 2026 19:15
@vs-code-engineering vs-code-engineering bot added this to the January 2026 milestone Jan 12, 2026
@rebornix rebornix requested a review from bpasero January 12, 2026 19:25
@rebornix
Copy link
Copy Markdown
Member Author

@bpasero it touched smoke test so it would be great if you can also take a look.

Copy link
Copy Markdown
Member

@TylerLeonhardt TylerLeonhardt left a comment

Choose a reason for hiding this comment

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

I'm fine with this from the MCP side

@rebornix
Copy link
Copy Markdown
Member Author

Merging it to allow us to continue experimenting with it. if there are feedbacks I can address in followup PRs.

@rebornix rebornix merged commit e64d583 into main Jan 14, 2026
22 checks passed
@rebornix rebornix deleted the rebornix/poor-loon branch January 14, 2026 00:38
@bpasero
Copy link
Copy Markdown
Member

bpasero commented Jan 14, 2026

@rebornix why do we have to repeat this code everywhwere?

const workspacePathOrFolder = app.workspacePathOrFolder;
if (!workspacePathOrFolder) {
	throw new Error('This test requires a workspace to be open');
}

Wouldn't it be better to just throw at the getter of app.workspacePathOrFolder

eli-w-king pushed a commit that referenced this pull request Jan 14, 2026
* vscode mcp: support specifying workspace path; enable restart tool

* fix: include workspace path in launch options for browser

* fix: ensure workspace path is set for tests requiring a workspace

* Address PR review comments: support optional workspace path

* fix: standardize workspace path variable naming in tests

* fix: fallback to rootPath for workspacePath in CI environments
@vs-code-engineering vs-code-engineering bot locked and limited conversation to collaborators Mar 2, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants