Skip to content

Agents are limited over SSH #280816

Open
Open

Description

Type: Bug

My Copilot Agents can't seem to do anything except execute console commands when I run them on a remote connection to a Linux machine from my dev Windows setup. Problems exist across various models.

Copilot says:

Copilot file APIs still refuse the workspace paths. list_dir("[PROJECT_ROOT_DIRECTORY]") continues to return “outside of the workspace and can't be read,” and read_file / apply_patch on …[PROJECT_CLASS_NAME].cs fail the same way. Terminal commands remain fine, so permissions aren’t the blocker—VS Code’s agent sandbox still doesn’t recognize that folder as part of the workspace.

GitHub Copilot Chat Output log:
2025-12-02 15:56:38.372 [info] [GitExtensionServiceImpl] Initializing Git extension service.
2025-12-02 15:56:38.372 [info] [GitExtensionServiceImpl] vscode.git extension is not yet activated.
2025-12-02 15:56:38.504 [error] Copilot extension not found
2025-12-02 15:56:38.505 [warning] Copilot API is undefined, unable to register context provider.
2025-12-02 15:56:38.972 [info] Logged in (user redacted)
2025-12-02 15:56:38.976 [info] Using the Electron fetcher.
2025-12-02 15:56:39.408 [info] Got Copilot token (user redacted)
2025-12-02 15:56:39.409 [info] Copilot Chat: 0.33.3, VS Code: 1.106.3
2025-12-02 15:56:39.426 [info] activationBlocker from 'languageModelAccess' took 952ms
2025-12-02 15:56:41.589 [info] copilot token chat_enabled: true, sku: plus_monthly_subscriber_quota
2025-12-02 15:56:41.589 [info] GitHub.vscode-pull-request-github extension is not yet activated.
2025-12-02 15:56:41.602 [info] Registering default platform agent...
2025-12-02 15:56:41.603 [info] [code-referencing] Public code references are enabled.
2025-12-02 15:56:41.603 [info] activationBlocker from 'conversationFeature' took 3138ms
2025-12-02 15:56:41.616 [info] BYOK: Copilot Chat known models list fetched successfully.
2025-12-02 15:56:41.946 [info] Fetched model metadata in 357ms 4e971583-863a-4da7-ae6f-858b673590bf
2025-12-02 15:57:28.972 [info] ccreq:d4e40fe4.copilotmd | success | gpt-5.1-codex | 2659ms | [panel/editAgent]
2025-12-02 15:57:29.153 [error] Error from tool list_dir with args {"path":""}:
Directory is outside of the workspace and can't be read
at Due.invoke (.../extensions/github.copilot-chat-0.33.3/dist/extension.js:4803:7608)
at tQ.$invokeTool (.../extensionHostProcess.js:192:3227)
2025-12-02 15:57:40.061 [info] ccreq:ad13848c.copilotmd | success | gpt-5.1-codex | 10882ms | [panel/editAgent]
2025-12-02 15:59:11.904 [info] ccreq:43c13450.copilotmd | success | gpt-5.1-codex | 4366ms | [panel/editAgent]
2025-12-02 15:59:11.958 [error] Error from tool list_dir with args {"path":""}:
Directory is outside of the workspace and can't be read
at Due.invoke (.../extensions/github.copilot-chat-0.33.3/dist/extension.js:4803:7608)
at tQ.$invokeTool (.../extensionHostProcess.js:192:3227)
2025-12-02 15:59:16.826 [info] ccreq:b5ca942c.copilotmd | success | gpt-5.1-codex | 4835ms | [panel/editAgent]
2025-12-02 16:05:49.663 [info] GithubAvailableEmbeddingTypesManager: Got embeddings. Primary: metis-1024-I16-Binary.
2025-12-02 16:05:49.666 [info] WorkspaceChunkSearchService: using embedding type metis-1024-I16-Binary
2025-12-02 16:06:21.649 [info] message 0 returned. finish reason: [stop]
2025-12-02 16:06:21.649 [info] request done: requestId: [f5c02ba0-009e-4e6f-a123-1d606bd2ad53]
2025-12-02 16:06:21.653 [info] ccreq:988f71ae.copilotmd | success | gpt-4o-mini -> gpt-4o-mini-2024-07-18 | 1685ms | [workspaceContext]
2025-12-02 16:06:46.680 [info] ccreq:ca815661.copilotmd | success | gpt-5.1-codex | 22111ms | [panel/editAgent]
2025-12-02 16:06:46.988 [info] Fetched model metadata in 82ms 824334db-b401-4211-bb90-58cb96a93f2f
2025-12-02 16:06:46.990 [info] ccreq:ec691dc7.copilotmd | markdown

Extension version: 0.33.3
VS Code version: Code 1.106.3 (bf9252a, 2025-11-25T22:28:18.024Z)
OS version: Windows_NT x64 10.0.26100
Modes:
Remote OS version: Linux arm64 6.6.51+rpt-rpi-2712

System Info
Item Value
CPUs Intel(R) Core(TM) Ultra 7 155H (22 x 2995)
GPU Status 2d_canvas: enabled
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_graphite: disabled_off
trees_in_viz: disabled_off
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled
webnn: disabled_off
Load (avg) undefined
Memory (System) 31.51GB (5.84GB free)
Process Argv --folder-uri file:/// --crash-reporter-id dc8072b9-6ab2-436d-b90e-3936fdd8c8df
Screen Reader no
VM 0%
Item Value
Remote SSH: 192.168.8.2
OS Linux arm64 6.6.51+rpt-rpi-2712
CPUs Cortex-A76 (4 x 2400)
Memory (System) 7.86GB (4.37GB free)
VM 0%
A/B Experiments
vsliv368:30146709
vswsl492:30256859
pythonvspyt551:31249599
binariesv615:30325510
nativeloc1:31344060
dwcopilot:31170013
dwoutputs:31242946
copilot_t_ci:31333650
e5gg6876:31282496
pythonrdcb7:31342333
aj953862:31281341
nes-set-on:31340697
6abeh943:31336334
cloudbuttont:31379625
todos-1:31405332
qwen_all_req:31402696
3efgi100_wstrepl:31403338
trigger-command-fix:31379601
auto_model_enabled:31385282
use-responses-api:31390855
defaultusage:31403421
je187915:31401257
ec5jj548:31422691
copilot-nes-oct-t:31418199
terminalsuggestdisabled:31426256
cmp-ext-treat:31426748
cp_cls_c_966_ss:31426491
defaultvisibility:31426295
expandedtokens:31427242
c0683394:31419495
3fia6346:31426581
478ah919:31426797
ge8j1254_inline_auto_hint_haiku:31426888
b53de340:31426751
a5gib710:31426879
5j92g670_sonnet:31426787

Activity

  1. dcuccia commented on Dec 3, 2025

    @dcuccia
    Author

    Update: extension reinstall, chown project directory, and SSH config refresh didn’t resolve it.

  2. dcuccia commented on Dec 3, 2025

    @dcuccia
    Author

    Everything I’ve tried so far to get Copilot agent access working again:

    • Reinstalled the Copilot Chat extension locally on my Windows machine.
    • Refreshed SSH host info by editing ~/.ssh/config, removing/re-adding entries, and reopening the remote folder.
    • Ran sudo chown -R [USER]:[USER] [ROOT_PATH] to ensure ownership.
    • Deleted the Copilot Chat extension folders on the remote (~/.vscode-server/extensions/github.copilot-chat-*) so VS Code would reinstall them.
    • Downgraded to an older Copilot Chat extension version and tested again.
    • Confirmed the workspace path question and attempted to reopen the folder directly.
    • Removed the host block and cached key on the Windows client (known_hosts), then re-added the SSH host via the new-host workflow.
    • Cleared cached SSH keys and deleted the entire .vscode-server directory on the remote to force a fresh VS Code server install.
    • Despite all of that, every list_dir attempt on [ROOT_PATH] still returns “outside of the workspace.”
  3. chrmarti commented on Dec 9, 2025

    @chrmarti
    Collaborator
    2025-12-02 15:57:29.153 [error] Error from tool list_dir with args {"path":""}:
    Directory is outside of the workspace and can't be read
    at Due.invoke (.../extensions/github.copilot-chat-0.33.3/dist/extension.js:4803:7608)
    at tQ.$invokeTool (.../extensionHostProcess.js:192:3227)
    
  4. added
    bug
    on Dec 10, 2025
  5. dcuccia commented on Jan 26, 2026

    @dcuccia
    Author

    Sorry to bug, but any thoughts on whether this is a wide-spread issue? I've regressed to using my non-SSH VS Code agents and telling them to make SSH calls as needed. I spend a lot of time/churn round-tripping between dev and remote target devices, ending up with a very chatty git history.

  6. joshspicer commented on Jan 26, 2026

    @joshspicer
    Contributor

    You have a single folder opened ([ROOT PATH]) in your vs code workspace? If you ask the agent to read [ROOT PATH]/README.md (as an example) you get the tool error of that file being outside the workspace?

    Is your underlying SSH host a shared machine (university, etc) that may use an uncommon file system? Perhaps that is interfering with how we determine what is or is not within the workspace?

  7. dcuccia commented on Feb 13, 2026

    @dcuccia
    Author

    joshspicer SSH host was my main Windows machine. Found the fix - here's a (tool-assisted) description:


    Root cause found and resolved — workspace-level remote.extensionKind override

    After months of living with this, I finally tracked down the root cause with help from a Copilot agent session (ironically, using the terminal-only workaround).

    The problem: My settings.json in the workspace on the remote device contained:

    "remote.extensionKind": {
        "GitHub.copilot": ["ui"],
        "GitHub.copilot-chat": ["ui"]
    }

    I'm not sure when or why I added this — possibly while troubleshooting a different Copilot issue. This forced both Copilot extensions to run on the Windows UI side, where uriToFsPath() converts all forward slashes to backslashes because isWindows === true. The remote Linux path /mnt/nvme/projects/... became \mnt\nvme\projects\..., which Windows then interpreted as a UNC path \\mnt\..., triggering UNC host 'mnt' access is not allowed.

    The fix: The remote.extensionKind setting was present in two locations, and both had to be cleared:

    1. Windows user settings (%APPDATA%\Code\User\settings.json) — I had set this to ["ui"] at some point
    2. Workspace settings on the remote device (settings.json in the repo) — also had the same ["ui"] override

    Removing it from only the Windows user settings had no effect because the workspace-level setting took precedence. It wasn't until the workspace-level settings.json on the remote device was also cleaned up that the fix took hold. After removing from both, reloading the VS Code window, and starting a new chat session, all file tools worked immediately.

    This is particularly insidious because:

    • The workspace settings file lives on the remote device, so it's easy to forget it exists when troubleshooting from the Windows side
    • VS Code's settings precedence means the workspace setting silently overrides whatever you set in user settings
    • There's no UI indication that remote.extensionKind is being overridden at the workspace level

    With the default extension kind, Copilot Chat runs on the remote (workspace) side where paths stay in Unix format. All file tools (read_file, list_dir, replace_string_in_file, create_file) now work correctly.

    Diagnostic clues that pointed to this:

    • <environment_info> in the Copilot system prompt reported The user's current OS is: Windows despite being connected to a Linux remote — this indicated the extension was running on the UI side
    • grep_search and file_search worked fine (they use a different path resolution pipeline)
    • run_in_terminal worked fine (executes directly on the remote)
    • read_file errors showed backslash paths: Unable to resolve nonexistent file '\mnt\nvme\...'
    • list_dir errors showed Windows-style resolution: ENOENT: scandir 'C:\mnt\nvme\...'

    Related issues: This is the same root cause as #289166 (WSL user had extensionKind overridden, resolved by Martin Aeschlimann (@aeschli)). The fix from that issue — ensuring the Copilot extensions run on the remote/workspace side — applies here for SSH Remote as well.

    Suggestion for the VS Code team: This is an extremely easy misconfiguration to stumble into and very hard to diagnose. A few ideas:

    1. Consider surfacing a warning when remote.extensionKind forces Copilot to ["ui"] in a remote session and file tool calls fail with path errors
    2. The error message UNC host 'mnt' access is not allowed gives no indication that the real issue is extension placement — a more descriptive error from the tool layer would help
    3. The security.allowedUNCHosts suggestion in the error is a red herring in this scenario

  8. joshspicer commented on Feb 18, 2026

    @joshspicer
    Contributor

    Thanks for following up with your solution David Cuccia (he/him) (@dcuccia)

  9. removed their assignment
    on Sep 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions