github / github/copilot-cli

Child writing tasks can retain plan-mode write gates after approved exit

Đang mở
#4,173 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
area:agents area:permissions
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

A background writing task launched after an approved plan-mode exit can retain a stale plan-mode write gate. This falsely blocks the task or applies different gates to its tools and siblings, consuming bounded retry budget and potentially stalling fleet execution.

In GitHub Copilot CLI 1.0.71, after the root received `Plan approved! Exited plan mode.` and entered fleet/autopilot execution:

- One writing task launched after the approved exit created its isolated worktree and read sources, but its first harmless `apply_patch` was rejected with the inherited-parent-plan denial.
- A replacement launched after another explicit exit still had write-capable bash commands rejected as plan-mode writes, although its edit tool and commit worked.
- Sibling writing tasks launched during the same fleet phase edited and committed successfully.

### Affected version

GitHub Copilot CLI 1.0.71

### Steps to reproduce the behavior

1. Start a fresh GitHub Copilot app-managed project session.
2. Enter plan mode and prepare a plan.
3. Approve the exit to autopilot/fleet and wait for the root to report `Plan approved! Exited plan mode.`.
4. Immediately launch one or two native background general-purpose writing tasks.
5. Have each task make a first harmless write.
6. Observe whether a child receives the inherited-parent-plan denial, whether different write-capable tools in one child are gated differently, or whether sibling children receive different mode state.

### Expected behavior

After the approved plan exit and entry into fleet/autopilot execution, every newly launched writing task's plan-mode gate is inactive. Child gates should track the parent's live mode state, consistent with the existing runtime test requirement, rather than a stale state captured before exit.

### Additional context

- **Environment:** GitHub Copilot CLI 1.0.71 in a GitHub Copilot app-managed project session using native background general-purpose tasks.
- **Likely component, not yet confirmed:** mode propagation around `PlanModeWriteGateProcessor` in `github/copilot-agent-runtime`. The isolated worktree appears incidental because sibling worktrees succeeded during the same fleet phase.
- **Impact:** A task can be falsely blocked or inconsistently tool-gated, consume the fleet's bounded retry budget, and stall otherwise independent fleet work.

Related open reports cover plan-approval fleet activation or ordering, but not a child retaining a stale write gate after the approved exit:

- https://github.com/github/copilot-cli/issues/1901
- https://github.com/github/copilot-cli/issues/2833

#### Acceptance criteria

- [ ] A child launched after an approved plan exit receives the parent's live non-plan state.
- [ ] Runtime regression coverage exercises a background child launched after the exit.
- [ ] Task/fleet regression coverage exercises the sibling-launch race after the exit.
- [ ] Write-capable tools within a child consistently enforce the same current mode state.

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 lần theo việc lan truyền chế độ xung quanh PlanModeWriteGateProcessor trong github/copilot-agent-runtime và xem xét yêu cầu kiểm thử runtime hiện có đối với trạng thái chế độ của tiến trình con. Thêm kiểm thử hồi quy cho một tiến trình con chạy nền được khởi chạy sau khi thoát plan đã được phê duyệt, và cho tình trạng tranh đua khi khởi chạy các tiến trình con cùng cấp trong các kiểm thử task hoặc fleet. Được xem là hoàn tất khi các tiến trình con và các công cụ có khả năng ghi của chúng luôn sử dụng trạng thái hiện tại không phải plan của tiến trình cha.

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
Lĩnh vực
cli
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
48/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.