Agent View ignores remote container context when workspace is opened in ssh dev container
- 主要语言
- 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