github / github/copilot-cli

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

Đang mở
#4,216 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
triage
Ngôn ngữ chính
Shell
Star
11.2k
Fork
1.9k
Merge trung bình
14 giờ 16 phút
Pull request đã merge (30 ngày)
6

Mô tả

### 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_

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Hướng nghiên cứu

Bắt đầu bằng cách tái hiện sự cố với các bước của SSH dev container được liệt kê, so sánh quá trình khởi tạo của Chat và Agent View và kiểm tra thư mục làm việc bằng `echo $PWD`. Theo dõi nơi Agent View thiết lập ngữ cảnh thực thi của nó và so sánh với giao diện Chat chính. Được xem là hoàn tất khi Agent View chạy trong container và có thể truy cập các đường dẫn, công cụ và phần phụ thuộc của container thay vì của host.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
shell, vscode
Lĩnh vực
cli, devops, tooling
Loại issue
Lỗi
Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức độ hoạt động
Ít trao đổi
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
45/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.