github / github/copilot-cli

Agent View ignores remote container context when workspace is opened in ssh dev container

Offen
#4,216 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

triage
Vorherrschende Sprache
Shell
Sterne
11.2k
Forks
1.9k
Ø Merge
14 Std. 16 Min.
Gemergte PRs (30 T.)
6

Beschreibung

Describe the bug

Description

When a VS Code workspace is opened in a remote SSH dev container, the new Copilot Agent View incorrectly initializes on the host system instead of inside the container, ignoring the remote context that the main Chat interface correctly respects.

Expected Behavior

  • Workspace opened in dev container → Chat works correctly in container
  • New Agent View opened → should also run in the same container context
  • Both interfaces should respect the remote container environment

Actual Behavior

  • Workspace opened in dev container → Chat works correctly in container
  • New Agent View opened → starts on the host system instead of the container
  • Agent has file system access to the host (e.g., /Users/<name>/...) instead of container paths
  • This creates a context mismatch and prevents proper interaction with container-specific tools/dependencies

Environment

  • OS: macOS (Darwin)
  • Workspace: SSH remote dev container
  • VS Code: Remote - Containers extension enabled
  • Copilot CLI: Latest version

Impact

  • Agent cannot access container-specific dependencies/tools
  • Workspace context is fragmented between Chat (container) and Agent (host)
  • Potential security/privacy issue: agent operates on host file system when it shouldn't

Suggested Fix

Agent View should automatically detect and respect the VS Code remote context (dev container, SSH, WSL, etc.) on initialization, matching the behavior of the main Chat interface.

Affected version

latest

Steps to reproduce the behavior
  1. Open a project in a dev container (e.g., via Remote - Containers extension)
  2. Verify Chat interface works correctly in container
  3. Open Agent View (or new agent session)
  4. Check working directory/system info: echo $PWD or equivalent
  5. Observe: Agent is on host system, not in container
Expected behavior
  • Workspace opened in dev container → Chat works correctly in container
  • New Agent View opened → should also run in the same container context
  • Both interfaces should respect the remote container environment
Additional context

No response

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Beginnen Sie damit, das Problem mit den aufgeführten SSH-Dev-Container-Schritten zu reproduzieren, vergleichen Sie die Initialisierung von Chat und Agent View und überprüfen Sie das Arbeitsverzeichnis mit echo $PWD. Verfolgen Sie, wo Agent View seinen Ausführungskontext einrichtet, und vergleichen Sie ihn mit der Hauptoberfläche von Chat. Als erledigt gilt die Aufgabe, wenn Agent View im Container ausgeführt wird und auf dessen Pfade, Tools und Abhängigkeiten zugreifen kann, statt auf die des Hosts.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
shell, vscode
Bereich
cli, devops, tooling
Issue-Typ
Bug
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Ruhig
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
45/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.