Autopilot background-task timeout exits active parent after subagent completes
Chưa có ai nhận issue này.
- 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
In autopilot mode, the 600-second background-task wait timeout terminates the
entire Copilot CLI process even after the background subagent has completed and
the parent agent has resumed work.
The timeout appears to start from when the parent first becomes idle.
It is not cancelled or reset when the background task completes.
The process exits with code 0, causing automation to treat the interrupted run
as successful.
Affected version
1.0.80
Steps to reproduce the behavior
- Start Copilot CLI in autopilot mode.
- Launch a background subagent that remains active for several minutes.
- Allow the parent agent to become idle while awaiting that subagent.
- Let the subagent complete before the configured COPILOT_TASK_WAIT_TIMEOUT_SECONDS deadline.
- Allow the parent to resume work.
- Original timer still fires and exits the entire process, even though the parent is active and the subagent has finished.
Observed timeline from one run:
06:07:40 - background subagent started
06:10:52 - parent became idle while waiting
06:19:12 - subagent completed; parent resumed
06:20:48 - parent was actively streaming an edit tool call
06:20:52 - exactly 600 seconds after the parent became idle, Copilot emitted:
"Timed out after 600s waiting for background tasks to finish; exiting.
Set COPILOT_TASK_WAIT_TIMEOUT_SECONDS to change the limit."
The process then returned exitCode: 0.
The in-progress edit was never executed.
Expected behavior
When a background-task timeout is reached, Copilot CLI should:
- Cancel only background tasks that are still running.
- Return control to the parent with a timeout notification.
- Cancel the wait timer when all background tasks complete.
- Not terminate an active parent because of a stale background-task timer.
If a session-level deadline intentionally terminates the process, it should be reported as a timeout with a nonzero exit status rather than successful completion.
Additional context
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Hướng nghiên cứu
Bắt đầu bằng cách lần theo việc xử lý COPILOT_TASK_WAIT_TIMEOUT_SECONDS và vòng đời hoàn tất của tác vụ nền trong autopilot mode. Tái hiện kịch bản gồm sáu bước, xác minh liệu bộ hẹn giờ chờ có bị hủy khi subagent hoàn tất và tiến trình cha tiếp tục hay không, đồng thời kiểm tra rằng mọi session timeout có chủ ý đều báo cáo exit status khác không.
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
- Sôi nổi
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 48/100