Background agent completion retention
- 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
Completed background agents are purged from the CLI agent registry very quickly, so read_agent can
return Agent not found even after a successful completion notification.
Summary
Background agents are retrievable while running, but completed agents appear to have only a very short retention
window. In this session, the original code-review-auditor agent auth-audit showed as running for several minutes,
then later vanished entirely from list_agents, and read_agent returned Agent not found. A separate live repro showed
the same behavior with tiny probe agents, so this does not look specific to the custom reviewer.
### Affected version
GitHub Copilot CLI 1.0.21.
### Steps to reproduce the behavior
1. Start a tiny background agent.
2. Confirm it appears in list_agents while running.
3. Wait for completion notification.
4. Immediately call read_agent / list_agents --include_completed and observe it is briefly available.
5. Wait a few more seconds and call them again.
6. The completed agent disappears from list_agents, and read_agent returns no agent found.
### Expected behavior
Completed background agents should remain readable/listed for a reasonable period, at least long enough for normal
follow-up after the completion notification.
### Additional context
Actual
Completed agents are purged very quickly after finishing, sometimes within a few seconds of post-completion access.
Impact
Long-running background reviews can finish successfully but become unrecoverable before the user or orchestrator
reads the result, which makes background mode unreliable for required audit outputs.
Evidence from this session
- auth-audit was started and later observed as still running.
- Later, read_agent(auth-audit) returned Agent not found.
- Live repro agents showed the same short-lived post-completion availability.
Current workaround
- Use mode: "sync" when the result must be preserved before handoff.
- If using background, read and capture the result immediately after completion.
Hướng dẫn đóng góp
Hướng nghiên cứu
Bắt đầu với phần triển khai background-agent phía sau các entry point read_agent và list_agents, so sánh hành vi khi các agent đang chạy với list_agents --include_completed sau khi hoàn tất. Tái hiện khoảng thời gian lưu giữ ngắn sau khi hoàn tất bằng một background agent nhỏ, sau đó xác minh rằng các agent đã hoàn tất vẫn có thể đọc được và vẫn được liệt kê đủ lâu cho việc theo dõi thông thườ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
- Ít trao đổi
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 45/100