Repository navigation
Description
Summary
When connected from a Windows 11 client to a Windows 10 remote host via the VS Code Remote - SSH extension, the GitHub Copilot Chat agent (@workspace) and edit functionalities consistently fail to modify files.
The agent understands the request and attempts to apply changes, but it fails with errors indicating the file cannot be found or is "outside of the workspace," even though the file is clearly within the currently opened project folder and is often the active file in the editor. This issue was not present in the past but has started recently and persists despite extensive troubleshooting.
Environment
- Client OS: Windows 11
- Remote Host OS: Windows 10
- VS Code Version: 1.103.2
- Connection Method: VS Code's official
Remote - SSHextension. - Key Extensions:
GitHub CopilotGitHub Copilot ChatRemote - SSH
(Note: The issue persists across both the latest versions and several downgraded versions of these extensions.)
Steps to Reproduce
- On the Windows 11 client, use VS Code to connect to the Windows 10 remote host via SSH.
- Open a project folder on the remote host (e.g.,
d:\code\my_project). - Open any file within that project (e.g.,
d:\code\my_project\src\test.md). - In the Copilot Chat panel, use the agent to request a simple edit. For example:
@workspace /edit Please add a test comment to the file test.md.
Expected Behavior
Copilot should successfully apply the requested changes to the file test.md on the remote host.
Actual Behavior
The operation fails. The initial error message often suggests the file path could not be found for editing:
"It appears the file path
d:\code\my_project\src\test.mdcould not be found for editing."
Analysis of the Copilot logs reveals a more specific, two-stage failure process:
-
Copilot first attempts to use the
apply_patchtool, which fails with the error:Applying patch failed with error: File not found: d:\code\my_project\src\test.md -
Copilot then attempts to recover by using the
create_filetool, which fails with the critical error:ERROR while calling tool: File d:\code\my_project\src\test.md is outside of the workspace, and not open in an editor, and can't be read
This "outside of the workspace" error is the core of the problem, as the logs simultaneously confirm that the VS Code workspace is correctly identified as d:\code\my_project. The agent incorrectly determines that a file inside its own workspace is external, and therefore refuses to act on it.
Troubleshooting Steps Already Taken
The following solutions have been attempted without success, confirming this is likely a persistent bug in the toolchain:
-
Session & Cache:
- Starting new chat sessions.
- Executing the
Clear All Workspace Chatscommand. - Manually clearing the VS Code cache.
- Restarting VS Code and the remote connection.
-
Extensions & Environment:
- Completely uninstalling and reinstalling the
GitHub Copilot,GitHub Copilot Chat, andRemote - SSHextensions. - Cloning the project into a new, clean directory on the remote host.
- Updating all related extensions to their latest versions.
- Systematically downgrading the extensions to several older versions. The problem persists, suggesting it is not a simple regression in a single recent update.
- Completely uninstalling and reinstalling the
This issue significantly impacts the usability of Copilot for remote development in a Windows-to-Windows environment. Any insights or fixes would be greatly appreciated.
Activity
Guderian114514 commentedon Sep 10, 2025
2025-09-10 18:28:13.504 [error] Error from tool insert_edit_into_file with args {"code":"# 示例标题\n\n这是一个随便写入的内容。\n\n- 项目1\n- 项目2\n","explanation":"在1.md中添加一段简单的示例内容。","filePath":"d:\Data\gyh\literature_tracker\test\1.md"}: File d:\Data\gyh\literature_tracker\test\1.md is outside of the workspace, and not open in an editor, and can't be read: Error: File d:\Data\gyh\literature_tracker\test\1.md is outside of the workspace, and not open in an editor, and can't be read
herbsal commentedon Sep 10, 2025
I am facing the same issu with a little different setup as follows:
I'd like to add that a few weeks back, everything was working smoothly as intended. What changed is a switch to a new guest machine with Windows 11 instead of 10 and probably a few vscode/extension updates. I haven't tested again using the old notebook but will try to do so soon.
herbsal commentedon Sep 11, 2025
I just updated to vscode 1.104 which was released today. On my end, that resolved the issue. Edit mode is working again as it should also in the remote ssh workspace.
Guderian114514 commentedon Sep 12, 2025
Hey herbsal, thanks a lot for your reply and for looking into this! This issue had been bugging me for quite a while, so I really appreciate your help and attention. Glad to hear we both got it sorted out in the end!
Scatterblak commentedon Sep 12, 2025
Still fighting this. The way that vs code throws workspace files all over the system and then can't reconcile resources and specifications is a bit of a tragedy, unfortunately.
Jinshijiming commentedon Sep 14, 2025
Edit mode is working,but Agent mode not work
Guderian114514 commentedon Sep 15, 2025
Indeed, I suspect there are still unfixed bugs
igamenovoer commentedon Sep 23, 2025
still not work, agent thinks it has created a file, but the file is not created on remote. If I try to open it by clicking in the chat dialog, it will fail to open. Editing in agent mode does not work either, some issue, it thinks it has editted the file but nothing is actually written. In edit mode, it works, but not agent mode, vscode is 1.104.1 latest version (just auto update)
igamenovoer commentedon Sep 23, 2025
I get it, it is because the github copilot is running as ui extension, which runs on local extension host, forcing it to run on remote host can solve the problem:
open the user setting json and then set these
after that, restart the ssh session again then it will work
Guderian114514 commentedon Sep 26, 2025
your tip about forcing Copilot extensions to run on the remote host solved the agent issue for me. I hadn’t looked deeper since edit mode was “good enough,” but your workaround fixed the real problem. Really appreciate you sharing it.
herbsal commentedon Oct 1, 2025
Gao Yinghao (@Guderian114514) I'd like to ask you to re-open the issue, since having to run copilot to run on the remote host is not a fix but rather a workaround that may help in certain scenarios.
If however the remote host does not have Internet access, this workaround cannot be applied. And I can also confirm that agent mode does not work.
Guderian114514 commentedon Oct 2, 2025
Thanks, you make a great point. I've re-opened the issue.
chrmarti commentedon Oct 2, 2025
The Copilot extensions need to run on the remote extension host. They do this by default, the errors are usually caused by having
"remote.extensionKind"in the user settings forcing the Copilot extensions to run locally where they do not have access to the workspace files. This is expected behavior. If you need them to work with a remote that does not have network access, could you open a feature request for use? Thanks.herbsal commentedon Oct 3, 2025
Christof Marti (@chrmarti) it does perfectly work using remote ssh when using ask or edit mode and it does have access to the workspace in these cases. Even if the remote host does not have Internet access. Since only agent mode does not work and edit mode intermittently did not work for a few versions, that's why we suspected a bug.
Are you saying that edit mode is not even expected to work but we're just lucky that it actually does?