github / github/copilot-cli

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

未關閉
#4,216 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
triage
主要語言
Shell
星號
11.2k
分支
1.9k
平均合併
14 小時 16 分鐘
30 天內合併 PR
6

描述

### 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//...`) 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_

貢獻指南

開啟貢獻指南

研究方向

首先,按照列出的 SSH 開發容器步驟重現問題,比較 Chat 和 Agent View 的初始化過程,並使用 `echo $PWD` 檢查工作目錄。追蹤 Agent View 在哪裡建立其執行內容,並將其與 Chat 主介面進行比較。完成標準是 Agent View 在容器中執行,並且能夠存取容器中的路徑、工具和相依項,而不是主機中的路徑、工具和相依項。

由索引模型根據 Issue 內容生成。

評估

技術堆疊
shell, vscode
領域
cli, devops, tooling
Issue 類型
缺陷
難度
4/5
預估耗時
3-5 天
活躍度
冷清
描述清晰度
基本清楚
新手友好度
45/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。