Background sub-agents (general-purpose) get stuck indefinitely, never complete
- 主要语言
- Shell
- 星标
- 11.2k
- 派生
- 1.9k
- 平均合并
- 14 小时 16 分钟
- 30 天内合并 PR
- 6
描述
## Description
Background sub-agents launched via the `task` tool with `mode: "background"` and `agent_type: "general-purpose"` sometimes get stuck and never complete. The agent shows as "running" indefinitely. No completion notification arrives. `read_agent` with `wait: true` and a timeout returns the agent still running.
This doesn't happen every time, but it's frequent enough to be a real workflow blocker. The workaround is to abandon the stuck agent and re-launch as parallel `explore` agents instead, which reliably complete.
## Steps to Reproduce
1. Start an interactive Copilot CLI session
2. Launch a background general-purpose agent with a moderately complex prompt (e.g. scanning multiple directories, reading 20+ files, synthesising findings)
3. Wait for completion notification
## Expected Behaviour
The agent completes within a reasonable time (1-5 minutes) and sends a completion notification.
## Actual Behaviour
The agent stays in "running" state indefinitely. After 20+ minutes with no progress, the only option is to abandon it and work around the problem.
Notably, splitting the same work into 3 parallel `explore` agents completes in under 60 seconds each. The `general-purpose` agent type seems to hang on tasks that `explore` handles fine.
## Frequency
Observed in multiple sessions over the past week. Roughly 1 in 3 general-purpose background agents gets stuck. Explore agents have never gotten stuck for me.
## Environment
- Copilot CLI version: 1.0.34
- OS: macOS Tahoe 26.3.1 (Apple Silicon)
- Shell: zsh
- Terminal: Ghostty
## Workaround
Replace `general-purpose` background agents with parallel `explore` agents for read-heavy tasks. This reliably completes but limits you to Haiku and read-only tools.
贡献指南
调研方向
从面向通用 agent 的 task tool 的 background mode 以及交互式 Copilot CLI 会话中的 read_agent 等待路径开始。使用一个中等复杂、涉及多个目录的 prompt 重现该问题,并将其与并行的 explore agents 进行比较。当 background agent 在合理时间内完成并发送完成通知,而不是无限期保持运行时,即表示完成。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- shell
- 领域
- ai, cli
- Issue 类型
- 缺陷
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 活跃度
- 冷清
- 描述清晰度
- 需要澄清
- 新手友好度
- 35/100